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

Regression: parameters are not set on commit notification

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: git-plugin
    • Labels:
    • Environment:
      Jenkins 1.626
      Java 1.8
      CentOS 6.6 (x86_64)
    • Similar Issues:

      Description

      After upgrades (I'm not sure whether it happened after jenkins or jenkins plugin upgrade), jenkins doesn't set configured environment variables with default values in the "This build is parameterized" section on commit notification from SCM (Stash) using /git/notifyCommit request. However it works properly when build is manually triggered with "Build with parameters" button. The only difference I can see is the lack of these configured variables set – everything else works as expected.

      It is a regression – this setup is used for a very long time in our environment.

        Attachments

          Issue Links

            Activity

            Hide
            markewaite Mark Waite added a comment - - edited

            In my tests with git plugin 2.4.0 and git client plugin 1.19.0, I can only duplicate the problem if I include "sha1=" in the notify commit argument list (just as Daniel Beck observed in an earlier comment). When I include no argument, and when I include only the argument "branch=", then the default parameter values are visible to the XShell and Shell build steps in my test job.

            The notify commit I used to show the problem was:

            SHA1=$(git rev-parse HEAD)
            curl -s http://localhost:8080/git/notifyCommit?url=git://mark-pc1.markwaite.net/git/mwaite/bugs/JENKINS-30178.git\&branch=master\&sha1=$SHA1
            

            The notify commit I used that does not show the problem is:

            curl -s http://localhost:8080/git/notifyCommit?url=git://mark-pc1.markwaite.net/git/mwaite/bugs/JENKINS-30178.git\&branch=master
            
            Show
            markewaite Mark Waite added a comment - - edited In my tests with git plugin 2.4.0 and git client plugin 1.19.0, I can only duplicate the problem if I include "sha1=" in the notify commit argument list (just as Daniel Beck observed in an earlier comment). When I include no argument, and when I include only the argument "branch=", then the default parameter values are visible to the XShell and Shell build steps in my test job. The notify commit I used to show the problem was: SHA1=$(git rev-parse HEAD) curl -s http://localhost:8080/git/notifyCommit?url=git://mark-pc1.markwaite.net/git/mwaite/bugs/JENKINS-30178.git\&branch=master\&sha1=$SHA1 The notify commit I used that does not show the problem is: curl -s http://localhost:8080/git/notifyCommit?url=git://mark-pc1.markwaite.net/git/mwaite/bugs/JENKINS-30178.git\&branch=master
            Hide
            jglick Jesse Glick added a comment -

            Daniel Beck claims in the PR for JENKINS-27902 that it caused this.

            Show
            jglick Jesse Glick added a comment - Daniel Beck claims in the PR for JENKINS-27902 that it caused this.
            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/GitStatus.java
            src/test/java/hudson/plugins/git/GitStatusTest.java
            http://jenkins-ci.org/commit/git-plugin/2dfd86d27a7cd4089349fd012d7d70a5e827ed81
            Log:
            Test JENKINS-30178 using GitStatus.toString

            Asserts that job parameter default values are available when a job
            is started by a notifyCommit. If the notifyCommit includes a sha1
            parameter, then the changes for JENKINS-27092 fail to assign parameters
            their default values.

            Modifying the GitStatus object to be more easily tested was simpler
            than using a TestExtension. Should eventually replace the testing
            misuse of the GitStatus.toString() method with a TestExtension of
            GitStatus.Listener.

            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/GitStatus.java src/test/java/hudson/plugins/git/GitStatusTest.java http://jenkins-ci.org/commit/git-plugin/2dfd86d27a7cd4089349fd012d7d70a5e827ed81 Log: Test JENKINS-30178 using GitStatus.toString Asserts that job parameter default values are available when a job is started by a notifyCommit. If the notifyCommit includes a sha1 parameter, then the changes for JENKINS-27092 fail to assign parameters their default values. Modifying the GitStatus object to be more easily tested was simpler than using a TestExtension. Should eventually replace the testing misuse of the GitStatus.toString() method with a TestExtension of GitStatus.Listener.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: fbelzunc
            Path:
            src/main/java/hudson/plugins/git/GitStatus.java
            http://jenkins-ci.org/commit/git-plugin/0a661ceaa5da94e92df97a2220a792d1eaa34317
            Log:
            [Fix JENKINS-30178] Add default parameters defined in the job

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: fbelzunc Path: src/main/java/hudson/plugins/git/GitStatus.java http://jenkins-ci.org/commit/git-plugin/0a661ceaa5da94e92df97a2220a792d1eaa34317 Log: [Fix JENKINS-30178] Add default parameters defined in the job
            Hide
            emil_upnext Emil Smoleński added a comment -

            I can confirm that this problem is resolved after upgrading git plugin to 2.4.1 and git-client plugin to 1.19.1. This issue can be closed. Thank you very much for your work, guys.

            Show
            emil_upnext Emil Smoleński added a comment - I can confirm that this problem is resolved after upgrading git plugin to 2.4.1 and git-client plugin to 1.19.1. This issue can be closed. Thank you very much for your work, guys.

              People

              • Assignee:
                fbelzunc Félix Belzunce Arcos
                Reporter:
                emil_upnext Emil Smoleński
              • Votes:
                0 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: