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

Git push will trigger a build even though no path matches included regions

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

      Git push will trigger a build even though no path matches included regions.

      I have the following GIT polling configuration:
      ------------------------------------------------

      Included regions: scripts/.*
      Excluded regions: <empty>
      Force polling using workspace: YES

      Polling Log:
      ----------------
      View as plain text
      This page captures the polling log that triggered this build.

      Started on Apr 2, 2014 11:23:32 AM
      Polling SCM changes on master
      Using strategy: Default
      [poll] Last Built Revision: Revision 53859d4feaa11d51f08dc73497df4ec6cef95a86 (origin/master)
      Fetching changes from the remote Git repositories
      Fetching upstream changes from git@idc-git.video54.local:sci-dev/sci-2-0.git
      using GIT_SSH to set credentials
      Polling for changes in
      Ignored commit d1edfe2105602ff3ac75be0ae746764387852d64: Found only excluded paths:
      Done. Took 4.7 sec
      Changes found

      GIT change d1edfe210* contains the following file:
      ---------------------------------------------------

      build/build-repo.sh

      Please tell whether you need more information from me.

          [JENKINS-22457] Git push will trigger a build even though no path matches included regions

          Mark Waite added a comment - - edited

          I am unable to duplicate the problem. All the cases I tried behaved as I expected.

          I've created a repository which hosts the various attempts I've used to try to duplicate the bug. Current attempts used:

          • git protocol URL (no credentials) and ssh protocol (with credentials)
          • changes in scripts directory are detected and cause a build
          • changes in the build directory are detected and correctly do not cause a build.
          • changes in the root directory of the repository are detected and correctly do not cause a build

          The job definition I'm using is in that github repository. Can you provide any other hints about things that may be different between your environment and mine?

          Mark Waite added a comment - - edited I am unable to duplicate the problem. All the cases I tried behaved as I expected. I've created a repository which hosts the various attempts I've used to try to duplicate the bug. Current attempts used: git protocol URL (no credentials) and ssh protocol (with credentials) changes in scripts directory are detected and cause a build changes in the build directory are detected and correctly do not cause a build. changes in the root directory of the repository are detected and correctly do not cause a build The job definition I'm using is in that github repository . Can you provide any other hints about things that may be different between your environment and mine?

          Mark Waite added a comment -

          After two weeks without a response to the request for more information, I'm closing this as "Cannot Reproduce"

          Mark Waite added a comment - After two weeks without a response to the request for more information, I'm closing this as "Cannot Reproduce"

          Bogdan Litescu added a comment - - edited

          I have the same issue. My setup is I have a github repository DnnSharp.Common. Inside I have many subprojects each in own folder. For each, I'v setup a job that includes only that path. Here's one example: http://goo.gl/3pTLIM
          Every time I make a change in one of the project, all project build, as if Include Paths doesn't work.

          Below is the log of a job that should't build. I see it says "Found only excluded paths: " followed by "Changes found" which doesn't make sense.

          Started on Mar 12, 2015 12:23:16 AM
          Polling SCM changes on master
          Using strategy: Default
          [poll] Last Built Revision: Revision 0c37a23c47a1f9dc8341c73bd318c0cd09b2c426 (origin/develop)
          > C:\Program Files (x86)\Git\bin\git.exe rev-parse --is-inside-work-tree # timeout=10
          Fetching changes from the remote Git repositories
          > C:\Program Files (x86)\Git\bin\git.exe config remote.origin.url https://github.com/dnnsharp/Common # timeout=10
          Fetching upstream changes from https://github.com/dnnsharp/Common
          > C:\Program Files (x86)\Git\bin\git.exe --version # timeout=10
          using .gitcredentials to set credentials
          > C:\Program Files (x86)\Git\bin\git.exe config --local credential.helper store --file=\"C:\Users\BOGDAN~1.LIT\AppData\Local\Temp\git4313116364363791607.credentials\" # timeout=10
          > C:\Program Files (x86)\Git\bin\git.exe -c core.askpass=true fetch --tags --progress https://github.com/dnnsharp/Common +refs/heads/:refs/remotes/origin/
          > C:\Program Files (x86)\Git\bin\git.exe config --local --remove-section credential # timeout=10
          Polling for changes in
          > C:\Program Files (x86)\Git\bin\git.exe rev-parse "origin/develop^

          {commit}

          " # timeout=10
          > C:\Program Files (x86)\Git\bin\git.exe log --full-history --no-abbrev --format=raw -M -m --raw 0c37a23c47a1f9dc8341c73bd318c0cd09b2c426..2792cadcf65e6d941437d8649852fd2cf1e83405 # timeout=10
          Ignored commit 2792cadcf65e6d941437d8649852fd2cf1e83405: Found only excluded paths:
          Done. Took 3.3 sec
          Changes found

          Bogdan Litescu added a comment - - edited I have the same issue. My setup is I have a github repository DnnSharp.Common. Inside I have many subprojects each in own folder. For each, I'v setup a job that includes only that path. Here's one example: http://goo.gl/3pTLIM Every time I make a change in one of the project, all project build, as if Include Paths doesn't work. Below is the log of a job that should't build. I see it says "Found only excluded paths: " followed by "Changes found" which doesn't make sense. Started on Mar 12, 2015 12:23:16 AM Polling SCM changes on master Using strategy: Default [poll] Last Built Revision: Revision 0c37a23c47a1f9dc8341c73bd318c0cd09b2c426 (origin/develop) > C:\Program Files (x86)\Git\bin\git.exe rev-parse --is-inside-work-tree # timeout=10 Fetching changes from the remote Git repositories > C:\Program Files (x86)\Git\bin\git.exe config remote.origin.url https://github.com/dnnsharp/Common # timeout=10 Fetching upstream changes from https://github.com/dnnsharp/Common > C:\Program Files (x86)\Git\bin\git.exe --version # timeout=10 using .gitcredentials to set credentials > C:\Program Files (x86)\Git\bin\git.exe config --local credential.helper store --file=\"C:\Users\BOGDAN~1.LIT\AppData\Local\Temp\git4313116364363791607.credentials\" # timeout=10 > C:\Program Files (x86)\Git\bin\git.exe -c core.askpass=true fetch --tags --progress https://github.com/dnnsharp/Common +refs/heads/ :refs/remotes/origin/ > C:\Program Files (x86)\Git\bin\git.exe config --local --remove-section credential # timeout=10 Polling for changes in > C:\Program Files (x86)\Git\bin\git.exe rev-parse "origin/develop^ {commit} " # timeout=10 > C:\Program Files (x86)\Git\bin\git.exe log --full-history --no-abbrev --format=raw -M -m --raw 0c37a23c47a1f9dc8341c73bd318c0cd09b2c426..2792cadcf65e6d941437d8649852fd2cf1e83405 # timeout=10 Ignored commit 2792cadcf65e6d941437d8649852fd2cf1e83405: Found only excluded paths: Done. Took 3.3 sec Changes found

          Forgot to mention, this only happens in this scenario:
          I make a change locally
          I push to my personal fork on github
          I make a pull request to the upstream

          If I make the change directly on upstream, everything works correctly.

          Bogdan Litescu added a comment - Forgot to mention, this only happens in this scenario: I make a change locally I push to my personal fork on github I make a pull request to the upstream If I make the change directly on upstream, everything works correctly.

          Looks like this could be a duplicate of this one
          https://issues.jenkins-ci.org/browse/JENKINS-23606

          Bogdan Litescu added a comment - Looks like this could be a duplicate of this one https://issues.jenkins-ci.org/browse/JENKINS-23606

          Yves Schumann added a comment -

          Struggling with the same problem but found the solution on IRC help: Did you tried it with a leading "^"?

          On my setup included regions

          foo/.*

          did not work but with

          ^foo/.*

          it works as expected!

          Yves Schumann added a comment - Struggling with the same problem but found the solution on IRC help: Did you tried it with a leading "^"? On my setup included regions foo/.* did not work but with ^foo/.* it works as expected!

          Christian Kanthak added a comment - - edited

          Just a note for others visiting this page because they have problems with 'included-regions' as I had:

          I also had trouble with path pattern 'scripts/.' which was not working as 'included-region'. The reason was that I did enable the *'shallow clone' option in git scm settings. When the option 'shallow clone' was disabled the 'included-region' parameter worked as expected.

          Thanks to markewaite for sharing the Jenkins job config.xml which helped me to detect differences with my job.

          Christian Kanthak added a comment - - edited Just a note for others visiting this page because they have problems with 'included-regions' as I had: I also had trouble with path pattern 'scripts/. ' which was not working as 'included-region'. The reason was that I did enable the *'shallow clone' option in git scm settings. When the option 'shallow clone' was disabled the 'included-region' parameter worked as expected. Thanks to markewaite for sharing the Jenkins job config.xml which helped me to detect differences with my job.

            Unassigned Unassigned
            spektom Michael Spector
            Votes:
            9 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated: