Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-27352

Git SCM polling is not triggered from a push notification with a parametrized branchspec

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • git-plugin
    • None
    • git-plugin 2.3.5

      This is a follow-up to JENKINS-27349.

      To reproduce:

      • A parametrized build with parameter BRANCH_TO_BUILD
      • Git SCM with branch specifier "${BRANCH_TO_BUILD}"
      • SCM polling enabled

      Expected:

      • A push notification should trigger the polling for the job

      Actual:

      • Polling is not triggered

          [JENKINS-27352] Git SCM polling is not triggered from a push notification with a parametrized branchspec

          Jean Blanchard created issue -

          Jean Blanchard added a comment - Fixed in pull-request https://github.com/jenkinsci/git-plugin/pull/309

          Nicolas Braun added a comment -

          Hi Jean,

          I am having some problems with my CI server too and I am wondering if it is the same problem !
          Configuration is the same :

          • A basic multi-branch job with a parametrized build with parameter BRANCH_TO_BUILD, default **
          • Git SCM with branch specifier "${BRANCH_TO_BUILD}"
          • SCM polling enabled

          Basically what I would like is for the job to trigger a build on any branch (develop, master, feature/xx) if there is a commit on it. I can also manually build a specific branch

          What seems to happen is that Jenkins will only poll changes in the branch I manually build. For example :
          • if I build manually /develop, afterward my automatic poll will only track changes in develop http://i.imgur.com/8L5tuTS.png
          • if I the trigger on manually build with parameter ** then the automatic poll will correctly track all branches http://i.imgur.com/HgBwRMM.png

          I believe this is the same issue (or maybe https://issues.jenkins-ci.org/browse/JENKINS-27349 - all 3 seems related) but please confirm otherwise I will open a dedicated issue

          Nicolas

          Nicolas Braun added a comment - Hi Jean, I am having some problems with my CI server too and I am wondering if it is the same problem ! Configuration is the same : • A basic multi-branch job with a parametrized build with parameter BRANCH_TO_BUILD, default ** • Git SCM with branch specifier "${BRANCH_TO_BUILD}" • SCM polling enabled Basically what I would like is for the job to trigger a build on any branch (develop, master, feature/xx) if there is a commit on it. I can also manually build a specific branch What seems to happen is that Jenkins will only poll changes in the branch I manually build. For example : • if I build manually /develop, afterward my automatic poll will only track changes in develop http://i.imgur.com/8L5tuTS.png • if I the trigger on manually build with parameter ** then the automatic poll will correctly track all branches http://i.imgur.com/HgBwRMM.png I believe this is the same issue (or maybe https://issues.jenkins-ci.org/browse/JENKINS-27349 - all 3 seems related) but please confirm otherwise I will open a dedicated issue Nicolas
          pmv made changes -
          Assignee Original: Nicolas De Loof [ ndeloof ] New: pmv [ pmv ]

          pmv added a comment -

          Nicolas - your setup sounds like ours. With Jean's patches, and with our jobs configured to require a workspace for polling, it works as we expect. So I don't think you need a new ticket - you either need to manually build the plugin with Jean's changes or wait for them to be included in a release.

          pmv added a comment - Nicolas - your setup sounds like ours. With Jean's patches, and with our jobs configured to require a workspace for polling, it works as we expect. So I don't think you need a new ticket - you either need to manually build the plugin with Jean's changes or wait for them to be included in a release.

          Code changed in jenkins
          User: Jean Blanchard
          Path:
          src/main/java/hudson/plugins/git/GitStatus.java
          src/test/java/hudson/plugins/git/GitStatusTest.java
          http://jenkins-ci.org/commit/git-plugin/cc2ddb7dd0207401c4515633f5c3704757107199
          Log:
          JENKINS-27352 Fix commit notification for a parametrized branchspec

          When the branchspec is parametrized, and a commit notification is received for
          the tracked repository, the polling is always triggered, even if a sha1 was
          received.

          Also, add some FINE logs to the notifyCommit code.

          Compare: https://github.com/jenkinsci/git-plugin/compare/9369a12c7bc4...cc2ddb7dd020

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jean Blanchard Path: src/main/java/hudson/plugins/git/GitStatus.java src/test/java/hudson/plugins/git/GitStatusTest.java http://jenkins-ci.org/commit/git-plugin/cc2ddb7dd0207401c4515633f5c3704757107199 Log: JENKINS-27352 Fix commit notification for a parametrized branchspec When the branchspec is parametrized, and a commit notification is received for the tracked repository, the polling is always triggered, even if a sha1 was received. Also, add some FINE logs to the notifyCommit code. Compare: https://github.com/jenkinsci/git-plugin/compare/9369a12c7bc4...cc2ddb7dd020

          Mark Waite added a comment -

          Fix included in git plugin 2.4.0 released 18 July 2015

          Mark Waite added a comment - Fix included in git plugin 2.4.0 released 18 July 2015
          Mark Waite made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]
          Mark Waite made changes -
          Status Original: Resolved [ 5 ] New: Closed [ 6 ]

          Using Jenkins LTS version 1.609.2 and git plugin 2.4.0. This fix may break builds when there are some default parameters. When job is triggered by hand, parameters are present. When build is triggered by commit notification, parameters are gone.

          Daniel Horecki added a comment - Using Jenkins LTS version 1.609.2 and git plugin 2.4.0. This fix may break builds when there are some default parameters. When job is triggered by hand, parameters are present. When build is triggered by commit notification, parameters are gone.

            pmv pmv
            jblanchard Jean Blanchard
            Votes:
            5 Vote for this issue
            Watchers:
            12 Start watching this issue

              Created:
              Updated:
              Resolved: