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

Git Polling Keeps Detecting Changes When Variables in refspec

    Details

    • Similar Issues:

      Description

      I have a job where the git refspec and branch are set to +refs/heads/${branch}:refs/remotes/origin/${branch} and the branch is set to ${branch}.

      With that configuration, the SCM polling keeps triggering new builds from the same change.

      If I replace the variables with their values, the SCM polling works correctly.

        Attachments

          Issue Links

            Activity

            Hide
            aaronlab aaronlab added a comment -

            I agree with this bug .... older versions of the Git plugin used to properly resolve variables in the "branches to build" field in both parameterized builds and polling. Now, it seems that polling does not resolve variables when issuing the ls-remote command. Can someone look into this – it seems like a trivial thing to fix.

            Thanks.

            Show
            aaronlab aaronlab added a comment - I agree with this bug .... older versions of the Git plugin used to properly resolve variables in the "branches to build" field in both parameterized builds and polling. Now, it seems that polling does not resolve variables when issuing the ls-remote command. Can someone look into this – it seems like a trivial thing to fix. Thanks.
            Hide
            daniviga Daniele Vigano added a comment -

            I can confirm this bug. With Jenkins 1.572, git client plugin 1.9.2 and git plugin 2.2.2 the polling module does not resolve our "$branch" variable, set in the parametrized build configuration:

            Started on Jul 17, 2014 10:50:00 AM
            Using strategy: Default
            [poll] Last Built Revision: Revision 2d1a169f855f69312b4b47819283063ea15c1448 (origin/master)
            > git ls-remote -h git://github.com/gem/oq-nrmllib.git $branch
            Done. Took 0.54 sec
            No changes

            Show
            daniviga Daniele Vigano added a comment - I can confirm this bug. With Jenkins 1.572, git client plugin 1.9.2 and git plugin 2.2.2 the polling module does not resolve our "$branch" variable, set in the parametrized build configuration: Started on Jul 17, 2014 10:50:00 AM Using strategy: Default [poll] Last Built Revision: Revision 2d1a169f855f69312b4b47819283063ea15c1448 (origin/master) > git ls-remote -h git://github.com/gem/oq-nrmllib.git $branch Done. Took 0.54 sec No changes
            Hide
            seanf Sean Flanigan added a comment -

            I've hit this bug too, when using parameters in the Branch Specifier field. Git plugin 2.2.2, Git client plugin 1.9.2, Jenkins 1.554.3 LTS.

            You can work around this bug by disabling remote polling for the affected jobs. (I think this is true for most of the git trigger bugs listed here [1].) I have a Jenkins script (for Script Console or Scriptler) which disables remote polling for all jobs [2].

            [1] http://jenkins-ci.361315.n4.nabble.com/git-polling-builds-every-2-minutes-repository-isn-t-changing-why-td4679352.html#a4700637
            [2] http://scriptlerweb.appspot.com/script/show/456001

            Show
            seanf Sean Flanigan added a comment - I've hit this bug too, when using parameters in the Branch Specifier field. Git plugin 2.2.2, Git client plugin 1.9.2, Jenkins 1.554.3 LTS. You can work around this bug by disabling remote polling for the affected jobs. (I think this is true for most of the git trigger bugs listed here [1] .) I have a Jenkins script (for Script Console or Scriptler) which disables remote polling for all jobs [2] . [1] http://jenkins-ci.361315.n4.nabble.com/git-polling-builds-every-2-minutes-repository-isn-t-changing-why-td4679352.html#a4700637 [2] http://scriptlerweb.appspot.com/script/show/456001
            Hide
            jakobk Jakob Korherr added a comment -

            Created pull request on github: https://github.com/jenkinsci/git-plugin/pull/245
            Please merge. Change contains fix and test case.

            Show
            jakobk Jakob Korherr added a comment - Created pull request on github: https://github.com/jenkinsci/git-plugin/pull/245 Please merge. Change contains fix and test case.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jakob Korherr
            Path:
            src/main/java/hudson/plugins/git/util/GitUtils.java
            src/test/java/hudson/plugins/git/GitSCMTest.java
            http://jenkins-ci.org/commit/git-plugin/027cc051aa87ae0b9b006234a8d53974de42568b
            Log:
            JENKINS-22009 Git Polling Keeps Detecting Changes When Variables in refspec (setup correct environment for polling + test case)

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jakob Korherr Path: src/main/java/hudson/plugins/git/util/GitUtils.java src/test/java/hudson/plugins/git/GitSCMTest.java http://jenkins-ci.org/commit/git-plugin/027cc051aa87ae0b9b006234a8d53974de42568b Log: JENKINS-22009 Git Polling Keeps Detecting Changes When Variables in refspec (setup correct environment for polling + test case)
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jakob Korherr
            Path:
            src/main/java/hudson/plugins/git/util/GitUtils.java
            http://jenkins-ci.org/commit/git-plugin/f6fd156b4981bcffbb6aa64ee321b41d0db51370
            Log:
            JENKINS-22009 Git Polling Keeps Detecting Changes When Variables in refspec (apply API changes in 2.2.x)

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jakob Korherr Path: src/main/java/hudson/plugins/git/util/GitUtils.java http://jenkins-ci.org/commit/git-plugin/f6fd156b4981bcffbb6aa64ee321b41d0db51370 Log: JENKINS-22009 Git Polling Keeps Detecting Changes When Variables in refspec (apply API changes in 2.2.x)
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Mark Waite
            Path:
            src/main/java/hudson/plugins/git/util/GitUtils.java
            src/test/java/hudson/plugins/git/GitSCMTest.java
            http://jenkins-ci.org/commit/git-plugin/1dc2db5cb67c8c1c8dbd004f1c7966d3e86d4d5c
            Log:
            Merge pull request #250 from jakobk/2.2.x

            fix JENKINS-22009 on 2.2.x branch

            Compare: https://github.com/jenkinsci/git-plugin/compare/63b05764bd0e...1dc2db5cb67c

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Mark Waite Path: src/main/java/hudson/plugins/git/util/GitUtils.java src/test/java/hudson/plugins/git/GitSCMTest.java http://jenkins-ci.org/commit/git-plugin/1dc2db5cb67c8c1c8dbd004f1c7966d3e86d4d5c Log: Merge pull request #250 from jakobk/2.2.x fix JENKINS-22009 on 2.2.x branch Compare: https://github.com/jenkinsci/git-plugin/compare/63b05764bd0e...1dc2db5cb67c
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jakob Korherr
            Path:
            src/main/java/hudson/plugins/git/util/GitUtils.java
            src/test/java/hudson/plugins/git/GitSCMTest.java
            http://jenkins-ci.org/commit/git-plugin/897426d8004155c25f272189052b695c3aaadceb
            Log:
            JENKINS-22009 Git Polling Keeps Detecting Changes When Variables in refspec (setup correct environment for polling + test case)

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jakob Korherr Path: src/main/java/hudson/plugins/git/util/GitUtils.java src/test/java/hudson/plugins/git/GitSCMTest.java http://jenkins-ci.org/commit/git-plugin/897426d8004155c25f272189052b695c3aaadceb Log: JENKINS-22009 Git Polling Keeps Detecting Changes When Variables in refspec (setup correct environment for polling + test case)
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Mark Waite
            Path:
            src/main/java/hudson/plugins/git/util/GitUtils.java
            src/test/java/hudson/plugins/git/GitSCMTest.java
            http://jenkins-ci.org/commit/git-plugin/03995f242e9a3ffe6fdbd2a7b00cdb20d5b3f967
            Log:
            Merge pull request #245 from jakobk/jenkins_22009

            JENKINS-22009 Git Polling Keeps Detecting Changes When Variables in refspec

            Compare: https://github.com/jenkinsci/git-plugin/compare/647f3f09814c...03995f242e9a

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Mark Waite Path: src/main/java/hudson/plugins/git/util/GitUtils.java src/test/java/hudson/plugins/git/GitSCMTest.java http://jenkins-ci.org/commit/git-plugin/03995f242e9a3ffe6fdbd2a7b00cdb20d5b3f967 Log: Merge pull request #245 from jakobk/jenkins_22009 JENKINS-22009 Git Polling Keeps Detecting Changes When Variables in refspec Compare: https://github.com/jenkinsci/git-plugin/compare/647f3f09814c...03995f242e9a
            Hide
            jakobk Jakob Korherr added a comment -

            pull requests were merged in master and 2.2.x

            Show
            jakobk Jakob Korherr added a comment - pull requests were merged in master and 2.2.x
            Hide
            markewaite Mark Waite added a comment -

            Fixed in git client plugin 2.2.5, released 15 Aug 2014.

            Show
            markewaite Mark Waite added a comment - Fixed in git client plugin 2.2.5, released 15 Aug 2014.

              People

              • Assignee:
                jakobk Jakob Korherr
                Reporter:
                cg Christian Goetze
              • Votes:
                2 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: