Skip to content

[llvm][GitHub] Move PR project status to Done once backport PR is made #126374

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

Merged
merged 3 commits into from
Feb 10, 2025

Conversation

tstellar
Copy link
Collaborator

@tstellar tstellar commented Feb 8, 2025

It's common to use the /cherry-pick command on a PR to create a backport request. However, this creates a lot of clutter in the LLVM Release Status project, because we end up with two items in the project, one for the original PR and one for the new PR.

This change will set the status of the original PR to Done once the new PR (for the release branch) is created. This will save release managers a lot of work of having to manually updated the status for PRs that contain backport requests.

It's common to use the /cherry-pick command on a PR to create a backport
request.  However, this creates a lot of clutter in the LLVM Release
Status project, because we end up with two items in the project, one
for the original PR and one for the new PR.

This change will set the status of the original PR to Done once the new
PR (for the release branch) is created.  This will save release managers
a lot of work of having to manually updated the status for PRs that
contain backport requests.
@tstellar tstellar requested a review from tru February 8, 2025 16:31
Copy link

github-actions bot commented Feb 8, 2025

✅ With the latest revision this PR passed the Python code formatter.

@tru
Copy link
Collaborator

tru commented Feb 10, 2025

Looks good! It has been annoying to have these issues around.

@tstellar tstellar merged commit cd26c11 into llvm:main Feb 10, 2025
8 checks passed
Icohedron pushed a commit to Icohedron/llvm-project that referenced this pull request Feb 11, 2025
llvm#126374)

It's common to use the /cherry-pick command on a PR to create a backport
request. However, this creates a lot of clutter in the LLVM Release
Status project, because we end up with two items in the project, one for
the original PR and one for the new PR.

This change will set the status of the original PR to Done once the new
PR (for the release branch) is created. This will save release managers
a lot of work of having to manually updated the status for PRs that
contain backport requests.
@nikic
Copy link
Contributor

nikic commented Feb 12, 2025

Looks like this causes a permissions error: https://github.com/llvm/llvm-project/actions/runs/13282944762/job/37085167144

/home/runner/work/llvm-project/llvm-project/./llvm/utils/git/github-automation.py:57: SyntaxWarning: invalid escape sequence '\w'
  str = re.sub("@(?=\w)", "@<!-- -->", str)
/home/runner/work/llvm-project/llvm-project/./llvm/utils/git/github-automation.py:59: SyntaxWarning: invalid escape sequence '\d'
  str = re.sub("#(?=\d)", "#<!-- -->", str)
/home/runner/work/llvm-project/llvm-project/./llvm/utils/git/github-automation.py:632: SyntaxWarning: invalid escape sequence '\('
  m = re.search("\(cherry picked from commit ([0-9a-f]+)\)", message)
cherry-picking ['0abe058d7f99c9c7bbaf4ee98308c5e78d229897']
Pushing to https://***@github.com/llvmbot/llvm-project issue126698
{'date': 'Wed, 12 Feb 2025 10:17:02 GMT', 'content-type': 'application/json; charset=utf-8', 'x-oauth-scopes': 'project, public_repo', 'x-accepted-oauth-scopes': 'repo', 'github-authentication-token-expiration': '2025-03-04 08:00:00 UTC', 'x-github-media-type': 'github.v4; format=json', 'x-ratelimit-limit': '5000', 'x-ratelimit-remaining': '4999', 'x-ratelimit-reset': '1739359022', 'x-ratelimit-used': '1', 'x-ratelimit-resource': 'graphql', 'access-control-expose-headers': 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset', 'access-control-allow-origin': '*', 'strict-transport-security': 'max-age=31536000; includeSubdomains; preload', 'x-frame-options': 'deny', 'x-content-type-options': 'nosniff', 'x-xss-protection': '0', 'referrer-policy': 'origin-when-cross-origin, strict-origin-when-cross-origin', 'content-security-policy': "default-src 'none'", 'vary': 'Accept-Encoding, Accept, X-Requested-With', 'content-encoding': 'gzip', 'transfer-encoding': 'chunked', 'server': 'github.com', 'x-github-request-id': 'B85D:29035E:2F60694:30CB1C9:67AC751E'}
Traceback (most recent call last):
  File "/home/runner/work/llvm-project/llvm-project/./llvm/utils/git/github-automation.py", line 932, in <module>
  File "/home/runner/work/llvm-project/llvm-project/./llvm/utils/git/github-automation.py", line 780, in execute_command
  File "/home/runner/work/llvm-project/llvm-project/./llvm/utils/git/github-automation.py", line 691, in create_branch
    "--issue-number", type=int, required=True, help="The issue number to update"
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/llvm-project/llvm-project/./llvm/utils/git/github-automation.py", line 759, in create_pull_request
    args.branch_repo,
    ^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/llvm-project/llvm-project/./llvm/utils/git/github-automation.py", line 562, in update_issue_project_status
    if release_branch_for_issue is None:
                                   ^^^^^
  File "/home/runner/.local/lib/python3.12/site-packages/github/Requester.py", line 581, in graphql_query
    raise self.createException(400, response_headers, data)
github.GithubException.GithubException: 400 {"data": {"set_status": null}, "errors": [{"type": "FORBIDDEN", "path": ["set_status"], "locations": [{"line": 3, "column": 21}], "message": "llvmbot does not have the correct permissions to execute `UpdateProjectV2ItemFieldValue`"}]}

@tstellar
Copy link
Collaborator Author

@nikic I think this is fixed now, the error shouldn't impact any other parts of the script.

joaosaffran pushed a commit to joaosaffran/llvm-project that referenced this pull request Feb 14, 2025
llvm#126374)

It's common to use the /cherry-pick command on a PR to create a backport
request. However, this creates a lot of clutter in the LLVM Release
Status project, because we end up with two items in the project, one for
the original PR and one for the new PR.

This change will set the status of the original PR to Done once the new
PR (for the release branch) is created. This will save release managers
a lot of work of having to manually updated the status for PRs that
contain backport requests.
sivan-shani pushed a commit to sivan-shani/llvm-project that referenced this pull request Feb 24, 2025
llvm#126374)

It's common to use the /cherry-pick command on a PR to create a backport
request. However, this creates a lot of clutter in the LLVM Release
Status project, because we end up with two items in the project, one for
the original PR and one for the new PR.

This change will set the status of the original PR to Done once the new
PR (for the release branch) is created. This will save release managers
a lot of work of having to manually updated the status for PRs that
contain backport requests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants