Skip to content

[ci] Add GitHub Actions bot to merge PRs on demand - #10833

Merged
Mousius merged 4 commits into
apache:mainfrom
driazati:mergebot
May 24, 2022
Merged

[ci] Add GitHub Actions bot to merge PRs on demand#10833
Mousius merged 4 commits into
apache:mainfrom
driazati:mergebot

Conversation

@driazati

@driazatidriazati commented Mar 30, 2022

Copy link
Copy Markdown
Member

This implements https://discuss.tvm.apache.org/t/rfc-allow-merging-via-pr-comments/12220. The bot can be invoked from a top-level review comment or via a regular PR comment. The text @tvm-bot merge anywhere in the body will trigger the bot. Right now it checks that the latest commit is reviewed and that all CI jobs that have run on that commit are successful. If it fails, it will leave a comment on the PR with the reason.

This is just a start and some features are left for followups:

  • Various TODOs throughout the code
  • "Scheduled" merges that happen once CI finishes
  • Allowing committers to merge without getting a fresh review for changes after an approval

Test PRs

DescriptionLink
ci passed: no, then yes
approved: no, then yes
https://github.com/driazati/tvm/pull/13
ci passed: yes
approved: yes, then PR is updated, then re-approved
https://github.com/driazati/tvm/pull/17
commit with a messagehttps://github.com/driazati/tvm/pull/16
cancelled mergehttps://github.com/driazati/tvm/pull/18

cc @areusch@Mousius@gromero@kparzysz-quic

@driazati
driazati marked this pull request as ready for review April 11, 2022 21:50
@gromero

gromero commented Apr 11, 2022

Copy link
Copy Markdown
Contributor

@driazati Thanks!

An initial question: for both examples driazati#13 and driazati#17, it seems that the final commit messages that landed were not taken from the PR title/body (are empty?), but that's planned tho (WIP)?

@driazati

driazati commented Apr 11, 2022

Copy link
Copy Markdown
MemberAuthor

Ah I could have used better examples, the code strips out the specific textThanks for contributing to TVM! ... since that is just for PR authors and shouldn't really be in the commit log.

edit: see https://github.com/driazati/tvm/pull/16 and https://github.com/driazati/tvm/commit/80acd9fbfb7ed7910f82afec6acc866764b2ba73

@gromero

Copy link
Copy Markdown
Contributor

hmm neat :)

@areuschareusch left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

thanks @driazati couple comments

Comment threadtests/python/ci/sample_prs/pr10786-badci.json
Comment threadtests/python/ci/sample_prs/pr10786-badci.json
Comment threadtests/python/ci/sample_prs/pr10786-oldreview.json Outdated
Comment threadtests/scripts/github_mergebot.py
Comment threadtests/scripts/github_mergebot.py
@driazati
driazati requested a review from areuschApril 18, 2022 19:26
@areusch

Copy link
Copy Markdown
Contributor

this one ready for a review?

@driazati

Copy link
Copy Markdown
MemberAuthor

yup it's ready for review, let me know if there's any more test cases you'd want to see as well

@areuschareusch left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

cool this is looking pretty good. a few more questions, but i think we're getting close here.

Comment thread.github/workflows/merge.yml Outdated
Comment threadtests/python/ci/sample_prs/pr10786-badci.json
Comment threadtests/scripts/github_mergebot.py
Comment threadtests/scripts/github_mergebot.py Outdated
@driazati
driazati requested a review from areuschApril 25, 2022 20:59

@areuschareusch left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

thanks @driazati !

@github-actions

Copy link
Copy Markdown
Contributor

It has been a while since this PR was updated, @Mousius@kparzysz-quic@areusch@gromero please leave a review or address the outstanding comments. @driazati if this PR is still a work in progress, please convert it to a draft until it is ready for review.

Comment threadtests/scripts/github_mergebot.py Outdated
Comment threadtests/scripts/github_mergebot.py Outdated
Comment threadtests/scripts/github_mergebot.py
Comment threadtests/scripts/github_mergebot.py Outdated
Comment threadtests/scripts/github_mergebot.py Outdated
Comment threadtests/scripts/github_mergebot.py
Comment threadtests/scripts/github_mergebot.py
Comment threadtests/scripts/github_mergebot.py
Comment threadtests/scripts/github_mergebot.py Outdated
Comment threadtests/scripts/github_mergebot.py Outdated
@driazati

Copy link
Copy Markdown
MemberAuthor

@Mousius can you re-review?

@MousiusMousius left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Minor comments left @driazati, otherwise I think this is getting pretty close 😸

Comment threadtests/scripts/github_mergebot.py
Comment threadtests/scripts/github_mergebot.py Outdated
Comment threadtests/scripts/github_mergebot.py Outdated
Comment threadtests/scripts/github_mergebot.py Outdated
This implements https://discuss.tvm.apache.org/t/rfc-allow-merging-via-pr-comments/12220. The bot can be invoked from a top-level review comment or via a regular PR comment. The text `@tvm-bot merge` anywhere in the body will trigger the bot. Right now it checks that the latest commit is reviewed and that all CI jobs that have run on that commit are successful. If it fails, it will leave a comment on the PR with the reason.
This is just a start and some features are left for followups:
* Various TODOs throughout the code
* "Scheduled" merges that happen once CI finishes
* Allowing committers to merge without getting a fresh review for changes after an approval
@Mousius

Copy link
Copy Markdown
Member

Apologies for the delay @driazati , this LGTM and I'm glad to see this work finally land 😸

@Mousius
Mousius merged commit 59d4c02 into apache:mainMay 24, 2022
Sign up for freeto 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.

4 participants

@driazati@gromero@areusch@Mousius