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

git plugin chooses a wrong scheme for remote polling with passed variable with wildcards

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Cannot Reproduce
    • git-plugin
    • None
    • JENKINS: 1.624
      GIT PLUGIN: 2.4.0

    Description

      Hello,
      I have a problem with a git polling schema: if I use a double wildcard in the filed "branch to build" (in fact it is the default property) everything works pretty fine, however if I create a string parameter, for example "some_var" , set default value equals to ** and provide this var as ${some_var} into "branch to build" field — a job starts to rebuilds for the same commit again and again.

      I noticed that for the default scheme with wildcards git polling uses branches checker, but for the passed ${variable} it switches to the heads checking, here is samples:

      With default double wildcards:

      > git -c core.askpass=true fetch --tags --progress user@git.repo +refs/heads/:refs/remotes/origin/
      Polling for changes in
      Seen branch in repository origin/branch_name01
      Seen branch in repository origin/branch_name02
      ...
      Seen 6,188 remote branches
      Done. Took 17 sec
      No changes

      With ${some_var}:

      > git -c core.askpass=true ls-remote -h user@git.repo # timeout=10
      Found 3107 remote heads on gitlab@git.wrke.in:frontend/workspace.git
      [poll] Latest remote head revision on refs/heads/branch_name01 is: 11ef48ec45c1d6ee6da53f5b7e4c27cad3df5cf3 - already built by 1559
      [poll] Latest remote head revision on refs/heads/branch_name02 is: 8b1cf4479f856d70e4a609c422eaabd1b58224f7 - already built by 1237
      [poll] Latest remote head revision on refs/heads/branch_name03 is: 299fc66ecc22203dc463b679d0b74c541370f82b - already built by 251
      [poll] Latest remote head revision on refs/heads/branch_name04 is: 576473847454293e14e9b78f61a2545b168ffb91 - already built by 1462
      [poll] Latest remote head revision on refs/heads/branch_name05 is: 2d829d794f3ac67eb65420e5ff52121b63a075d0 - already built by 1615
      [poll] Latest remote head revision on refs/heads/branch_name06 is: d2a8a4d94f87a71835bfb827ca68450064327ba5 - already built by 2332
      [poll] Latest remote head revision on refs/heads/branch_name07 is: cda29788c0d2579a7b553b9b405864937a544063 - already built by 1955
      [poll] Latest remote head revision on refs/heads/branch_name08 is: cf500a32387e47908959a2042cea8e12ecca17e4 - already built by 3062
      [poll] Latest remote head revision on refs/heads/branch_name09 is: 975fd5a88e64472b2e1c0c64c010b7191afcc494 - already built by 256
      [poll] Latest remote head revision on refs/heads/branch_name10 is: f761900ee1aaabfd4e1cd30fbe94c9906258affa - already built by 1916
      [poll] Latest remote head revision on refs/heads/branch_name11 is: 0044fb67f09c2285751d8d946deea0a14fd687ca - already built by 1584
      [poll] Latest remote head revision on refs/heads/branch_name12 is: 094f7eda69994e07c47cfa46718a855ff91f7bbc - already built by 68
      [poll] Latest remote head revision on refs/heads/branch_name13 is: 7d43b1516dbfdd25301d08a7f9efaae0da1695cb - already built by 1041
      [poll] Latest remote head revision on refs/heads/branch_name14 is: 4bcd82726ca1509a5dfffa6e2fb12b24b278f871 - already built by 3245
      [poll] Latest remote head revision on refs/heads/branch_name15 is: aa8fd5bd6ea77f2e9a37fe45b67cde9191d12933 - already built by 1962
      [poll] Latest remote head revision on refs/heads/branch_name16 is: 6cc13de9f6e779006ee8bf30389c6d3f947a1064 - already built by 1974
      [poll] Latest remote head revision on refs/heads/branch_name17 is: 1114b34da52718866651487123eb03b4acb4ba5a - already built by 1472
      [poll] Latest remote head revision on refs/heads/branch_name18 is: 72d99055bab11994442184820bd02e27c2bdeb12 - already built by 789
      [poll] Latest remote head revision on refs/heads/branch_name19 is: 845299f01b5fcd26593c06fb6c304ffd398ff269
      Done. Took 0.59 sec
      Changes found

      Attachments

        Activity

          We apparently have the some problem.
          I'm ready to help with debugging.

          yk4ever Konstantin Yegupov added a comment - We apparently have the some problem. I'm ready to help with debugging.
          yk4ever Konstantin Yegupov added a comment - This looks like reincarnation of https://issues.jenkins-ci.org/browse/JENKINS-20427 ?

          I'm facing the same issue. Reported by me here: https://issues.jenkins-ci.org/browse/JENKINS-38406

          puneeth_n Puneeth Nanjundaswamy added a comment - I'm facing the same issue. Reported by me here: https://issues.jenkins-ci.org/browse/JENKINS-38406
          romangoward Roman Pavlov added a comment -

          yk4ever, puneeth_n, hey guys! I didn't use jenkins for a while, but now I've set up a new job and it works fine. Originally I've worked with gitlab, but now I am working with github.com.

          My current software versions are:

          • jenkins 2.13
          • git 2.5.2

          And I am using a regexp as the Branch Specifier.
          So, If you have git branches named as BUG-100-some-fixes, or FR-15-some-new-features, just use this regexp:

          :^origin\/(BUG-.*|FR-.*)-.*$
          
          romangoward Roman Pavlov added a comment - yk4ever , puneeth_n , hey guys! I didn't use jenkins for a while, but now I've set up a new job and it works fine. Originally I've worked with gitlab, but now I am working with github.com. My current software versions are: jenkins 2.13 git 2.5.2 And I am using a regexp as the Branch Specifier. So, If you have git branches named as BUG-100-some-fixes, or FR-15-some-new-features, just use this regexp: :^origin\/(BUG-.*|FR-.*)-.*$

          People

            romangoward Roman Pavlov
            romangoward Roman Pavlov
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: