rfcbot-rs icon indicating copy to clipboard operation
rfcbot-rs copied to clipboard

Auto-merge approved RFCs

Open Centril opened this issue 6 years ago • 2 comments

Opening an issue per discussion at https://github.com/anp/rfcbot-rs/pull/197#discussion-diff-183131428R448.

To save the rfc-pushers some time, it would be nice to auto-merge RFCs that are FFCPed (finished-final-comment-period).

This is a complicated process which involves these steps executed (by a human right now..) in order:

  1. Find out which team(s) the RFC falls under.
  2. Fetch RFC pull number (trivial).
  3. Start a tracking issue using a standard template defined here. One example issue: https://github.com/rust-lang/rust/issues/48594
    1. Apply the labels: C-tracking-issue, B-RFC-approved
    2. For each team the RFC falls under, apply a label T-team.
    3. Substitute mentoring instructions based on team.
      • For T-lang, mentoring instructions come from T-compiler.
    4. Find the PR title of the RFC and substitute XXX in This is a tracking issue for the RFC "XXX" with the title.
      • But first apply some heuristics removing prefixes such as RFC: (case insensitive). This also applies to similar suffixes.
    5. Set the issue title to Tracking issue for RFC <number>, <title> where <title> is dependent on step 3.4.
    6. Find all unresolved questions from the RFC and add them to the tracking issue text.
      • This will be a bit difficult and will require some heuristics based on common formatting in RFCs.
  4. Fetch the issue number of the newly created tracking issue.
  5. Merge the PR into master
  6. Add a commit substituting 0000 in the file name of the committed file with <number>.
    • The commit should be named RFC <number>.
    • It should also adjust the links to the tracking issue and the RFC PR.
  7. Add a comment on the PR saying:
    **Huzzah!** This RFC is **merged**!
    
    Tracking issue: <issue_link>
    
  8. Find the [Rendered] link in the PR summary / original post and change the link to the new location of the file (in the master branch).
    • Also add a link to the tracking issue.
    • This will also require some heuristics.

This procedure has multiple points of failure for a bot. If a failure does happen, the bot should stop immediately and post a comment on the RFC saying "automated merge procedure failed, please merge manually."

Who will implement this? I will (at some point).

Centril avatar Apr 21 '18 02:04 Centril

Note that "merge doesn't always mean merge": https://github.com/rust-lang/rust/pull/56138#issuecomment-456192667 😉

dwijnand avatar Feb 05 '19 07:02 dwijnand

@dwijnand Yea, that's why this should only apply to RFCs and not rust-lang/rust PRs ;) We need to post-process the PRs anyways for merge conflicts, other small fixes, etc.

Centril avatar Feb 14 '19 21:02 Centril