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

[JENKINS-65462] Do NOT trigger jobs for changes that status != GerritChangeStatus.NEW #432

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
import com.sonyericsson.hudson.plugins.gerrit.trigger.version.GerritVersionChecker;
import com.sonymobile.tools.gerrit.gerritevents.GerritHandler;
import com.sonymobile.tools.gerrit.gerritevents.GerritQueryHandler;
import com.sonymobile.tools.gerrit.gerritevents.dto.GerritChangeStatus;
import com.sonymobile.tools.gerrit.gerritevents.dto.attr.Approval;
import com.sonymobile.tools.gerrit.gerritevents.dto.attr.Change;
import com.sonymobile.tools.gerrit.gerritevents.dto.attr.PatchSet;
Expand Down Expand Up @@ -925,7 +926,13 @@ public boolean equals(Object obj) {
* @return true if we should.
*/
private boolean isChangeInteresting(Change change, GerritProject project, GerritQueryHandler gerritQueryHandler) {

boolean shouldTrigger = false;

if (change.getStatus() != GerritChangeStatus.NEW ) {
return shouldTrigger; // return false immediately if it's a non-NEW status change
}

boolean containsFilePathsOrForbiddenFilePaths = ((project.getFilePaths() != null
&& project.getFilePaths().size() > 0)
|| (project.getForbiddenFilePaths() != null && project.getForbiddenFilePaths().size() > 0));
Expand Down