Skip to content

Add option to always include branches, regardless of whether a pull request exist for those branches or not #1091

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ugrave
Copy link
Contributor

@ugrave ugrave commented Aug 5, 2025

Add option to always include branches, also if a PR exist for that branch.

The same functionalityexists already in the gitlab-branch-source plugin:
jenkinsci/gitlab-branch-source-plugin#375

Your checklist for this pull request

  • Make sure you are requesting to pull a topic/feature/bugfix branch (right side) and not your master branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or in Jenkins JIRA
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Did you provide a test-case? That demonstrates feature works or fixes the issue.

@ugrave ugrave force-pushed the feature/add-always-include-branch-option branch from e4bd134 to d92fdd5 Compare August 6, 2025 05:30
@nfalco79
Copy link
Member

nfalco79 commented Aug 6, 2025

although it is linked to another issue in other plugin it's not clear the reason.
To request new feature a new JIRA issue must be open to discuss if the feature have sense or not. For what I can read in the other plugin (that have a different trait implementation than git standard) is:

With the current implementation, the branch is removed and recreated at the merge request tab, and we lose the complete build history.

Dynamism is key in organization and multi-branch jobs, so maintaining a job's build history, which could disappear at any time depending on the configuration, doesn't make much sense.

@KalleOlaviNiemitalo
Copy link
Contributor

I wonder if this can alternatively be set up by defining two branch sources in the same multibranch project. One branch source ignores pull requests and only builds the specific named branches. The other branch source excludes those branches and builds pull requests as well as other branches that are not origins of any pull requests.

But perhaps such a dual-source setup would increase the I/O between Jenkins and Bitbucket, and increase the risk of exceeding a request quota.

@ugrave
Copy link
Contributor Author

ugrave commented Aug 6, 2025

In my case its not regarding the history, its more like developers missing the job page for a main branch if someone created a PR to merge main into there feature branch (for whatever reason). An BitBucket (at least the server version) does not have a setting to prevent that.

@nfalco79
Copy link
Member

nfalco79 commented Aug 6, 2025

I understood seems a valid scenario. The implementation that add yet another regexp/wildcard filter on "Discover Branch" trait conflict with the filter that a user could setup to apply to any branches.
So for example if in the discover branch trait I value the regexp to kept master but master does not match the global "Filter by name (wildcard)" trait it's not clear for the user why the job does not appear.
Furthermore that particular setting makes sense only and exclusively for the strategy of excluding branch for which exists a PR.

I would see how in the github source plugin (that have a bigger "comunity") this would be implemented.

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.

3 participants