<p dir="auto">As discuss in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="25557715" data-permission-text="Title is private" data-url="https://github.com/scikit-learn/scikit-learn/issues/2752" data-hovercard-type="issue" data-hovercard-url="/scikit-learn/scikit-learn/issues/2752/hovercard" href="https://github.com/scikit-learn/scikit-learn/issues/2752">#2752</a>, it would be nice to test sample weight in common tests.</p>
<p dir="auto">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 <a href="https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/incorporating-changes-from-a-pull-request/automatically-merging-a-pull-request">doc</a> for more details. cc <a class="team-mention js-team-mention notranslate" data-error-text="Failed to load team members" data-id="11523" data-permission-text="Team members are private" data-url="/orgs/scikit-learn/teams/core-devs/members" data-hovercard-type="team" data-hovercard-url="/orgs/scikit-learn/teams/core-devs/hovercard" href="https://github.com/orgs/scikit-learn/teams/core-devs">@scikit-learn/core-devs</a> <a class="team-mention js-team-mention notranslate" data-error-text="Failed to load team members" data-id="3593183" data-permission-text="Team members are private" data-url="/orgs/scikit-learn/teams/contributor-experience-team/members" data-hovercard-type="team" data-hovercard-url="/orgs/scikit-learn/teams/contributor-experience-team/hovercard" href="https://github.com/orgs/scikit-learn/teams/contributor-experience-team">@scikit-learn/contributor-experience-team</a> for visibility.</p>
<p dir="auto">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.</p>
<p dir="auto">Here is a screenshot from sphinx-gallery which has set this up:<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/1680079/204514285-836bca8f-163e-4f07-9a84-b13441b8ee6d.png"><img src="https://user-images.githubusercontent.com/1680079/204514285-836bca8f-163e-4f07-9a84-b13441b8ee6d.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">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).</p>
<p dir="auto">Things we would need to do:</p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> set-up branch <a href="https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/managing-a-branch-protection-rule">branch protection rules</a>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> define required checks: probably azure + github doc build, maybe others. We probably want to leave aside other more noisy checks like codecov?</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> require 1 approval rather than 2 (to allow DOC PRs to be merged with only one approval)</li>
</ul>
</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> set-up <a href="https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-auto-merge-for-pull-requests-in-your-repository">auto-merge</a>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> make sure we check the require required checks (Thomas' comment at the meeting)</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> reset auto-merge when a commit is pushed after auto-merge is set, just to be on the safe side. This <a href="https://github.blog/changelog/2021-03-22-updated-pull-request-auto-merge-behavior-for-users-without-write-access/" rel="nofollow">link</a> 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.</li>
</ul>
</li>
</ul>
<p dir="auto">Other items from discussions at the meeting:</p>
<ul dir="auto">
<li>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?</li>
<li>A: a per PR manual action is required to allow automerge, see screenshot above</li>
<li>Q: is "merge when CI is green" functionality of "<a href="https://github.com/refined-github/refined-github">Refined GitHub</a>" a solution?</li>
<li>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.</li>
</ul>