Skip to content

Conversation

@HyukjinKwon
Copy link
Owner

No description provided.

@github-actions github-actions bot added the DOCS label Jan 12, 2022
@github-actions github-actions bot added the INFRA label Jan 12, 2022
@HyukjinKwon HyukjinKwon reopened this Jan 12, 2022
dongjoon-hyun pushed a commit to apache/spark that referenced this pull request Jan 12, 2022
### What changes were proposed in this pull request?

This PR proposes to show the link of Check run view instead of Actions view. Previously, when you add a new custom Check, e.g., [test_report.yml](https://github.com/apache/spark/blob/master/.github/workflows/test_report.yml), Actions view also showed this Check.

Now, seems GitHub Actions changed the behaviour - Actions view always includes the jobs initiated by the specific Workflow e.g., [build_and_test.yml](https://github.com/apache/spark/blob/master/.github/workflows/build_and_test.yml) does not include the custom Check added from [test_report.yml](https://github.com/apache/spark/blob/master/.github/workflows/test_report.yml).

To work around this problem, this PR proposes to show the link of:
Check run view e.g., https://github.com/apache/spark/runs/4785069876 ("Report test results" is included) instead of
Actions view e.g., https://github.com/apache/spark/actions/runs/1686013487 ("Report test results" is missing) .

After this PR, when developers click the link here:

![Screen Shot 2022-01-12 at 10 07 26 PM](https://user-images.githubusercontent.com/6477701/149146026-80f3ac26-ba06-411f-9cb8-f5395ffd8432.png)

it will open a Check run view instead of Actions view which does not have test report tab.

### Why are the changes needed?

For developers to see the test report, and they can easily detect which test is failed.

### Does this PR introduce _any_ user-facing change?

No, dev-only

### How was this patch tested?

Manually tested at HyukjinKwon#51.

Closes #35179 from HyukjinKwon/show-test-report.

Authored-by: Hyukjin Kwon <gurwls223@apache.org>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
@HyukjinKwon HyukjinKwon reopened this Jan 13, 2022
@HyukjinKwon HyukjinKwon force-pushed the test-branch branch 2 times, most recently from 5bec994 to bb9ff06 Compare January 13, 2022 11:52
HyukjinKwon added a commit to apache/spark that referenced this pull request Jan 13, 2022
### What changes were proposed in this pull request?

This PR is a retry of #35179. This PR does the same thing - replacing Actions view to Check run view for `See test results` link.

The main difference with the PR #35179 is that we now keep the Actions run id as is as metadata so this Actions run id can be used to update the status of tests in PRs at Apache Spark:

https://github.com/apache/spark/blob/85efc85f9aa93b3fac9e591c96efa38d4414adf8/.github/workflows/update_build_status.yml#L63-L74

Now this PR shouldn't affect [update_build_status.yml](https://github.com/apache/spark/blob/master/.github/workflows/update_build_status.yml) which was the main reason of a followup and revert.

### Why are the changes needed?

For developers to see the test report, and they can easily detect which test is failed.

### Does this PR introduce _any_ user-facing change?

No, dev-only

### How was this patch tested?

Tested in HyukjinKwon#51.

Closes #35193 from HyukjinKwon/SPARK-37879-retry.

Authored-by: Hyukjin Kwon <gurwls223@apache.org>
Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
dchvn pushed a commit to dchvn/spark that referenced this pull request Jan 19, 2022
### What changes were proposed in this pull request?

This PR proposes to show the link of Check run view instead of Actions view. Previously, when you add a new custom Check, e.g., [test_report.yml](https://github.com/apache/spark/blob/master/.github/workflows/test_report.yml), Actions view also showed this Check.

Now, seems GitHub Actions changed the behaviour - Actions view always includes the jobs initiated by the specific Workflow e.g., [build_and_test.yml](https://github.com/apache/spark/blob/master/.github/workflows/build_and_test.yml) does not include the custom Check added from [test_report.yml](https://github.com/apache/spark/blob/master/.github/workflows/test_report.yml).

To work around this problem, this PR proposes to show the link of:
Check run view e.g., https://github.com/apache/spark/runs/4785069876 ("Report test results" is included) instead of
Actions view e.g., https://github.com/apache/spark/actions/runs/1686013487 ("Report test results" is missing) .

After this PR, when developers click the link here:

![Screen Shot 2022-01-12 at 10 07 26 PM](https://user-images.githubusercontent.com/6477701/149146026-80f3ac26-ba06-411f-9cb8-f5395ffd8432.png)

it will open a Check run view instead of Actions view which does not have test report tab.

### Why are the changes needed?

For developers to see the test report, and they can easily detect which test is failed.

### Does this PR introduce _any_ user-facing change?

No, dev-only

### How was this patch tested?

Manually tested at HyukjinKwon#51.

Closes apache#35179 from HyukjinKwon/show-test-report.

Authored-by: Hyukjin Kwon <gurwls223@apache.org>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
dchvn pushed a commit to dchvn/spark that referenced this pull request Jan 19, 2022
### What changes were proposed in this pull request?

This PR is a retry of apache#35179. This PR does the same thing - replacing Actions view to Check run view for `See test results` link.

The main difference with the PR apache#35179 is that we now keep the Actions run id as is as metadata so this Actions run id can be used to update the status of tests in PRs at Apache Spark:

https://github.com/apache/spark/blob/85efc85f9aa93b3fac9e591c96efa38d4414adf8/.github/workflows/update_build_status.yml#L63-L74

Now this PR shouldn't affect [update_build_status.yml](https://github.com/apache/spark/blob/master/.github/workflows/update_build_status.yml) which was the main reason of a followup and revert.

### Why are the changes needed?

For developers to see the test report, and they can easily detect which test is failed.

### Does this PR introduce _any_ user-facing change?

No, dev-only

### How was this patch tested?

Tested in HyukjinKwon#51.

Closes apache#35193 from HyukjinKwon/SPARK-37879-retry.

Authored-by: Hyukjin Kwon <gurwls223@apache.org>
Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
@HyukjinKwon HyukjinKwon deleted the test-branch branch January 15, 2024 00:53
HyukjinKwon pushed a commit that referenced this pull request Jul 23, 2025
…ingBuilder`

### What changes were proposed in this pull request?

This PR aims to improve `toString` by `JEP-280` instead of `ToStringBuilder`. In addition, `Scalastyle` and `Checkstyle` rules are added to prevent a future regression.

### Why are the changes needed?

Since Java 9, `String Concatenation` has been handled better by default.

| ID | DESCRIPTION |
| - | - |
| JEP-280 | [Indify String Concatenation](https://openjdk.org/jeps/280) |

For example, this PR improves `OpenBlocks` like the following. Both Java source code and byte code are simplified a lot by utilizing JEP-280 properly.

**CODE CHANGE**
```java

- return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE)
-   .append("appId", appId)
-   .append("execId", execId)
-   .append("blockIds", Arrays.toString(blockIds))
-   .toString();
+ return "OpenBlocks[appId=" + appId + ",execId=" + execId + ",blockIds=" +
+     Arrays.toString(blockIds) + "]";
```

**BEFORE**
```
  public java.lang.String toString();
    Code:
       0: new           #39                 // class org/apache/commons/lang3/builder/ToStringBuilder
       3: dup
       4: aload_0
       5: getstatic     #41                 // Field org/apache/commons/lang3/builder/ToStringStyle.SHORT_PREFIX_STYLE:Lorg/apache/commons/lang3/builder/ToStringStyle;
       8: invokespecial #47                 // Method org/apache/commons/lang3/builder/ToStringBuilder."<init>":(Ljava/lang/Object;Lorg/apache/commons/lang3/builder/ToStringStyle;)V
      11: ldc           #50                 // String appId
      13: aload_0
      14: getfield      #7                  // Field appId:Ljava/lang/String;
      17: invokevirtual #51                 // Method org/apache/commons/lang3/builder/ToStringBuilder.append:(Ljava/lang/String;Ljava/lang/Object;)Lorg/apache/commons/lang3/builder/ToStringBuilder;
      20: ldc           apache#55                 // String execId
      22: aload_0
      23: getfield      #13                 // Field execId:Ljava/lang/String;
      26: invokevirtual #51                 // Method org/apache/commons/lang3/builder/ToStringBuilder.append:(Ljava/lang/String;Ljava/lang/Object;)Lorg/apache/commons/lang3/builder/ToStringBuilder;
      29: ldc           apache#56                 // String blockIds
      31: aload_0
      32: getfield      #16                 // Field blockIds:[Ljava/lang/String;
      35: invokestatic  apache#57                 // Method java/util/Arrays.toString:([Ljava/lang/Object;)Ljava/lang/String;
      38: invokevirtual #51                 // Method org/apache/commons/lang3/builder/ToStringBuilder.append:(Ljava/lang/String;Ljava/lang/Object;)Lorg/apache/commons/lang3/builder/ToStringBuilder;
      41: invokevirtual apache#61                 // Method org/apache/commons/lang3/builder/ToStringBuilder.toString:()Ljava/lang/String;
      44: areturn
```

**AFTER**
```
  public java.lang.String toString();
    Code:
       0: aload_0
       1: getfield      #7                  // Field appId:Ljava/lang/String;
       4: aload_0
       5: getfield      #13                 // Field execId:Ljava/lang/String;
       8: aload_0
       9: getfield      #16                 // Field blockIds:[Ljava/lang/String;
      12: invokestatic  #39                 // Method java/util/Arrays.toString:([Ljava/lang/Object;)Ljava/lang/String;
      15: invokedynamic #43,  0             // InvokeDynamic #0:makeConcatWithConstants:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
      20: areturn
```

### Does this PR introduce _any_ user-facing change?

No. This is an `toString` implementation improvement.

### How was this patch tested?

Pass the CIs.

### Was this patch authored or co-authored using generative AI tooling?

No.

Closes apache#51572 from dongjoon-hyun/SPARK-52880.

Authored-by: Dongjoon Hyun <dongjoon@apache.org>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants