Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix to correctly leave Gradle build scan results as a comment #5126

Merged
merged 2 commits into from
Aug 19, 2023

Conversation

ikhoon
Copy link
Contributor

@ikhoon ikhoon commented Aug 18, 2023

Motivation:

A pull request number fails to get retrieved from a commit SHA of a PR. Interestingly, it was not a problem while testing the feature in the personal repo. Because that happens only when the commit is made from a forked repository.

For example, the PR information of 529961c is retrieved by https://api.github.com/repos/minwoox/armeria/commits/529961c4a43fb884cf780421218de4f56f1aafcc/pulls but https://api.github.com/repos/line/armeria/commits/529961c4a43fb884cf780421218de4f56f1aafcc/pulls returns an empty array. Note that the owners of the repository are different.

As a result, the scan results are not updated as a comment of a PR.

if: steps.get-pr-number-by-sha.outputs.pr_number

Modifications:

  • Prepend a pull request number to the artifact names of scan results.
  • Remove get-pr-number-by-sha.ts and its dependencies

Result:

Correctly update build scan results.

Motivation:

A pull request number fails to get retrived from a commit SHA. It was
not a problem while testing the feature in the personal repo.
Because that happens only when the commit is maded from a forked repository.

For example, the PR number of line@529961c
can be retrived by https://api.github.com/repos/minwoox/armeria/commits/529961c4a43fb884cf780421218de4f56f1aafcc/pulls
but https://api.github.com/repos/line/armeria/commits/529961c4a43fb884cf780421218de4f56f1aafcc/pulls returns an empty array.
Note that the oweners of the repository are diffrent.

As a result, the scan results are not updated as a comment of a PR.
https://github.com/line/armeria/blob/0cd7094b763e6c501b08e2cd44bb1835eaa46eea/.github/workflows/gradle-build-scan.yml#L90-L90

Modifications:

- Prepend a pull request number to the artifact names of scan results.
- Remove `get-pr-number-by-sha.ts` and its dependencies

Result:

Correctly update build scan results.
Copy link
Member

@minwoox minwoox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 👍 👍

@ikhoon
Copy link
Contributor Author

ikhoon commented Aug 19, 2023

Let me merge this PR because the changes are clear and only CI workflows are modified.

@ikhoon ikhoon merged commit 1ce4c69 into line:main Aug 19, 2023
@ikhoon ikhoon deleted the ge-pr-number branch August 19, 2023 04:06
jrhee17 added a commit to jrhee17/armeria that referenced this pull request Aug 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants