jenkinsci / jenkinsci/git-plugin

[JENKINS-12545] Jenkins should build all tracked branches that have changed when triggered by Github

Open
#2,107 12 comments 0 reactions 0 assignees View on GitHub
component:git-plugin component:github-plugin imported-jira-issue priority:major resolution:unresolved
Dominant language
Java
Stars
694
Forks
1.1k
Avg merge
1h 29m
Merged PRs (30d)
3

Description

I have several projects configured to build multiple branches and set to build when changes are pushed to Github. For example, several projects have origin/master and origin/development registered. It seems to build the correct branch when I push to a single branch on Github, but it fails to behave as expected in the following situations:

1. If I push to two branches at once, only one of them gets built. It should build both of them. This probably has something to do with the changelog for 1.1.12 at https://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin that talks about picking branches.

2. If I push to one branch, then push to a second branch while the first is being built, the second one never gets built.

This bug seems to force me to set up a separate job for each branch I want to build, which works poorly with the Github webhook (it build all of the branches every time). I can't switch to polling (I think) because my slave systems are volatile and Jenkins seems to lose track of which ref was built last when the slave it was built on goes away.

---
Originally reported by sbleon, imported from: Jenkins should build all tracked branches that have changed when triggered by Github


  • status: Open
  • priority: Major
  • component(s): git-plugin, github-plugin
  • label(s): git, github, webhook
  • resolution: Unresolved
  • votes: 4
  • watchers: 10
  • imported: 2025-12-02

Raw content of original issue

I have several projects configured to build multiple branches and set to build when changes are pushed to Github. For example, several projects have origin/master and origin/development registered. It seems to build the correct branch when I push to a single branch on Github, but it fails to behave as expected in the following situations:

1. If I push to two branches at once, only one of them gets built. It should build both of them. This probably has something to do with the changelog for 1.1.12 at https://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin that talks about picking branches.

2. If I push to one branch, then push to a second branch while the first is being built, the second one never gets built.

This bug seems to force me to set up a separate job for each branch I want to build, which works poorly with the Github webhook (it build all of the branches every time). I can't switch to polling (I think) because my slave systems are volatile and Jenkins seems to lose track of which ref was built last when the slave it was built on goes away.

environment

```
Jenkins 1.448, Github-api plugin 1.16, Github plugin 1.0, Git plugin 1.1.15

Ubuntu 9.04
```

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.