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

notifyCommit branch parameter can't contain slashes

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • git-plugin
    • Jenkins 1.620, Git Plugin 2.4.0

      I have a simple Jenkins job called "myjob":

      Repository URL: git://github.com/jenkinsci/git-client-plugin.git
      Branches to build: tests/getSubmodules
      Build Triggers > Poll SCM is enabled

      I execute

      curl -s http://myjenkinssrv/jenkins/git/notifyCommit -d url=git://github.com/jenkinsci/git-client-plugin.git -d branches=tests/getSubmodules

      and I get

      No git jobs using repository: git://github.com/jenkinsci/git-client-plugin.git and branches: tests/getSubmodules

      This is wrong! If I configure my job with "Branches to build"=master and call

      curl -s http://myjenkinssrv/jenkins/git/notifyCommit -d url=git://github.com/jenkinsci/git-client-plugin.git -d branches=master

      it works, as expected.

          [JENKINS-29603] notifyCommit branch parameter can't contain slashes

          Robin Müller added a comment - - edited

          I created a Pull-Request a few days ago for this. Can you review it and merge it back if you are comfortable with it?

          Robin Müller added a comment - - edited I created a Pull-Request a few days ago for this. Can you review it and merge it back if you are comfortable with it?

          Code changed in jenkins
          User: Jesse Glick
          Path:
          multibranch/src/test/java/org/jenkinsci/plugins/workflow/multibranch/WorkflowBranchProjectFactoryTest.java
          http://jenkins-ci.org/commit/workflow-plugin/fca115faca36a62968c1500ffd89e06b982a56f4
          Log:
          Extend JENKINS-30744 test to confirm that it is unaffected by JENKINS-29603.
          (Multibranch Git webhooks rely only on the url parameter to detect changes.)

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: multibranch/src/test/java/org/jenkinsci/plugins/workflow/multibranch/WorkflowBranchProjectFactoryTest.java http://jenkins-ci.org/commit/workflow-plugin/fca115faca36a62968c1500ffd89e06b982a56f4 Log: Extend JENKINS-30744 test to confirm that it is unaffected by JENKINS-29603 . (Multibranch Git webhooks rely only on the url parameter to detect changes.)

          Code changed in jenkins
          User: Jesse Glick
          Path:
          multibranch/src/test/java/org/jenkinsci/plugins/workflow/multibranch/WorkflowBranchProjectFactoryTest.java
          http://jenkins-ci.org/commit/workflow-plugin/521099bd8a31963ea6149de0a4f4ab9fe5617e97
          Log:
          Merge pull request #276 from jglick/test-JENKINS-29603

          Extend JENKINS-30744 test to confirm that it is unaffected by JENKINS-29603

          Compare: https://github.com/jenkinsci/workflow-plugin/compare/3840d8ca847e...521099bd8a31

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: multibranch/src/test/java/org/jenkinsci/plugins/workflow/multibranch/WorkflowBranchProjectFactoryTest.java http://jenkins-ci.org/commit/workflow-plugin/521099bd8a31963ea6149de0a4f4ab9fe5617e97 Log: Merge pull request #276 from jglick/test- JENKINS-29603 Extend JENKINS-30744 test to confirm that it is unaffected by JENKINS-29603 Compare: https://github.com/jenkinsci/workflow-plugin/compare/3840d8ca847e...521099bd8a31

          Code changed in jenkins
          User: Jesse Glick
          Path:
          multibranch/src/test/java/org/jenkinsci/plugins/workflow/multibranch/WorkflowBranchProjectFactoryTest.java
          http://jenkins-ci.org/commit/workflow-multibranch-plugin/c9738eb45a25c1ae6a6e55df0d9688654d328725
          Log:
          Extend JENKINS-30744 test to confirm that it is unaffected by JENKINS-29603.
          (Multibranch Git webhooks rely only on the url parameter to detect changes.)
          Originally-Committed-As: fca115faca36a62968c1500ffd89e06b982a56f4

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: multibranch/src/test/java/org/jenkinsci/plugins/workflow/multibranch/WorkflowBranchProjectFactoryTest.java http://jenkins-ci.org/commit/workflow-multibranch-plugin/c9738eb45a25c1ae6a6e55df0d9688654d328725 Log: Extend JENKINS-30744 test to confirm that it is unaffected by JENKINS-29603 . (Multibranch Git webhooks rely only on the url parameter to detect changes.) Originally-Committed-As: fca115faca36a62968c1500ffd89e06b982a56f4

          Nicko Glayre added a comment -

          I attempted to solve the merging issue in the PR proposed by coderhugo and it looks like to work as expected.
          Could you please have a look at the following ?

          Nicko Glayre added a comment - I attempted to solve the merging issue in the PR proposed by coderhugo and it looks like to work as expected. Could you please have a look at the following ?

          Code changed in jenkins
          User: Nicolas Glayre
          Path:
          src/main/java/hudson/plugins/git/BranchSpec.java
          src/main/java/hudson/plugins/git/GitSCM.java
          src/main/java/hudson/plugins/git/GitStatus.java
          src/test/java/hudson/plugins/git/GitStatusTest.java
          http://jenkins-ci.org/commit/git-plugin/1db52c4b7fa03eb6c7d61a0af86a2b3e18343051
          Log:
          JENKINS-29603 Fix notifyCommit for branches that contain slashes

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Nicolas Glayre Path: src/main/java/hudson/plugins/git/BranchSpec.java src/main/java/hudson/plugins/git/GitSCM.java src/main/java/hudson/plugins/git/GitStatus.java src/test/java/hudson/plugins/git/GitStatusTest.java http://jenkins-ci.org/commit/git-plugin/1db52c4b7fa03eb6c7d61a0af86a2b3e18343051 Log: JENKINS-29603 Fix notifyCommit for branches that contain slashes

          Code changed in jenkins
          User: Nicolas Glayre
          Path:
          src/test/java/hudson/plugins/git/GitStatusTest.java
          http://jenkins-ci.org/commit/git-plugin/b184f2b46eb2b0cb6e0274b28e138f39c7be1c68
          Log:
          JENKINS-29603 Fixing failing tests added on master branch

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Nicolas Glayre Path: src/test/java/hudson/plugins/git/GitStatusTest.java http://jenkins-ci.org/commit/git-plugin/b184f2b46eb2b0cb6e0274b28e138f39c7be1c68 Log: JENKINS-29603 Fixing failing tests added on master branch

          I confirm using the origin/<slashyBranch> workaround helps. No other forms seem to work though (e.g refs/heads/... or refs/remotes/...)

          Jakub Bochenski added a comment - I confirm using the origin/<slashyBranch> workaround helps. No other forms seem to work though (e.g refs/heads/... or refs/remotes/...)

          Mor L added a comment -

          Workaround works in our case too - but seeing the fix already merged to a beta of version 4 of the Git plugin - when is it due to be released officially (as in available through Jenkins update center)?

          Mor L added a comment - Workaround works in our case too - but seeing the fix already merged to a beta of version 4 of the Git plugin - when is it due to be released officially (as in available through Jenkins update center)?

          Mark Waite added a comment - - edited

          pyrocks my current goal is to release git plugin 4 before the end of Feb 2019. There are still several things that must be completed before that release. You can see the progress on the pull requests that need to precede release in the git client plugin 3.0 milestone and the git plugin 4.0 milestone.

          You're welcome (and encouraged) to download and install the pre-release versions of the git client plugin 3.0.0 and the git plugin 4.0.0. Those versions are the most recent builds of the master branch. Report any issues with those versions and you'll be helping the community have a better release.

          Mark Waite added a comment - - edited pyrocks my current goal is to release git plugin 4 before the end of Feb 2019. There are still several things that must be completed before that release. You can see the progress on the pull requests that need to precede release in the git client plugin 3.0 milestone and the git plugin 4.0 milestone . You're welcome (and encouraged) to download and install the pre-release versions of the git client plugin 3.0.0 and the git plugin 4.0.0 . Those versions are the most recent builds of the master branch. Report any issues with those versions and you'll be helping the community have a better release.

            Unassigned Unassigned
            ludwig Ludwig Arnesen
            Votes:
            5 Vote for this issue
            Watchers:
            14 Start watching this issue

              Created:
              Updated: