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

Allow to pass additional request parameter for notifyCommit

    Details

    • Type: New Feature
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: git-plugin
    • Labels:
      None
    • Similar Issues:

      Description

      When calling notifyCommit it should be possible to pass additional request parameter to the notifyCommit URL and when a job is triggered the parameters are passed on the triggered job, similar to "buildWithParameters", but that the parameters are part of the call to notifyCommit. This is e.g. valuable when an external system is triggering the Jenkins job with the Git notifyCommit Url and needs to pass additional parameter, e.g. the reason for the triggering or pull request identifier.

        Attachments

          Issue Links

            Activity

            christiangalsterer Christian Galsterer created issue -
            christiangalsterer Christian Galsterer made changes -
            Field Original Value New Value
            Status Open [ 1 ] In Progress [ 3 ]
            Show
            christiangalsterer Christian Galsterer added a comment - PR available at https://github.com/jenkinsci/git-plugin/pull/315
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Christian Galsterer
            Path:
            src/main/java/hudson/plugins/git/GitStatus.java
            src/test/java/hudson/plugins/git/GitStatusTest.java
            http://jenkins-ci.org/commit/git-plugin/f0b2d0d16826906d5743722ae97967bf1d6303d7
            Log:
            JENKINS-27902 Allow to pass additional request parameter for notifyCommit

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christian Galsterer Path: src/main/java/hudson/plugins/git/GitStatus.java src/test/java/hudson/plugins/git/GitStatusTest.java http://jenkins-ci.org/commit/git-plugin/f0b2d0d16826906d5743722ae97967bf1d6303d7 Log: JENKINS-27902 Allow to pass additional request parameter for notifyCommit
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Christian Galsterer
            Path:
            src/main/java/hudson/plugins/git/GitStatus.java
            http://jenkins-ci.org/commit/git-plugin/336d7f7dfbcd427db8b180f23396ddad3cef56de
            Log:
            JENKINS-27902 Allow to pass additional request parameter for notifyCommit

            • fixed review finding, that sha1 was not passed correctly.
            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christian Galsterer Path: src/main/java/hudson/plugins/git/GitStatus.java http://jenkins-ci.org/commit/git-plugin/336d7f7dfbcd427db8b180f23396ddad3cef56de Log: JENKINS-27902 Allow to pass additional request parameter for notifyCommit fixed review finding, that sha1 was not passed correctly.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Nicolas De loof
            Path:
            src/main/java/hudson/plugins/git/GitStatus.java
            src/test/java/hudson/plugins/git/GitStatusTest.java
            http://jenkins-ci.org/commit/git-plugin/9e46ae773fa0f00b15dc989d3109941a664042af
            Log:
            Merge pull request #315 from christiangalsterer/JENKINS-27902

            JENKINS-27902 Allow to pass additional request parameter for notifyCommit

            Compare: https://github.com/jenkinsci/git-plugin/compare/30766fe249c2...9e46ae773fa0

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Nicolas De loof Path: src/main/java/hudson/plugins/git/GitStatus.java src/test/java/hudson/plugins/git/GitStatusTest.java http://jenkins-ci.org/commit/git-plugin/9e46ae773fa0f00b15dc989d3109941a664042af Log: Merge pull request #315 from christiangalsterer/ JENKINS-27902 JENKINS-27902 Allow to pass additional request parameter for notifyCommit Compare: https://github.com/jenkinsci/git-plugin/compare/30766fe249c2...9e46ae773fa0
            Hide
            markewaite 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 Mark Waite and Nicolas De Loof.

            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.

            Show
            markewaite 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 Mark Waite and Nicolas De Loof . 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.
            Hide
            christiangalsterer Christian Galsterer added a comment - - edited
            Show
            christiangalsterer Christian Galsterer added a comment - - edited I already did some testing, see https://groups.google.com/d/msg/jenkinsci-dev/aRN0YeXXbHQ/MMTV0QpGrv8J for details.
            Hide
            markewaite Mark Waite added a comment -

            Fix included in git plugin 2.4.0 released 18 July 2015

            Show
            markewaite Mark Waite added a comment - Fix included in git plugin 2.4.0 released 18 July 2015
            markewaite Mark Waite made changes -
            Status In Progress [ 3 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            markewaite Mark Waite made changes -
            Status Resolved [ 5 ] Closed [ 6 ]
            Hide
            yyl8815 Bruce Yang added a comment -

            Can anyone help show me how I can get the additional parameters in Jenkins Job?
            Thanks

            Show
            yyl8815 Bruce Yang added a comment - Can anyone help show me how I can get the additional parameters in Jenkins Job? Thanks
            Hide
            christiangalsterer Christian Galsterer added a comment -

            Assuming you have the following URL http://localhost:8080/jenkins/git/notifyCommit?url=<GIT_URL>&branches=<BRANCH>&sha1=<SHA>&PARAM1=VALUE1&PARAM1=VALUE2 with the two additional parameters PARAM1 and PARAM2 you can use them as any build parameter with $PARAM1 and $PARAM2.

            For examples see https://christiangalsterer.wordpress.com/2015/07/28/set-jenkins-build-description-with-a-system-groovy-script/ and https://christiangalsterer.wordpress.com/2015/04/23/continuous-integration-for-pull-requests-with-jenkins-and-stash/

            Show
            christiangalsterer Christian Galsterer added a comment - Assuming you have the following URL http://localhost:8080/jenkins/git/notifyCommit?url= <GIT_URL>&branches=<BRANCH>&sha1=<SHA>&PARAM1=VALUE1&PARAM1=VALUE2 with the two additional parameters PARAM1 and PARAM2 you can use them as any build parameter with $PARAM1 and $PARAM2. For examples see https://christiangalsterer.wordpress.com/2015/07/28/set-jenkins-build-description-with-a-system-groovy-script/ and https://christiangalsterer.wordpress.com/2015/04/23/continuous-integration-for-pull-requests-with-jenkins-and-stash/
            jglick Jesse Glick made changes -
            Link This issue depends on JENKINS-30178 [ JENKINS-30178 ]
            jglick Jesse Glick made changes -
            Link This issue depends on JENKINS-31884 [ JENKINS-31884 ]
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 162496 ] JNJira + In-Review [ 208679 ]
            Hide
            markewaite Mark Waite added a comment -

            This capability was added in git plugin 2.4.0 then was removed in git plugin 2.5.0 because it introduces a security bug documented in SECURITY-275.

            Refer to the git plugin javadoc for more explanation about:

            Show
            markewaite Mark Waite added a comment - This capability was added in git plugin 2.4.0 then was removed in git plugin 2.5.0 because it introduces a security bug documented in SECURITY-275. Refer to the git plugin javadoc for more explanation about: allowNotifyCommitParameters safeParameters

              People

              • Assignee:
                christiangalsterer Christian Galsterer
                Reporter:
                christiangalsterer Christian Galsterer
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: