Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix loose forbidden file #339

Merged
merged 2 commits into from Dec 18, 2017

Conversation

Projects
None yet
3 participants
@Typz
Copy link
Contributor

commented Dec 5, 2017

When disableStrictForbiddenFileVerification is set and the
contains only forbidden files, the build should not be triggered. This
can happen when setting forbidden files but not allowed files, i.e.
marking all files as interesting.

@@ -219,29 +220,22 @@ public boolean isInteresting(String project, String branch, String topic, List<S
boolean foundInterestingTopicOrFile = false;

This comment has been minimized.

Copy link
@rsandell

rsandell Dec 6, 2017

Member

I don't think these are used any more?

This comment has been minimized.

Copy link
@Typz

Typz Dec 8, 2017

Author Contributor

Done

return true;
}
}
return isInterestingTopic(topic) && !files.isEmpty() && isInterestingFile(files);

This comment has been minimized.

Copy link
@rsandell

rsandell Dec 6, 2017

Member

I'm not sure we want to return false if there are no changed files. Only if there are files we are interested in and changed files is empty.

This comment has been minimized.

Copy link
@Typz

Typz Dec 8, 2017

Author Contributor

The condition you indicate is handled in isInterestingFile().

This test is here because we should return false when all files are forbidden, i.e. there are no more after filtering.

This comment has been minimized.

Copy link
@Typz

Typz Dec 8, 2017

Author Contributor

Done

Typz added some commits Dec 5, 2017

Fix 'loose' Forbidden File Verification with only forbidden files
When `disableStrictForbiddenFileVerification` is set and the commit
contains only forbidden files, the build should not be triggered. This
can happen when setting forbidden files but not allowed files, i.e.
marking all files as interesting.

@Typz Typz force-pushed the Typz:fixLooseForbiddenFile branch from 43f85dc to 6b6af61 Dec 8, 2017

@Typz

This comment has been minimized.

Copy link
Contributor Author

commented Dec 11, 2017

@rsandell : I have updated the patch, can you check it again? Thanks,

@rsandell rsandell merged commit 13fa586 into jenkinsci:master Dec 18, 2017

1 check passed

continuous-integration/jenkins/pr-merge This commit looks good
Details

@Typz Typz deleted the Typz:fixLooseForbiddenFile branch Dec 21, 2017

return false;
} else {
foundInterestingForbidden = true;
i.remove();

This comment has been minimized.

Copy link
@Jimilian

Jimilian Jan 15, 2018

Contributor

Potentially this line creates a bug. Because https://github.com/sonyxperiadev/gerrit-events/blob/7f3547c6d55946e25e99a847b5160d69e59994ba/src/main/java/com/sonymobile/tools/gerrit/gerritevents/dto/events/ChangeBasedEvent.java caches the list of files and checks it against null. So, one trigger modifies list of files visible for another trigger.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.