RFR: 2246: Check if the pull request is still open before issuing "integrate" automatically

Zhao Song zsong at openjdk.org
Mon Apr 29 21:26:27 UTC 2024


IntegrateCommand has feature which is "/integrate auto". This command could make the pull request be automatically integrated when it is ready. But there is a bug.

Let's say we have a merge pull request, it has the auto label and it has the merge-conflict label(the pr has some merge conflicts need to be resolved manually).
1. A user pushes a commit to the source branch , it resolves the merge conflict
2. In CheckWorkItem#1, the new commit triggers CheckRun, so pull request bot removes merge-conflict label and added clean and ready
3. The user uses “Merge” button to merge the source branch into target branch in GitHub/GitLab
4. In the end of CheckWorkItem#1, pull request bot finds auto label and ready label, then issues “/integrate” command
5. When processing the /integrate command, pull request bot finds it’s not able to merge.
6. In another CheckWorkItem#2, nothing in the pull request has changed, so CheckRun will be skipped. But in the end of CheckWorkItem#2, pr bot will find auto label and ready label, and will issue another“/integrate” command

So the pull request bot will be stuck in a loop of step 4,5,6.

To resolve this issue, as Erik suggested, in step4, we should check if the pr is still open.

-------------

Commit messages:
 - SKARA-2246

Changes: https://git.openjdk.org/skara/pull/1644/files
  Webrev: https://webrevs.openjdk.org/?repo=skara&pr=1644&range=00
  Issue: https://bugs.openjdk.org/browse/SKARA-2246
  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/skara/pull/1644.diff
  Fetch: git fetch https://git.openjdk.org/skara.git pull/1644/head:pull/1644

PR: https://git.openjdk.org/skara/pull/1644


More information about the skara-dev mailing list