[JIRA] [gerrit-trigger-plugin] (JENKINS-32898) Disable Strict Forbidden File Verification option always causes trigger

37 views
Skip to first unread message

joseph.ajax@greenwayhealth.com (JIRA)

unread,
Feb 11, 2016, 11:02:03 AM2/11/16
to jenkinsc...@googlegroups.com
Joseph Ajax created an issue
 
Jenkins / Bug JENKINS-32898
Disable Strict Forbidden File Verification option always causes trigger
Issue Type: Bug Bug
Assignee: rsandell
Components: gerrit-trigger-plugin
Created: 11/Feb/16 4:01 PM
Environment: Jenkins 1.642.1, gerrit-trigger-plugin 2.18.3
Priority: Minor Minor
Reporter: Joseph Ajax

The Disable Strict Forbidden File Verification option appears to break all file/Topic level triggering. According to the in job config help regarding this option:

  • Enabling this option will allow an event to trigger a build if the event contains BOTH one or more wanted file paths 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.

I noticed when I had 2 files set as forbidden files and none in the add file path, if I checked in a change with just those 2 files it would still trigger the job.

Looking at the definition of the GerritProject.isInteresting(...) method (GerritProject.java line 215), if disableStrictForbiddenFileVerification is true, a trigger will occur regardless of matches for topics, files or forbidden files.

The code appears to be at odds with the expected documented behavior. As it currently stands, if a specified branch matches and the Disable Strict Forbidden File Verification option is selected. It does not matter what is in the topics, files or forbidden files fields: the job will be always be triggered.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265)
Atlassian logo

winnerwbx@gmail.com (JIRA)

unread,
Apr 12, 2016, 5:03:01 AM4/12/16
to jenkinsc...@googlegroups.com

joseph.ajax@greenwayhealth.com (JIRA)

unread,
Jul 28, 2016, 12:00:01 PM7/28/16
to jenkinsc...@googlegroups.com
Joseph Ajax updated an issue
Change By: Joseph Ajax
The Disable Strict Forbidden File Verification option appears to break all have a bug when the Fobidden File path is contained within the trigger file /Topic level triggering path .

According to the in job config help regarding this option:
{quote}
* Enabling this option will allow an event to trigger a build if the event contains BOTH one or more wanted file paths 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.
{quote}

I
noticed when I had 2 files set have done some testing and found that the behavior is as described unless the path in forbidden files and none file path field is a subset of the path in the add file path field.

File.isInteresting(...) ([FilePath.java|https://github.com/jenkinsci/gerrit-trigger-plugin/blob/master/src/main/java/com/sonyericsson/hudson/plugins/gerrit/trigger/hudsontrigger/data/FilePath.java] line 97) doesn't exclude forbidden paths from its search
, so if I checked the forbidden path is contained in a change with just those 2 files _files_ it would still will cause _foundInterestingTopicOrFile_ to be true and cause a trigger the job even though it's a forbidden file path .

Looking at the definition of the See also GerritProject.isInteresting(...) method ([GerritProject.java|https://github.com/jenkinsci/gerrit-trigger-plugin/blob/master/src/main/java/com/sonyericsson/hudson/plugins/gerrit/trigger/hudsontrigger/data/GerritProject.java] line 215), if disableStrictForbiddenFileVerification is true, a trigger will occur regardless of matches for topics, files or forbidden files.

The code appears to be at odds with the expected documented behavior. As it currently stands, if a specified branch matches and the Disable Strict Forbidden File Verification option is selected. It does not matter what is in the topics, files or forbidden files fields: the job will be always be triggered.
This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

joseph.ajax@greenwayhealth.com (JIRA)

unread,
Jul 28, 2016, 12:02:02 PM7/28/16
to jenkinsc...@googlegroups.com
Joseph Ajax updated an issue
The Disable Strict Forbidden File Verification option appears have a bug when the Fobidden File path is contained within the trigger file path.

According to the in job config help regarding this option:
{quote}
* Enabling this option will allow an event to trigger a build if the event contains BOTH one or more wanted file paths 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.
{quote}

I have done some testing and found that the behavior is as described unless the path in forbidden file path field is a subset of the path in the file path field.

File.isInteresting(...) ([FilePath.java|https://github.com/jenkinsci/gerrit-trigger-plugin/blob/master/src/main/java/com/sonyericsson/hudson/plugins/gerrit/trigger/hudsontrigger/data/FilePath.java] line 97) doesn't exclude forbidden paths from its search, so if the forbidden path is contained in _files_ it will cause _foundInterestingTopicOrFile_ to be true and cause a trigger even though it's a forbidden file path.

See also GerritProject.isInteresting(...) method ([GerritProject.java|https://github.com/jenkinsci/gerrit-trigger-plugin/blob/master/src/main/java/com/sonyericsson/hudson/plugins/gerrit/trigger/hudsontrigger/data/GerritProject.java] line 215)
, if disableStrictForbiddenFileVerification is true, a trigger will occur regardless of matches for topics, files or forbidden files .

The code appears to be at odds with the expected documented behavior. As it currently stands, if a specified branch matches and the Disable Strict Forbidden File Verification option is selected. It does not matter what is in the topics, files or forbidden files fields: the job will be always be triggered.

joseph.ajax@greenwayhealth.com (JIRA)

unread,
Jul 28, 2016, 12:04:01 PM7/28/16
to jenkinsc...@googlegroups.com
Joseph Ajax commented on Bug JENKINS-32898
 
Re: Disable Strict Forbidden File Verification option always causes trigger

Looking at this again, it appears to only have issues if the forbidden path is part of an included path.

zc881208@126.com (JIRA)

unread,
Aug 12, 2018, 11:34:03 PM8/12/18
to jenkinsc...@googlegroups.com

Same problem.

This message was sent by Atlassian JIRA (v7.10.1#710002-sha1:6efc396)

anthonylee.wallace@gmail.com (JIRA)

unread,
May 15, 2019, 3:18:03 PM5/15/19
to jenkinsc...@googlegroups.com
Tony Wallace updated an issue
 
Change By: Tony Wallace
Attachment: image-2019-05-15-12-17-26-124.png
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

anthonylee.wallace@gmail.com (JIRA)

unread,
May 15, 2019, 3:29:01 PM5/15/19
to jenkinsc...@googlegroups.com
Tony Wallace commented on Bug JENKINS-32898
 
Re: Disable Strict Forbidden File Verification option always causes trigger

The "Disable Strict Forbidden File Verification" feature seems to behave as expected, if you recall that every Gerrit change includes a phony "file" named "/COMMIT_MSG". 

For example, with this config (below), a Gerrit patchset with source changes in both apps/atf/** and mobility_test/** will not trigger a build.

Before I added "/COMMIT_MSG" to it, that same patchset did trigger a build. 

Admittedly I have not tried a patchset with source changes in both Forbidden and normal files. Nor have I looked at this plugin's source code. However, I can confirm that "/COMMIT_MSG" always shows up in Gerrit's list of files changed by a patchset. 

eripflo@gmail.com (JIRA)

unread,
Oct 24, 2019, 4:18:03 PM10/24/19
to jenkinsc...@googlegroups.com

I followed exact same steps where:

Forbidden file – path – script/**

Forbidden file – path – /COMMIT_MSG

I also checked "Disable Strict Forbidden File Verification"

 

But it still triggers the build, I am expecting it should not trigger the build if it matches the file in the path specified.

The file is under "scripts/blah.sh"

 

I won't be able to share the data since it is work-related but I can try to reproduce it on my local environment. I would like to know if it is working as expected though. 

This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

abrikus@gmail.com (JIRA)

unread,
Nov 29, 2019, 2:07:03 PM11/29/19
to jenkinsc...@googlegroups.com

abrikus@gmail.com (JIRA)

unread,
Nov 29, 2019, 2:10:04 PM11/29/19
to jenkinsc...@googlegroups.com

abrikus@gmail.com (JIRA)

unread,
Nov 29, 2019, 2:12:02 PM11/29/19
to jenkinsc...@googlegroups.com
Serge VS commented on Bug JENKINS-32898
 
Re: Disable Strict Forbidden File Verification option always causes trigger

From help message:

Disabling strict forbidden file verification

    • Enabling this option will allow an event to trigger a build if the event contains BOTH one or more wanted file paths 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.

      You should have the following configuration

      Reply all
      Reply to author
      Forward
      0 new messages