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

Attempt to stop build storm on plugin update #152

Merged
merged 2 commits into from May 22, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/main/java/jenkins/branch/MultiBranchProject.java
Expand Up @@ -2079,7 +2079,15 @@ public void observe(@NonNull SCMHead head, @NonNull SCMRevision revision) throws
} else if (revision.isDeterministic()) {
SCMRevision scmLastBuiltRevision = _factory.getRevision(project);
SCMRevision scmLastSeenRevision = _factory.getLastSeenRevision(project);
if (!revision.equals(scmLastSeenRevision)) {
if (scmLastSeenRevision == null && scmLastBuiltRevision != null) {
scmLastSeenRevision = scmLastBuiltRevision;
try {
_factory.setLastSeenRevisionHash(project, revision);
} catch (IOException e) {
printStackTrace(e, listener.error("Could not update last seen revision hash"));
}
}
if (!revision.equals(scmLastBuiltRevision)) {
listener.getLogger()
.format("Changes detected: %s (%s → %s)%n", rawName, scmLastSeenRevision, revision);
needSave = true;
Expand Down