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

Git SCM-polling uses wrong parameter values for 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-14276. I'm creating this to better track the issues I fixed in my original pull-request [1], which I will update accordingly.

      To reproduce:

      • A parametrized build with parameter BRANCH_TO_BUILD, with default value "branch1"
      • Git SCM with branch specifier "${BRANCH_TO_BUILD}"
      • SCM polling enabled
      • Previous manual job launch with BRANCH_TO_BUILD=branch2

      Expected:

      • When polling, BRANCH_TO_BUILD is set to branch1 (default value), so only updates to branch1 trigger a build.

      Actual:

      • When polling, BRANCH_TO_BUILD is set to branch2 (value from last execution).

      [1] https://github.com/jenkinsci/git-plugin/pull/293

          [JENKINS-27349] Git SCM-polling uses wrong parameter values for a parametrized branchspec

          Jean Blanchard created issue -

          I updated my original pull-request to fix only this.

          https://github.com/jenkinsci/git-plugin/pull/293

          Jean Blanchard added a comment - I updated my original pull-request to fix only this. https://github.com/jenkinsci/git-plugin/pull/293

          Hi Jean

          I had some issues and was wondering about other scenarios that could be affected by this.

          Like if you wanted to build one branch (with polling) and the actual branch parameter used for checking was another branch (like master) so that all changes to master triggered rebuilds..when you just wanted that on a parameterized branch.

          would see as detected changes when there weren't any on the desired branch?

          just wondering.

          -kevin

          Kevin Normoyle added a comment - Hi Jean I had some issues and was wondering about other scenarios that could be affected by this. Like if you wanted to build one branch (with polling) and the actual branch parameter used for checking was another branch (like master) so that all changes to master triggered rebuilds..when you just wanted that on a parameterized branch. would see as detected changes when there weren't any on the desired branch? just wondering. -kevin

          Code changed in jenkins
          User: Jean Blanchard
          Path:
          src/main/java/hudson/plugins/git/GitSCM.java
          src/main/java/hudson/plugins/git/util/GitUtils.java
          src/test/java/hudson/plugins/git/GitSCMTest.java
          http://jenkins-ci.org/commit/git-plugin/d56fbee601d5c46d35fc5c05601ead12d66fba10
          Log:
          JENKINS-27349 Polling for parametrized branchspec should resolve to default param values

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jean Blanchard Path: src/main/java/hudson/plugins/git/GitSCM.java src/main/java/hudson/plugins/git/util/GitUtils.java src/test/java/hudson/plugins/git/GitSCMTest.java http://jenkins-ci.org/commit/git-plugin/d56fbee601d5c46d35fc5c05601ead12d66fba10 Log: JENKINS-27349 Polling for parametrized branchspec should resolve to default param values

          Code changed in jenkins
          User: Nicolas De loof
          Path:
          src/main/java/hudson/plugins/git/GitSCM.java
          src/main/java/hudson/plugins/git/util/GitUtils.java
          src/test/java/hudson/plugins/git/GitSCMTest.java
          http://jenkins-ci.org/commit/git-plugin/30766fe249c2512872c52ad96ceab1356510eba2
          Log:
          Merge pull request #293 from jeanblanchard/fix-notify

          JENKINS-27349 Fix polling for parametrized branchspec

          Compare: https://github.com/jenkinsci/git-plugin/compare/7af820e61615...30766fe249c2

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Nicolas De loof Path: src/main/java/hudson/plugins/git/GitSCM.java src/main/java/hudson/plugins/git/util/GitUtils.java src/test/java/hudson/plugins/git/GitSCMTest.java http://jenkins-ci.org/commit/git-plugin/30766fe249c2512872c52ad96ceab1356510eba2 Log: Merge pull request #293 from jeanblanchard/fix-notify JENKINS-27349 Fix polling for parametrized branchspec Compare: https://github.com/jenkinsci/git-plugin/compare/7af820e61615...30766fe249c2
          Nicolas De Loof made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]

          Mark Waite added a comment -

          Verified it is working as intended in the 2.3.6 SNAPSHOT build from 6 May 2015. Should be included in the 2.3.6 final build when that is released.

          Mark Waite added a comment - Verified it is working as intended in the 2.3.6 SNAPSHOT build from 6 May 2015. Should be included in the 2.3.6 final build when that is released.
          Mark Waite made changes -
          Status Original: Resolved [ 5 ] New: Closed [ 6 ]

          Mark Waite added a comment -

          The git plugin and git client plugin are being tested in hopes of releasing new versions before the end of June. If you're willing to assist with the testing, please download and install a pre-release build of the git client plugin and the git plugin. Problems detected in the pre-release should be e-mailed to MarkEWaite and ndeloof.

          I wrote some test ideas if you would like suggestions of areas that need testing. The git plugin supports many different use cases and its automated tests only evaluate a very few of those use cases.

          Mark Waite added a comment - The git plugin and git client plugin are being tested in hopes of releasing new versions before the end of June. If you're willing to assist with the testing, please download and install a pre-release build of the git client plugin and the git plugin . Problems detected in the pre-release should be e-mailed to MarkEWaite and ndeloof . I wrote some test ideas if you would like suggestions of areas that need testing. The git plugin supports many different use cases and its automated tests only evaluate a very few of those use cases.

          pmv added a comment -

          Is there any way this pre-release could be updated to include the fix for JENKINS-27352? I installed the pre-release last week, but had to back it out. We're back to running a patched version that includes all of Jean's fixes.

          pmv added a comment - Is there any way this pre-release could be updated to include the fix for JENKINS-27352 ? I installed the pre-release last week, but had to back it out. We're back to running a patched version that includes all of Jean's fixes.

            ndeloof Nicolas De Loof
            jblanchard Jean Blanchard
            Votes:
            2 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: