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

Incorrect behavior of notifyCommit for regex branch spec with $

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • git-plugin
    • None

      Jenkins 2.270
      git-plugin 4.5.0

      I have a freestyle project with such config:
      Repository URL: git@mygitserver.com:my-repo
      Branches to build: **
      Build Triggers > Poll SCM is enabled

      When I send a notification on http://jenkins/git/notifyCommit - everything works as expected:

      $ curl "http://jenkins/git/notifyCommit?url=my-repo&branches=master&sha1=some-sha"
      Scheduled project
      

      When I change branch specifier to a simple regex :.* - everything still works, but when I use end of line sign like :.+foo$ the behavior changes:

      $ curl "http://jenkins/git/notifyCommit?url=my-repo&branches=master&sha1=some-sha"
      Scheduled polling of project
      

      Instead of staring new build Jenkins schedules polling of the project and if there are no new commits there will be no build scheduled. I think it's a bit strange that different regex-s lead to different building algorithms. IMHO algorithms should be the same for all regex-s.

      This situation connected somehow with Parametrized builds, JENKINS-29574 and this code.

      I can try to fix it if someone describe expected behavior with Parametrized builds. Is it possible to use parameters with regex branch spec? Should git-plugin check if branch spec is a regex before searching for parameters?

            Unassigned Unassigned
            goganchic Egor Baranov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: