Skip to content

Conversation

@Seros
Copy link

@Seros Seros commented Oct 22, 2025

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

  • Link to JIRA ticket in description, if appropriate.
  • Change is code complete and matches issue description
  • Automated tests have been added to exercise the changes
  • Reviewer's manual test instructions provided in PR description. See Reviewer's first task below.

Reviewer checklist

  • Run the changes and verify that the change matches the issue description
  • Reviewed the code
  • Verified that the appropriate tests have been written or valid explanation given

Documentation changes

  • Link to jenkins.io PR, or an explanation for why no doc changes are needed

…ranch and add them to the heads to build if you use MERGE strategy
@Seros Seros requested a review from a team as a code owner October 22, 2025 09:12
@jglick
Copy link
Member

jglick commented Oct 22, 2025

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

@Seros
Copy link
Author

Seros commented Oct 24, 2025

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.

@jglick
Copy link
Member

jglick commented Oct 24, 2025

triggers new builds for PRs targeting the branch

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants