You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "mumrah (via GitHub)" <gi...@apache.org> on 2024/09/09 16:37:59 UTC
[PR] MINOR Add status check for gradle scan [kafka]
mumrah opened a new pull request, #17140:
URL: https://github.com/apache/kafka/pull/17140
Add a commit status check so PRs can easily access the build scan.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] MINOR Add status check for gradle scan [kafka]
Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 commented on PR #17140:
URL: https://github.com/apache/kafka/pull/17140#issuecomment-2338792585
@mumrah just a discussion: Have you evaluated the runner quota? the [GitHub Actions Policy ](https://infra.apache.org/github-actions-policy.html) says:
```
The average number of minutes a project uses per calendar week MUST NOT exceed the equivalent of 25 full-time runners (250,000 minutes, or 4,200 hours).
```
If 1 commit needs 4 hours (4 checks + 2 test suits), we can run 1050 commits one week. The [Pulse](https://github.com/apache/kafka/pulse) says there are 54 merges/commits one week, so we have about 1000 remaining quota can be used by PRs. Hence, it seems kafka community will NOT burn out GitHub runner. WDYT?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] MINOR Add status check for gradle scan [kafka]
Posted by "mumrah (via GitHub)" <gi...@apache.org>.
mumrah commented on PR #17140:
URL: https://github.com/apache/kafka/pull/17140#issuecomment-2338640680
Example of when the CI workflow does not produce any build scan artifacts:
https://github.com/mumrah/kafka/actions/runs/10777726936
Example of when it does produce artifacts, and publishes:
https://github.com/mumrah/kafka/actions/runs/10777816130
PR
<img width="869" alt="image" src="https://github.com/user-attachments/assets/fe23bbda-c577-4b9f-ad4b-e6cbef27cee3">
Example of when it does produce artifacts, but fails to publish:
Job: https://github.com/mumrah/kafka/actions/runs/10777898146 (in a real failure, there would be no build scan links here)
PR
<img width="870" alt="image" src="https://github.com/user-attachments/assets/c0f53eab-e64c-41f9-b0bc-7c4d108520ac">
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] MINOR Add status check for gradle scan [kafka]
Posted by "mumrah (via GitHub)" <gi...@apache.org>.
mumrah commented on code in PR #17140:
URL: https://github.com/apache/kafka/pull/17140#discussion_r1750694224
##########
.github/workflows/ci-complete.yml:
##########
@@ -44,11 +60,48 @@ jobs:
with:
java-version: ${{ matrix.java }}
develocity-access-key: ${{ secrets.GE_ACCESS_TOKEN }}
- - uses: actions/download-artifact@v4
+ - name: Download build scan archive
+ id: download-build-scan
+ uses: actions/download-artifact@v4
+ continue-on-error: true
with:
github-token: ${{ github.token }}
run-id: ${{ github.event.workflow_run.id }}
name: build-scan-test-${{ matrix.java }}
- path: ~/.gradle/build-scan-data
- - name: Publish scan
- run: ./gradlew --info buildScanPublishPrevious
+ path: ~/.gradle/build-scan-data # This is where Gradle buffers unpublished build scan data when --no-scan is given
+ - name: Handle missing scan
+ if: ${{ steps.download-build-scan.outcome == 'failure' }}
+ run: |
+ echo "Could not download build scans from ${{ github.event.workflow_run.html_url }} " >> $GITHUB_STEP_SUMMARY
+ - name: Publish Scan
+ id: publish-build-scan
+ continue-on-error: true
+ if: ${{ steps.download-build-scan.outcome == 'success' }}
+ run: |
+ ./gradlew --info buildScanPublishPrevious > gradle.out
+ SCAN_URL=$(grep '^https://.*$' gradle.out)
+ cat gradle.out
Review Comment:
yes, just in case something fails we can see the gradle output
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] MINOR Add status check for gradle scan [kafka]
Posted by "mumrah (via GitHub)" <gi...@apache.org>.
mumrah commented on PR #17140:
URL: https://github.com/apache/kafka/pull/17140#issuecomment-2338800647
@chia7712
> Have you evaluated the runner quota
I've been watching the Infra report here https://infra-reports.apache.org/#ghactions (requires committer sign-in). Right now, the "CI" workflow (both trunk and PRs) has averaged 3 full-time runners over the last week.
> Hence, it seems kafka community will NOT burn out GitHub runner. WDYT?
I think this is correct. Even with the addition of all PRs running the full test suite, I think we'll be well under this limit. Part of the reason I wanted to get caching working before turning it on for all PRs was to avoid increasing our usage too much.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] MINOR Add status check for gradle scan [kafka]
Posted by "mumrah (via GitHub)" <gi...@apache.org>.
mumrah commented on code in PR #17140:
URL: https://github.com/apache/kafka/pull/17140#discussion_r1750772681
##########
.github/workflows/ci-complete.yml:
##########
@@ -44,11 +60,48 @@ jobs:
with:
java-version: ${{ matrix.java }}
develocity-access-key: ${{ secrets.GE_ACCESS_TOKEN }}
- - uses: actions/download-artifact@v4
+ - name: Download build scan archive
+ id: download-build-scan
+ uses: actions/download-artifact@v4
+ continue-on-error: true
with:
github-token: ${{ github.token }}
run-id: ${{ github.event.workflow_run.id }}
name: build-scan-test-${{ matrix.java }}
- path: ~/.gradle/build-scan-data
- - name: Publish scan
- run: ./gradlew --info buildScanPublishPrevious
+ path: ~/.gradle/build-scan-data # This is where Gradle buffers unpublished build scan data when --no-scan is given
+ - name: Handle missing scan
+ if: ${{ steps.download-build-scan.outcome == 'failure' }}
+ run: |
+ echo "Could not download build scans from ${{ github.event.workflow_run.html_url }} " >> $GITHUB_STEP_SUMMARY
+ - name: Publish Scan
+ id: publish-build-scan
+ continue-on-error: true
+ if: ${{ steps.download-build-scan.outcome == 'success' }}
+ run: |
+ ./gradlew --info buildScanPublishPrevious > gradle.out
Review Comment:
You can see the `--no-scan` working here https://github.com/apache/kafka/actions/runs/10779482765/job/29893102166?pr=17140#step:6:3
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] MINOR Add status check for gradle scan [kafka]
Posted by "mumrah (via GitHub)" <gi...@apache.org>.
mumrah commented on code in PR #17140:
URL: https://github.com/apache/kafka/pull/17140#discussion_r1750710888
##########
.github/workflows/ci-complete.yml:
##########
@@ -44,11 +60,48 @@ jobs:
with:
java-version: ${{ matrix.java }}
develocity-access-key: ${{ secrets.GE_ACCESS_TOKEN }}
- - uses: actions/download-artifact@v4
+ - name: Download build scan archive
+ id: download-build-scan
+ uses: actions/download-artifact@v4
+ continue-on-error: true
with:
github-token: ${{ github.token }}
run-id: ${{ github.event.workflow_run.id }}
name: build-scan-test-${{ matrix.java }}
- path: ~/.gradle/build-scan-data
- - name: Publish scan
- run: ./gradlew --info buildScanPublishPrevious
+ path: ~/.gradle/build-scan-data # This is where Gradle buffers unpublished build scan data when --no-scan is given
+ - name: Handle missing scan
+ if: ${{ steps.download-build-scan.outcome == 'failure' }}
+ run: |
+ echo "Could not download build scans from ${{ github.event.workflow_run.html_url }} " >> $GITHUB_STEP_SUMMARY
+ - name: Publish Scan
+ id: publish-build-scan
+ continue-on-error: true
+ if: ${{ steps.download-build-scan.outcome == 'success' }}
+ run: |
+ ./gradlew --info buildScanPublishPrevious > gradle.out
+ SCAN_URL=$(grep '^https://.*$' gradle.out)
+ cat gradle.out
+ echo "Published build scan to $SCAN_URL"
+ echo "build-scan-url=$SCAN_URL" >> $GITHUB_OUTPUT
+ - name: Handle failed publish
+ if: ${{ steps.publish-build-scan.outcome == 'failure' }}
+ uses: ./.github/actions/gh-api-update-status
+ with:
+ gh-token: ${{ secrets.GITHUB_TOKEN }}
+ repository: ${{ github.event.workflow_run.head_repository.full_name }}
+ commit_sha: ${{ github.event.workflow_run.head_sha }}
+ url: '${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id }}'
Review Comment:
A good question. I originally had the API call here directly, but decided it might be useful for other custom status checks we might eventually want. I also tried it as a bash script, but realized a composite action is more reusable.
Aesthetically speaking, the composite action looks nicer IMO. The API call itself is a multi-line bash command with headers and such. It's not as pretty looking at the `with` block of a composite action 😄
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] MINOR Add status check for gradle scan [kafka]
Posted by "mumrah (via GitHub)" <gi...@apache.org>.
mumrah commented on code in PR #17140:
URL: https://github.com/apache/kafka/pull/17140#discussion_r1750765506
##########
.github/workflows/ci-complete.yml:
##########
@@ -44,11 +60,48 @@ jobs:
with:
java-version: ${{ matrix.java }}
develocity-access-key: ${{ secrets.GE_ACCESS_TOKEN }}
- - uses: actions/download-artifact@v4
+ - name: Download build scan archive
+ id: download-build-scan
+ uses: actions/download-artifact@v4
+ continue-on-error: true
with:
github-token: ${{ github.token }}
run-id: ${{ github.event.workflow_run.id }}
name: build-scan-test-${{ matrix.java }}
- path: ~/.gradle/build-scan-data
- - name: Publish scan
- run: ./gradlew --info buildScanPublishPrevious
+ path: ~/.gradle/build-scan-data # This is where Gradle buffers unpublished build scan data when --no-scan is given
+ - name: Handle missing scan
+ if: ${{ steps.download-build-scan.outcome == 'failure' }}
+ run: |
+ echo "Could not download build scans from ${{ github.event.workflow_run.html_url }} " >> $GITHUB_STEP_SUMMARY
+ - name: Publish Scan
+ id: publish-build-scan
+ continue-on-error: true
+ if: ${{ steps.download-build-scan.outcome == 'success' }}
+ run: |
+ ./gradlew --info buildScanPublishPrevious > gradle.out
Review Comment:
We can keep the `--scan` for trunk builds and use `--no-scan` for PRs. I'll update that.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] MINOR Add status check for gradle scan [kafka]
Posted by "mumrah (via GitHub)" <gi...@apache.org>.
mumrah commented on PR #17140:
URL: https://github.com/apache/kafka/pull/17140#issuecomment-2338647706
@chia7712 I have added an explanation of how this workflow works with the CI here https://github.com/apache/kafka/pull/17140/files#diff-03dbd91a7c60e880a3123759ea4ab422044357e5d1d75450d63bbcbd064cd0d9R26-R36
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] MINOR Add status check for gradle scan [kafka]
Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 commented on code in PR #17140:
URL: https://github.com/apache/kafka/pull/17140#discussion_r1750727518
##########
.github/workflows/ci-complete.yml:
##########
@@ -44,11 +60,48 @@ jobs:
with:
java-version: ${{ matrix.java }}
develocity-access-key: ${{ secrets.GE_ACCESS_TOKEN }}
- - uses: actions/download-artifact@v4
+ - name: Download build scan archive
+ id: download-build-scan
+ uses: actions/download-artifact@v4
+ continue-on-error: true
with:
github-token: ${{ github.token }}
run-id: ${{ github.event.workflow_run.id }}
name: build-scan-test-${{ matrix.java }}
- path: ~/.gradle/build-scan-data
- - name: Publish scan
- run: ./gradlew --info buildScanPublishPrevious
+ path: ~/.gradle/build-scan-data # This is where Gradle buffers unpublished build scan data when --no-scan is given
+ - name: Handle missing scan
+ if: ${{ steps.download-build-scan.outcome == 'failure' }}
+ run: |
+ echo "Could not download build scans from ${{ github.event.workflow_run.html_url }} " >> $GITHUB_STEP_SUMMARY
+ - name: Publish Scan
+ id: publish-build-scan
+ continue-on-error: true
+ if: ${{ steps.download-build-scan.outcome == 'success' }}
+ run: |
+ ./gradlew --info buildScanPublishPrevious > gradle.out
+ SCAN_URL=$(grep '^https://.*$' gradle.out)
+ cat gradle.out
+ echo "Published build scan to $SCAN_URL"
+ echo "build-scan-url=$SCAN_URL" >> $GITHUB_OUTPUT
+ - name: Handle failed publish
+ if: ${{ steps.publish-build-scan.outcome == 'failure' }}
+ uses: ./.github/actions/gh-api-update-status
+ with:
+ gh-token: ${{ secrets.GITHUB_TOKEN }}
+ repository: ${{ github.event.workflow_run.head_repository.full_name }}
+ commit_sha: ${{ github.event.workflow_run.head_sha }}
+ url: '${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id }}'
Review Comment:
> Aesthetically speaking, the composite action looks nicer IMO.
agree :smile:
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] MINOR Add status check for gradle scan [kafka]
Posted by "mumrah (via GitHub)" <gi...@apache.org>.
mumrah commented on code in PR #17140:
URL: https://github.com/apache/kafka/pull/17140#discussion_r1750765506
##########
.github/workflows/ci-complete.yml:
##########
@@ -44,11 +60,48 @@ jobs:
with:
java-version: ${{ matrix.java }}
develocity-access-key: ${{ secrets.GE_ACCESS_TOKEN }}
- - uses: actions/download-artifact@v4
+ - name: Download build scan archive
+ id: download-build-scan
+ uses: actions/download-artifact@v4
+ continue-on-error: true
with:
github-token: ${{ github.token }}
run-id: ${{ github.event.workflow_run.id }}
name: build-scan-test-${{ matrix.java }}
- path: ~/.gradle/build-scan-data
- - name: Publish scan
- run: ./gradlew --info buildScanPublishPrevious
+ path: ~/.gradle/build-scan-data # This is where Gradle buffers unpublished build scan data when --no-scan is given
+ - name: Handle missing scan
+ if: ${{ steps.download-build-scan.outcome == 'failure' }}
+ run: |
+ echo "Could not download build scans from ${{ github.event.workflow_run.html_url }} " >> $GITHUB_STEP_SUMMARY
+ - name: Publish Scan
+ id: publish-build-scan
+ continue-on-error: true
+ if: ${{ steps.download-build-scan.outcome == 'success' }}
+ run: |
+ ./gradlew --info buildScanPublishPrevious > gradle.out
Review Comment:
We can keep the `--scan` for trunk builds and use `--no-scan` for PRs. I'll update that. It's useful to keep the scans for trunk since it will let us observe our compile times over time.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] MINOR Add status check for gradle scan [kafka]
Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 commented on code in PR #17140:
URL: https://github.com/apache/kafka/pull/17140#discussion_r1750731398
##########
.github/workflows/ci-complete.yml:
##########
@@ -21,14 +21,30 @@ on:
types:
- completed
+run-name: Build Scans for ${{ github.event.workflow_run.display_title}}
+
+# This workflow runs after the completion of the CI workflow triggered on a "pull_request" event.
+# The "pull_request" event type is run in an unprivileged context without access to the repository
+# secrets. This means that PRs from public forks cannot publish Gradle Build Scans or modify the
+# PR contents.
+#
+# This "workflow_run" triggered workflow is run in a privileged context and so does have access to
+# the repository secrets. Here we can download the build scan files produced by a PR and publish
+# them to ge.apache.org.
+#
+# If we need to do things like comment on, label, or otherwise modify PRs from public forks. This
+# workflow is the place to do it. PR number is ${{ github.event.workflow_run.pull_requests[0].number }}
+
jobs:
upload-build-scan:
- if: ${{ github.event.workflow_run.head_repository.full_name != 'apache/kafka' }}
+ # Skip this workflow if CI was run for anything other than "pull_request" (like "push").
+ # Also skip this workflow if the PR was from apache/kafka. Those will have already published the build scan in CI.
+ if: ${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.head_repository.full_name != 'apache/kafka' }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
- java: [ 21, 17, 11, 8 ]
+ java: [ 17, 11 ]
Review Comment:
Could you please comment to https://github.com/apache/kafka/blob/trunk/.github/workflows/build.yml#L88 to remind that we need to keep the JDK consistency.
##########
.github/workflows/ci-complete.yml:
##########
@@ -44,11 +60,48 @@ jobs:
with:
java-version: ${{ matrix.java }}
develocity-access-key: ${{ secrets.GE_ACCESS_TOKEN }}
- - uses: actions/download-artifact@v4
+ - name: Download build scan archive
+ id: download-build-scan
+ uses: actions/download-artifact@v4
+ continue-on-error: true
with:
github-token: ${{ github.token }}
run-id: ${{ github.event.workflow_run.id }}
name: build-scan-test-${{ matrix.java }}
- path: ~/.gradle/build-scan-data
- - name: Publish scan
- run: ./gradlew --info buildScanPublishPrevious
+ path: ~/.gradle/build-scan-data # This is where Gradle buffers unpublished build scan data when --no-scan is given
+ - name: Handle missing scan
+ if: ${{ steps.download-build-scan.outcome == 'failure' }}
+ run: |
+ echo "Could not download build scans from ${{ github.event.workflow_run.html_url }} " >> $GITHUB_STEP_SUMMARY
+ - name: Publish Scan
+ id: publish-build-scan
+ continue-on-error: true
+ if: ${{ steps.download-build-scan.outcome == 'success' }}
+ run: |
+ ./gradlew --info buildScanPublishPrevious > gradle.out
Review Comment:
Do we still need to publish build scan in the `Compile and validate` phase? It can't work with public fork and we already collect all PRs' scan, so maybe we can remove the `--scan` from `Compile and validate` phase
https://github.com/apache/kafka/blob/trunk/.github/workflows/build.yml#L66
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] MINOR Add status check for gradle scan [kafka]
Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 commented on code in PR #17140:
URL: https://github.com/apache/kafka/pull/17140#discussion_r1750640368
##########
.github/workflows/ci-complete.yml:
##########
@@ -44,11 +60,48 @@ jobs:
with:
java-version: ${{ matrix.java }}
develocity-access-key: ${{ secrets.GE_ACCESS_TOKEN }}
- - uses: actions/download-artifact@v4
+ - name: Download build scan archive
+ id: download-build-scan
+ uses: actions/download-artifact@v4
+ continue-on-error: true
with:
github-token: ${{ github.token }}
run-id: ${{ github.event.workflow_run.id }}
name: build-scan-test-${{ matrix.java }}
- path: ~/.gradle/build-scan-data
- - name: Publish scan
- run: ./gradlew --info buildScanPublishPrevious
+ path: ~/.gradle/build-scan-data # This is where Gradle buffers unpublished build scan data when --no-scan is given
+ - name: Handle missing scan
+ if: ${{ steps.download-build-scan.outcome == 'failure' }}
+ run: |
+ echo "Could not download build scans from ${{ github.event.workflow_run.html_url }} " >> $GITHUB_STEP_SUMMARY
+ - name: Publish Scan
+ id: publish-build-scan
+ continue-on-error: true
+ if: ${{ steps.download-build-scan.outcome == 'success' }}
+ run: |
+ ./gradlew --info buildScanPublishPrevious > gradle.out
+ SCAN_URL=$(grep '^https://.*$' gradle.out)
+ cat gradle.out
+ echo "Published build scan to $SCAN_URL"
Review Comment:
Maybe we can add it to `GITHUB_STEP_SUMMARY`?
##########
.github/workflows/ci-complete.yml:
##########
@@ -44,11 +60,48 @@ jobs:
with:
java-version: ${{ matrix.java }}
develocity-access-key: ${{ secrets.GE_ACCESS_TOKEN }}
- - uses: actions/download-artifact@v4
+ - name: Download build scan archive
+ id: download-build-scan
+ uses: actions/download-artifact@v4
+ continue-on-error: true
with:
github-token: ${{ github.token }}
run-id: ${{ github.event.workflow_run.id }}
name: build-scan-test-${{ matrix.java }}
- path: ~/.gradle/build-scan-data
- - name: Publish scan
- run: ./gradlew --info buildScanPublishPrevious
+ path: ~/.gradle/build-scan-data # This is where Gradle buffers unpublished build scan data when --no-scan is given
+ - name: Handle missing scan
+ if: ${{ steps.download-build-scan.outcome == 'failure' }}
+ run: |
+ echo "Could not download build scans from ${{ github.event.workflow_run.html_url }} " >> $GITHUB_STEP_SUMMARY
+ - name: Publish Scan
+ id: publish-build-scan
+ continue-on-error: true
+ if: ${{ steps.download-build-scan.outcome == 'success' }}
+ run: |
+ ./gradlew --info buildScanPublishPrevious > gradle.out
+ SCAN_URL=$(grep '^https://.*$' gradle.out)
+ cat gradle.out
Review Comment:
this is for debugging, right?
##########
.github/workflows/ci-complete.yml:
##########
@@ -44,11 +60,48 @@ jobs:
with:
java-version: ${{ matrix.java }}
develocity-access-key: ${{ secrets.GE_ACCESS_TOKEN }}
- - uses: actions/download-artifact@v4
+ - name: Download build scan archive
+ id: download-build-scan
+ uses: actions/download-artifact@v4
+ continue-on-error: true
with:
github-token: ${{ github.token }}
run-id: ${{ github.event.workflow_run.id }}
name: build-scan-test-${{ matrix.java }}
- path: ~/.gradle/build-scan-data
- - name: Publish scan
- run: ./gradlew --info buildScanPublishPrevious
+ path: ~/.gradle/build-scan-data # This is where Gradle buffers unpublished build scan data when --no-scan is given
+ - name: Handle missing scan
+ if: ${{ steps.download-build-scan.outcome == 'failure' }}
+ run: |
+ echo "Could not download build scans from ${{ github.event.workflow_run.html_url }} " >> $GITHUB_STEP_SUMMARY
+ - name: Publish Scan
+ id: publish-build-scan
+ continue-on-error: true
+ if: ${{ steps.download-build-scan.outcome == 'success' }}
+ run: |
+ ./gradlew --info buildScanPublishPrevious > gradle.out
+ SCAN_URL=$(grep '^https://.*$' gradle.out)
+ cat gradle.out
+ echo "Published build scan to $SCAN_URL"
+ echo "build-scan-url=$SCAN_URL" >> $GITHUB_OUTPUT
+ - name: Handle failed publish
+ if: ${{ steps.publish-build-scan.outcome == 'failure' }}
+ uses: ./.github/actions/gh-api-update-status
+ with:
+ gh-token: ${{ secrets.GITHUB_TOKEN }}
+ repository: ${{ github.event.workflow_run.head_repository.full_name }}
+ commit_sha: ${{ github.event.workflow_run.head_sha }}
+ url: '${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id }}'
Review Comment:
It seems only two fields (`url` and `description`) are different. the value of `state` can be replaced by `steps.publish-build-scan.outcome`. Hence, do we still need extra `action.yml` file to set status? or we can call github APIs by script here?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] MINOR Add status check for gradle scan [kafka]
Posted by "mumrah (via GitHub)" <gi...@apache.org>.
mumrah merged PR #17140:
URL: https://github.com/apache/kafka/pull/17140
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org