jenkinsci / jenkinsci/github-branch-source-plugin

[JENKINS-73811] Ignore draft PRs for branch detection

Open
#1,450 0 comments 0 reactions 0 assignees View on GitHub
component:github-branch-source-plugin enhancement imported-jira-issue priority:minor resolution:unresolved
Dominant language
Java
Stars
217
Forks
398
Avg merge
30m
Merged PRs (30d)
1

Description

Our Jenkins configuration to discover branches and PRs is as follow:



  • branches: Exclude branches that are also filed as PRs

  • PRs: Merging the pull request with the current target branch revision

  • Ignore pull requests marked as drafts

We had one branch that also had a draft PR attached to it. This caused



  • the branch to be ignored, as it has a PR

  • the PR to be ignored as it is a draft

    • The branch is not meant to be merged soon and has conflicts, thus converting it to non-draft is not an option



We resolved it by closing the PR. However, it would be nice if either:

"Ignore PRs marked as drafts" caues the "Exclude branches that are also filed as PRs" to ignore draft PRs

or

There would be a setting for branches "Exclude branches that have a ready to review PR".

 

Also: The Scan Repository Log could be improved. It just says that it is checking that branch, but not why it is ignoring it -> say something like "ignoring due to PR 42".

---
Originally reported by xomex, imported from: Ignore draft PRs for branch detection


  • status: Open
  • priority: Minor
  • component(s): github-branch-source-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 1
  • imported: 2025-12-02

Raw content of original issue

Our Jenkins configuration to discover branches and PRs is as follow:



  • branches: Exclude branches that are also filed as PRs

  • PRs: Merging the pull request with the current target branch revision

  • Ignore pull requests marked as drafts

We had one branch that also had a draft PR attached to it. This caused



  • the branch to be ignored, as it has a PR

  • the PR to be ignored as it is a draft

    • The branch is not meant to be merged soon and has conflicts, thus converting it to non-draft is not an option



We resolved it by closing the PR. However, it would be nice if either:

"Ignore PRs marked as drafts" caues the "Exclude branches that are also filed as PRs" to ignore draft PRs

or

There would be a setting for branches "Exclude branches that have a ready to review PR".

 

Also: The Scan Repository Log could be improved. It just says that it is checking that branch, but not why it is ignoring it -> say something like "ignoring due to PR 42".

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.