-
Notifications
You must be signed in to change notification settings - Fork 965
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 workflow to address merge conflicts #2958
Conversation
Not that I know but doing things on my fork is how I usually test them. By default there are no branch protections so you can just (force) push to master which is typically a fairly quick way of testing these kinds of things :) |
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.
@@ -0,0 +1,16 @@ | |||
name: "Check merge conflicts" | |||
on: | |||
push: |
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.
Why do we need push
?
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.
There won't be an github.event.pull_request
for push
events!
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.
Why do we need
push
?
This action runs on every push and checks all pending PR's for merge conflicts, see https://github.com/jxs/rust-libp2p/actions/runs/3158064326/jobs/5139673243
There won't be an github.event.pull_request for push events!
Yeah found out here 😅
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.
But why do we need to run it on push
?
Shouldn't synchronize
happen every time HEAD or base changes? I guess one is always subscribed to a PR that you created so we don't necessarily need to tag the author, I'd be kinda nice though.
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.
This is still an open point for me @jxs.
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.
Hmm, that is a bit of a concern, we usually have lots of PRs open. @elenaf9 @mxinden @jxs Could I get your opinion on #3010? Happy for you to also suggest other tools but mergify could give us quite a bit of automation like closing stale PRs.
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.
FYI, you already have a workflow for closing up stale PRs - https://github.com/libp2p/rust-libp2p/blob/master/.github/workflows/stale.yml It's currently closing only those that need author input and have no activity.
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 also checked https://github.com/eps1lon/actions-label-merge-conflict/blob/main/sources/main.ts. It doesn't check out each PR branch. It uses the API to check on the mergeability status of all PRs. So the approach they're taking seems correct and it should work just fine for this repo. We can investigate further and contribute back to the project if it turns out it doesn't.
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.
ah nice then, thanks @galargh!
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.
FYI, you already have a workflow for closing up stale PRs -
master
/.github/workflows/stale.yml It's currently closing only those that need author input and have no activity.
Interesting! haha
I wasn't aware at all and should probably go buy some glasses as I've completely overlooked that one all this time when I was working on the workflows!
We also don't really seem to use it / the label. We should probably keep that one then and just remove the label requirement so we don't have to explicitly tag PRs for it to run.
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.
👍 in favor of this. Thanks @jxs!
aef9f5d
to
d7dfa3b
Compare
yeah sure :) |
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 am in favor of this in general and the specific solution proposed in particular. Thanks @jxs for working on it.
Let me know once this is ready to merge @jxs and @thomaseizinger.
//CC @galargh in case you have opinions or want us to be consistent with solutions used in other repositories.
Thanks for the tag @mxinden. Nothing to add on my side really. I don't know of any other repositories using it. Seems like a fair way of getting an extra notif on merge conflicts. Would be great if we could build up a library of solutions to common problems like this. For lack of a better place for now, I added it as an entry here: https://www.notion.so/pl-strflt/IPDX-122073392dce454e9ca4b87231034483#cfcfcfca010f4029bfb0d992cd44bf06 |
it's redundant since we have pull_request_target
f3f9e2b
to
bf13fe1
Compare
…hash, to avoid it changing without our knowledge.
8df09e3
to
1fcdd17
Compare
If we end up doing #3010, then we could also use |
closed in favor of #3026 |
Description
uses https://github.com/eps1lon/actions-label-merge-conflict
Links to any relevant issues
addresses #2948
Open Questions
I did not test the
${{ github.event.pull_request.user.login }
is there an easier way to test the workflow than activating actions on my fork and replicating a real merge conflict situation?Thanks!
Change checklist