Thanks to visit codestin.com
Credit goes to github.com

Skip to content

RFC Enabling auto-merge builtin Github functionality #25069

Closed
@lesteve

Description

@lesteve

The main advantage would be to be able to say on a per-PR basis "this PR can be merged when CI is green". See the doc for more details. cc @scikit-learn/core-devs @scikit-learn/contributor-experience-team for visibility.

Currently we need to remember to come back in one hour and we sometimes forget. As a maintainer with many different things to track, it would be very nice to have this sense of quicker completion and the peace of mind of not having to remember to come back to merge the PR.

Here is a screenshot from sphinx-gallery which has set this up:
image

You can see this is a per-PR thing ("Enable automerge" button) and there is even a way to bypass branch protection, which can be nice in some rare cases (for example we know for a fact that the CI error is not related to the PR).

Things we would need to do:

  • set-up branch branch protection rules
    • define required checks: probably azure + github doc build, maybe others. We probably want to leave aside other more noisy checks like codecov?
    • require 1 approval rather than 2 (to allow DOC PRs to be merged with only one approval)
  • set-up auto-merge
    • make sure we check the require required checks (Thomas' comment at the meeting)
    • reset auto-merge when a commit is pushed after auto-merge is set, just to be on the safe side. This link says that it is done automatically, unclear whether this is the same thing as "Dismiss stale pull request approvals when new commits are pushed" setting in branch protection rules.

Other items from discussions at the meeting:

  • Q: does a human have to click "auto merge" on a PR for it to happen, or does it automatically happen for all PRs that match the approval requirements?
  • A: a per PR manual action is required to allow automerge, see screenshot above
  • Q: is "merge when CI is green" functionality of "Refined GitHub" a solution?
  • A: you need to keep the tab open for it to work, and in my limited experience it does not work reliably. Also it is not public information that the PR will be merged when CI is green.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions