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
.github/workflows: add rebase-staging.yml #107520
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds like a great idea!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it.
How do we trigger it?
You need to comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 I like the idea.
- How can this be documented so that people know about its existence? (maybe update the PR template?)
- Did you try this out? I'm not sure that it would work for third-party contributors.
I don't think that this needs to be documented on the PR template or anywhere else really, it's a committers only tool.
I don't understand what you mean? |
I think only maintainers needs to be aware of this as they demand branch switches most of the time. I think we had something in the nixpkgs manual for rebasing. |
Nothing that covers changing base branches. Also I don't think the nixpkgs manual would be good place for this, maybe a separate doc that can be linked from the README and/or |
Seems to work but I've noticed what may be a problem. The actions that run in pull requests (editorconfig, wait-for-ofborg) seem to be skipped when the PR is pushed to by another action. IIRC this is done intentionally by github. Actions in staging-next PRs also seem to skipped when the pushes are from the merge-staging sync. |
@SuperSandro2000 The action will now add a 👀 to the comment that initiated it. The proper workaround for allowing actions to trigger other actions seems to be running the first action from another account/token so we would need to add one from somewhere to the repo secrets. If we don't want to fuss with that (at least for now) we could do this: diff --git a/.github/workflows/rebase-staging.yml b/.github/workflows/rebase-staging.yml
index 8214787778e..2758675b250 100644
--- a/.github/workflows/rebase-staging.yml
+++ b/.github/workflows/rebase-staging.yml
@@ -48,6 +48,17 @@ jobs:
-H "Authorization: token $GITHUB_TOKEN" \
-d '{ "base": "staging" }' \
"https://api.github.com/repos/NixOS/nixpkgs/pulls/$PULL_REQUEST"
+ curl \
+ -X PATCH \
+ -H "Accept: application/vnd.github.v3+json" \
+ -H "Authorization: token $GITHUB_TOKEN" \
+ -d '{ "state": "closed" }' \
+ "https://api.github.com/repos/NixOS/nixpkgs/pulls/$PULL_REQUEST"
+ - uses: peter-evans/create-or-update-comment@v1
+ with:
+ issue-number: ${{ github.event.issue.number }}
+ body: |
+ Rebased, please reopen the pull request.
- uses: peter-evans/create-or-update-comment@v1
if: ${{ failure() }}
with: |
Updated version with a fix for running other actions, also allows rebasing PRs onto other branches: #110843 |
PR to remove: #126192 |
This allows committers to rebase PRs to staging without CODEOWNER notification spam or running git commands manually.
cc @FRidh @jonringer @zimbatm