JENKINS-76201 Query GitHub API for open PRs targeting the specified branch and add them to the heads to build if you use MERGE strategy#908
Conversation
…ranch and add them to the heads to build if you use MERGE strategy
|
Not sure what this is doing or if it is at all right (will leave that to maintainers, if there are any), but FWIW this mode is not recommended to begin with: #636 |
|
Thank you for letting me know about the issue with the Merge strategy! I really appreciate the feedback and will definitely look into the merge queue feature as an alternative approach. With this PR, I hope to address the inconsistency mentioned in the issue. For example, the Bitbucket branch source plugin triggers new builds for PRs targeting the branch, and according to the documentation, this plugin is supposed to behave the same way. This change aims to bring the expected behavior and fix the discrepancy. |
When changes are pushed to the base branch you mean. Yes this branch source was supposed to be doing that already. Perhaps this was broken at some point? Or deliberately suppressed? I am not sure which. At any rate, it is one of the key reasons (but not the only one) why using PR-merge strategy is undesirable in practice. So (setting aside the actual diff here, which I have not read in any detail and do not exactly follow) it is not clear to me that this would even be wanted. |
Description
When a branch is configured to use the MERGE strategy, this PR queries the GitHub API to discover all open pull requests that are targeting the specified branch. It then automatically adds these PRs to the heads that should be built.
Why: Previously, the plugin wasn't capturing relevant PRs for building when using the MERGE strategy. This enhancement ensures that all open PRs targeting a branch are properly detected and included in the build process, providing better coverage and more reliable CI/CD workflows.
See JENKINS-76201 for further information.
Submitter checklist
Reviewer checklist
Documentation changes