-
Notifications
You must be signed in to change notification settings - Fork 66
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
ci: add workflows to automate merging of human-actor created PRs #94
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.
I am curious, why is the /rtm
command a default use-case? 🤔 As I see it, in normal cases, it is double the work for nothing i.e. both accepting + writing /rtm
.
The only use-case I see it being useful is for manual overwriting the behavior if you want multiple people to review PR's. Then something like /wait-for-ready-to-merge
and then all review -> /ready-to-merge
would be needed (or just label PR wait-for-ready-to-merge
). Or just block if multiple people have been requested to review the PR.
Otherwise, me accepting a PR, should IMO be the final acceptance that the PR is ready to be merged and give the PR ready-to-merge
label. Less for me to do as a maintainer.
@jonaslagoni yes there are cases when after |
I would say we can, especially if it is something I have to do each day 😄 What if we created the following checks that determine whether it is automatically merged:
Would this not be suiting and more natural behavior 🤔? |
1-4 is already in place so the question is really only about is it better with so my only argument really is that one of the reasons is to avoid as many human mistakes as possible, and I just afraid of what I wrote: |
@smoya @jonaslagoni please have another look when you have a moment 😄 |
I think explicitly stating that a PR is "ready to merge" is better than something like "do not merge". That said, I have fish memory and would not be able to remember all these commands. A comment on every new PR with all the instructions would be helpful. Or a command like |
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.
Got some more questions 😆
Regarding the GH action, automerge-action
, I assume that it takes the PR title headline and uses as a commit message which triggers the release. I have noticed that sometimes when I want to merge a PR, the automatic title it gives me is not the current title, but the initial title when the PR was first created. Not sure if the bot has the same "problem", have you tested this? 🤔
Also, have you thought about what happens in the following scenario:
- PR is created with
feat
- PR is approved by a maintainer
- PR is marked as ready to merge
- Evil contributor changes the title of PR to
feat!
, which does not remove theready to merge
label. - PR is merged and a major version is released
Do you think it is possible to set up something where the PR gets "frozen", i.e. mainly title and description cant be changed without needing another review?
@fmvilas actually I think
yeah, saw it too and tried to understand like WHY 😞 but did not figure out what
🙈 even though I'm not afraid of 👿 this is a possible scenario, yes!
and will remove It will be triggered whenever title/summary is modified or some commits are performed. I'm afraid it might be annoying for us that we need to add the label back and forth, but I don't have a strong opinion, after all we can always just remove the workflow if it is not helpful |
@fmvilas @jonaslagoni protection from evil added @smoya other improvements added |
.github/workflows/automerge-for-humans-remove-ready-to-merge-label-on-edit.yml
Outdated
Show resolved
Hide resolved
.github/workflows/automerge-for-humans-add-ready-to-merge-or-do-not-merge-label.yml
Outdated
Show resolved
Hide resolved
Co-authored-by: Jonas Lagoni <[email protected]>
Co-authored-by: Sergio Moya <[email protected]>
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.
LGTM 🎉 This is gonna be fun 😬
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.
LGTM 🚀
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'm approving although I don't like this PR. It's removing my admin superpowers 😢 😛 🚀
5389ec7
@fmvilas @smoya @jonaslagoni @KhudaDad414 folks, I had to push one change that did not change the underlying goal behind the PR. It just solves an edge case situation that we had with wrong handling of bots when working on last release #78. in short, we were always validating if bot is an actor, but actor is the one who triggers event. So bot can be also an actor in PR that was created by a human. So we simply need to check not actor but PR creator. not all of you have to approve, just have a look at the syntax if I did not broke anything (I checked in my private repo, but yeah, you never know) |
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 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 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.
LGTM!
Fixes #31
Why we need it
AsyncAPI GH org changes
Once we are happy with the proposed workflows, this is what will change in the GH org settings:
outside collaborators
but will havewrite
access on "their" repos individuallyChange in how maintainers work
You can still work as before
**BUT IT DOESN'T MAKE SENSE 😆 **
write
level access to the given repo otherwise CODEOWNERS do not work 😞Still, I recommend below!
Lukasz's recommended way of working
You are happy with PR, all checks passed? you already approved? DON'T merge manually:
Just add
/ready-to-merge
or/rtm
comment (can be multiline as in example below)ready-to-merge
label will be addedautomerge for humans
workflow will trigger (it triggers also because of other events)if all is good and
ready-to-merge
but you still need to wait, add/do-not-merge
or/dnm
comment and pr will not get mergedProof workflows work
Test PR that proves that PR is labeled only when a proper comment is done. You can also see there merging was done, it looks like it is me but only because auto-merge bot in my tests use my token:
Also added support for
/help
commandFixes: #78