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

Add an option to permit the disable of Strict Forbidden files

    XMLWordPrintable

Details

    Description

      Add option to a gerrit project to permit the disable of the default strict forbidden file verification of an event.

      Enabling this option will allow an event to trigger a build if the event contains BOTH one or more wanted file paths/topics/branches AND one or more forbidden file paths.

      In other words, with this option, the build will not get triggered if the change contains only forbidden files, otherwise it will get triggered.

      A checkbox that has "Disable Strict Forbidden File Verification" shall be added.

      Attachments

        Activity

          scoheb Scott Hebert created issue -
          scoheb Scott Hebert made changes -
          Field Original Value New Value
          Description Consider the case whereby you have a job setup with a File path and a Forbidden File path

          File Path:
           - Path: **/src/*
          Forbidden Path:
           - Path: **/bin/*

          Currently, if a patchset contains ONLY files from the Forbidden path, the job is NOT triggered.
          However, if the patchset contains BOTH files from the File path AND the Forbidden File path, the job will again NOT be triggered.

          It may be useful in some case to be able to specify which item (File or Fobidden File) shall take priority when deciding to trigger a build.

          For example, a checkbox that has *"Trigger a build even though items are present in Forbidden Files when files from File Path are present in the patchset"*
          Consider the case whereby you have a job setup with a File path and a Forbidden File path

          File Path:
           - Path: **/src/*

          Forbidden Path:
           - Path: **/bin/*

          Currently, if a patchset contains ONLY files from the Forbidden path, the job is NOT triggered.
          However, if the patchset contains BOTH files from the File path AND the Forbidden File path, the job will again NOT be triggered.

          It may be useful in some case to be able to specify which item (File or Fobidden File) shall take priority when deciding to trigger a build.

          For example, a checkbox that has *"Trigger a build even though items are present in Forbidden Files when files from File Path are present in the patchset"*
          scoheb Scott Hebert made changes -
          Assignee rsandell [ rsandell ] Scott Hebert [ scoheb ]
          scoheb Scott Hebert made changes -
          Status Open [ 1 ] In Progress [ 3 ]

          I would like something slightly more general. We currently define our trigger using project-pattern (repository name) and branch-pattern (** for all files). We don't use file-paths. But we'd also like the same functionality as specified above, where we'd like the project to not trigger only if ALL the changed items are in forbidden-file-paths.

          Looking at the existing semantics, the following tags are additive:

          branches
          file-paths
          topics

          and the following is subtractive:

          forbidden-file-paths

          If a checkbox is added, it should account for all of the additive tags instead of just file-paths.

          nasjenkins Naseer Siddique added a comment - I would like something slightly more general. We currently define our trigger using project-pattern (repository name) and branch-pattern (** for all files). We don't use file-paths. But we'd also like the same functionality as specified above, where we'd like the project to not trigger only if ALL the changed items are in forbidden-file-paths. Looking at the existing semantics, the following tags are additive: branches file-paths topics and the following is subtractive: forbidden-file-paths If a checkbox is added, it should account for all of the additive tags instead of just file-paths.
          scoheb Scott Hebert made changes -
          Description Consider the case whereby you have a job setup with a File path and a Forbidden File path

          File Path:
           - Path: **/src/*

          Forbidden Path:
           - Path: **/bin/*

          Currently, if a patchset contains ONLY files from the Forbidden path, the job is NOT triggered.
          However, if the patchset contains BOTH files from the File path AND the Forbidden File path, the job will again NOT be triggered.

          It may be useful in some case to be able to specify which item (File or Fobidden File) shall take priority when deciding to trigger a build.

          For example, a checkbox that has *"Trigger a build even though items are present in Forbidden Files when files from File Path are present in the patchset"*
          Add option to a gerrit project to permit the disable of the default strict forbidden file verification of an event.

          Enabling this option will allow an event to trigger a build if the event contains BOTH one or more wanted file paths/topics/branches AND one or more forbidden file paths.

          In other words, with this option, the build will not get triggered if the change contains only forbidden files, otherwise it will get triggered.

          A checkbox that has *"Disable Strict Forbidden File Verification"* shall be added.
          scoheb Scott Hebert made changes -
          Summary Enforcing Forbidden File path to take priority over File path shall be a configurable Add an option to permit the disable of Strict Forbidden files
          scoheb Scott Hebert added a comment -

          I have updated this issue to be inline with the actual PR (https://github.com/jenkinsci/gerrit-trigger-plugin/pull/252) that I started working on. The semantics you described is exactly what this fix will address.

          scoheb Scott Hebert added a comment - I have updated this issue to be inline with the actual PR ( https://github.com/jenkinsci/gerrit-trigger-plugin/pull/252 ) that I started working on. The semantics you described is exactly what this fix will address.

          Perfect. Thanks!

          nasjenkins Naseer Siddique added a comment - Perfect. Thanks!

          Code changed in jenkins
          User: Scott Hebert
          Path:
          src/main/java/com/sonyericsson/hudson/plugins/gerrit/trigger/hudsontrigger/GerritDynamicUrlProcessor.java
          src/main/java/com/sonyericsson/hudson/plugins/gerrit/trigger/hudsontrigger/data/GerritProject.java
          src/main/resources/com/sonyericsson/hudson/plugins/gerrit/trigger/hudsontrigger/GerritTrigger/config.jelly
          src/main/webapp/trigger/help-GerritTriggerConfiguration.html
          src/test/java/com/sonyericsson/hudson/plugins/gerrit/trigger/gerritnotifier/job/rest/BuildCompletedRestCommandJobHudsonTest.java
          src/test/java/com/sonyericsson/hudson/plugins/gerrit/trigger/hudsontrigger/GerritProjectListTest.java
          src/test/java/com/sonyericsson/hudson/plugins/gerrit/trigger/hudsontrigger/GerritTriggerTest.java
          src/test/java/com/sonyericsson/hudson/plugins/gerrit/trigger/hudsontrigger/WorkflowTest.java
          src/test/java/com/sonyericsson/hudson/plugins/gerrit/trigger/hudsontrigger/data/GerritProjectInterestingTest.java
          src/test/java/com/sonyericsson/hudson/plugins/gerrit/trigger/hudsontrigger/data/GerritProjectWithFilesInterestingTest.java
          src/test/java/com/sonyericsson/hudson/plugins/gerrit/trigger/mock/DuplicatesUtil.java
          http://jenkins-ci.org/commit/gerrit-trigger-plugin/897bb7bdd132530b28401f0a628ce46d194f3c01
          Log:
          Option to permit disable Strict Forbidden files

          Add option to gerrit project to permit the disable of the default
          strict forbidden file verification of an event

          Enabling this option will allow an event to trigger a build if the event contains BOTH one or more wanted file paths/topics/branches AND one or more forbidden file paths.

          In other words, with this option, the build will not get triggered if the change contains only forbidden files, otherwise it will get triggered.

          [FIXED JENKINS-30620]

          Change-Id: Icb84111c82a38db722ec09bf7538441bc1b9424a

          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Scott Hebert Path: src/main/java/com/sonyericsson/hudson/plugins/gerrit/trigger/hudsontrigger/GerritDynamicUrlProcessor.java src/main/java/com/sonyericsson/hudson/plugins/gerrit/trigger/hudsontrigger/data/GerritProject.java src/main/resources/com/sonyericsson/hudson/plugins/gerrit/trigger/hudsontrigger/GerritTrigger/config.jelly src/main/webapp/trigger/help-GerritTriggerConfiguration.html src/test/java/com/sonyericsson/hudson/plugins/gerrit/trigger/gerritnotifier/job/rest/BuildCompletedRestCommandJobHudsonTest.java src/test/java/com/sonyericsson/hudson/plugins/gerrit/trigger/hudsontrigger/GerritProjectListTest.java src/test/java/com/sonyericsson/hudson/plugins/gerrit/trigger/hudsontrigger/GerritTriggerTest.java src/test/java/com/sonyericsson/hudson/plugins/gerrit/trigger/hudsontrigger/WorkflowTest.java src/test/java/com/sonyericsson/hudson/plugins/gerrit/trigger/hudsontrigger/data/GerritProjectInterestingTest.java src/test/java/com/sonyericsson/hudson/plugins/gerrit/trigger/hudsontrigger/data/GerritProjectWithFilesInterestingTest.java src/test/java/com/sonyericsson/hudson/plugins/gerrit/trigger/mock/DuplicatesUtil.java http://jenkins-ci.org/commit/gerrit-trigger-plugin/897bb7bdd132530b28401f0a628ce46d194f3c01 Log: Option to permit disable Strict Forbidden files Add option to gerrit project to permit the disable of the default strict forbidden file verification of an event Enabling this option will allow an event to trigger a build if the event contains BOTH one or more wanted file paths/topics/branches AND one or more forbidden file paths. In other words, with this option, the build will not get triggered if the change contains only forbidden files, otherwise it will get triggered. [FIXED JENKINS-30620] Change-Id: Icb84111c82a38db722ec09bf7538441bc1b9424a
          scm_issue_link SCM/JIRA link daemon made changes -
          Resolution Fixed [ 1 ]
          Status In Progress [ 3 ] Resolved [ 5 ]
          rtyler R. Tyler Croy made changes -
          Workflow JNJira [ 165734 ] JNJira + In-Review [ 197795 ]

          People

            scoheb Scott Hebert
            scoheb Scott Hebert
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: