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

multibranch-build-strategy-extension plugin not ignoring excluded regions

      I have recently installed the multibranch-build-strategy-extension plugin to avoid triggering builds for the following regions:

      *.md
      *.gitignore
      docs/**
      

      I have configured it into the project and then tried using .jenkinsignore file instead.

      Either way, when pushing a modification only on the README.md file, a build is still triggered when pollSCM checks for changes

          [JENKINS-65217] multibranch-build-strategy-extension plugin not ignoring excluded regions

          Cedric H added a comment -

          Looking at Jenkins system logs, I have the following type of errors:

           
          Mar 24, 2021 2:57:15 PM SEVERE com.igalg.jenkins.plugins.multibranch.buildstrategy.ExcludeByIgnoreFileBranchBuildStrategy isAutomaticBuild
          File:.jenkinsignore not found
          Mar 24, 2021 2:57:15 PM SEVERE com.igalg.jenkins.plugins.multibranch.buildstrategy.ExcludeByIgnoreFileBranchBuildStrategy isAutomaticBuild
          Unecpected exception java.io.FileNotFoundException at jenkins.plugins.git.GitSCMFile.lambda$content$2(GitSCMFile.java:164) at jenkins.plugins.git.GitSCMFileSystem.lambda$invoke$e8567d7e$1(GitSCMFileSystem.java:182) at org.jenkinsci.plugins.gitclient.AbstractGitAPIImpl.withRepository(AbstractGitAPIImpl.java:29) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.withRepository(CliGitAPIImpl.java:84) at jenkins.plugins.git.GitSCMFileSystem.invoke(GitSCMFileSystem.java:182) at jenkins.plugins.git.GitSCMFile.content(GitSCMFile.java:158) at jenkins.scm.api.SCMFile.contentAsString(SCMFile.java:335) at com.igalg.jenkins.plugins.multibranch.buildstrategy.ExcludeByIgnoreFileBranchBuildStrategy.isAutomaticBuild(ExcludeByIgnoreFileBranchBuildStrategy.java:103) at jenkins.branch.BranchBuildStrategy.automaticBuild(BranchBuildStrategy.java:260) at jenkins.branch.MultiBranchProject$SCMHeadObserverImpl.isAutomaticBuild(MultiBranchProject.java:2252) at jenkins.branch.MultiBranchProject$SCMHeadObserverImpl.doAutomaticBuilds(MultiBranchProject.java:2203) at jenkins.branch.MultiBranchProject$SCMHeadObserverImpl.observeExisting(MultiBranchProject.java:2029) at jenkins.branch.MultiBranchProject$SCMHeadObserverImpl.observe(MultiBranchProject.java:1989) at jenkins.scm.api.trait.SCMSourceRequest.process(SCMSourceRequest.java:357) at jenkins.scm.api.trait.SCMSourceRequest.process(SCMSourceRequest.java:249) at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource.retrieve(GitHubSCMSource.java:1000) at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:373) at jenkins.scm.api.SCMSource.fetch(SCMSource.java:283) at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:641) at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:278) at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:165) at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:1032) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:428)
          

          Apparently, when using the .jenkinsignore, it does not find it in the repository content from the previous revision

          Cedric H added a comment - Looking at Jenkins system logs, I have the following type of errors:   Mar 24, 2021 2:57:15 PM SEVERE com.igalg.jenkins.plugins.multibranch.buildstrategy.ExcludeByIgnoreFileBranchBuildStrategy isAutomaticBuild File:.jenkinsignore not found Mar 24, 2021 2:57:15 PM SEVERE com.igalg.jenkins.plugins.multibranch.buildstrategy.ExcludeByIgnoreFileBranchBuildStrategy isAutomaticBuild Unecpected exception java.io.FileNotFoundException at jenkins.plugins.git.GitSCMFile.lambda$content$2(GitSCMFile.java:164) at jenkins.plugins.git.GitSCMFileSystem.lambda$invoke$e8567d7e$1(GitSCMFileSystem.java:182) at org.jenkinsci.plugins.gitclient.AbstractGitAPIImpl.withRepository(AbstractGitAPIImpl.java:29) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.withRepository(CliGitAPIImpl.java:84) at jenkins.plugins.git.GitSCMFileSystem.invoke(GitSCMFileSystem.java:182) at jenkins.plugins.git.GitSCMFile.content(GitSCMFile.java:158) at jenkins.scm.api.SCMFile.contentAsString(SCMFile.java:335) at com.igalg.jenkins.plugins.multibranch.buildstrategy.ExcludeByIgnoreFileBranchBuildStrategy.isAutomaticBuild(ExcludeByIgnoreFileBranchBuildStrategy.java:103) at jenkins.branch.BranchBuildStrategy.automaticBuild(BranchBuildStrategy.java:260) at jenkins.branch.MultiBranchProject$SCMHeadObserverImpl.isAutomaticBuild(MultiBranchProject.java:2252) at jenkins.branch.MultiBranchProject$SCMHeadObserverImpl.doAutomaticBuilds(MultiBranchProject.java:2203) at jenkins.branch.MultiBranchProject$SCMHeadObserverImpl.observeExisting(MultiBranchProject.java:2029) at jenkins.branch.MultiBranchProject$SCMHeadObserverImpl.observe(MultiBranchProject.java:1989) at jenkins.scm.api.trait.SCMSourceRequest.process(SCMSourceRequest.java:357) at jenkins.scm.api.trait.SCMSourceRequest.process(SCMSourceRequest.java:249) at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource.retrieve(GitHubSCMSource.java:1000) at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:373) at jenkins.scm.api.SCMSource.fetch(SCMSource.java:283) at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:641) at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:278) at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:165) at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:1032) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:428) Apparently, when using the .jenkinsignore , it does not find it in the repository content from the previous revision

          Cedric H added a comment - - edited

          Further look into Jenkins system logs shows that when using 'Cancel build excluded regions strategy', the filtering criteria are loaded:

          Mar 24, 2021 4:27:05 PM INFO com.igalg.jenkins.plugins.multibranch.buildstrategy.ExcludeRegionBranchBuildStrategy isAutomaticBuild
          Excluded regions: [*.md, *.gitignore, docs/**]
          

          Unfortunately, all the messages as the following one are related to the files changed from a previous revision, but not the files bound to the current revision/commit.

          Mar 24, 2021 4:27:08 PM INFO com.igalg.jenkins.plugins.multibranch.buildstrategy.ExcludeRegionBranchBuildStrategy isAutomaticBuild
          File:my-project/some-directory/one-file.xml Not matched any excluded region [*.md, *.gitignore, docs/**] build should be triggered
          

           

          NOTE: As an additional improvement, it would be helpful to have the logs including the current and previous revisions and the job/branch name in the message

          Cedric H added a comment - - edited Further look into Jenkins system logs shows that when using 'Cancel build excluded regions strategy', the filtering criteria are loaded: Mar 24, 2021 4:27:05 PM INFO com.igalg.jenkins.plugins.multibranch.buildstrategy.ExcludeRegionBranchBuildStrategy isAutomaticBuild Excluded regions: [*.md, *.gitignore, docs/**] Unfortunately, all the messages as the following one are related to the files changed from a previous revision, but not the files bound to the current revision/commit. Mar 24, 2021 4:27:08 PM INFO com.igalg.jenkins.plugins.multibranch.buildstrategy.ExcludeRegionBranchBuildStrategy isAutomaticBuild File:my-project/some-directory/one-file.xml Not matched any excluded region [*.md, *.gitignore, docs/**] build should be triggered   NOTE : As an additional improvement, it would be helpful to have the logs including the current and previous revisions and the job/branch name in the message

          Cedric H added a comment -

          As a complement to the previous comment, it looks like the files from the previous revision in the current situation is related to a commit that occurred 10 days ago on our Git repository and with multiple builds having occurred since

          Cedric H added a comment - As a complement to the previous comment, it looks like the files from the previous revision in the current situation is related to a commit that occurred 10 days ago on our Git repository and with multiple builds having occurred since

            igalg Igal Gluh
            ceddaerrix Cedric H
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: