diff options
author | Jon Bratseth <bratseth@yahoo-inc.com> | 2018-01-08 16:27:00 +0100 |
---|---|---|
committer | Jon Bratseth <bratseth@yahoo-inc.com> | 2018-01-08 16:27:00 +0100 |
commit | 28f913781b951fb959c3ae388cb2f74500b63432 (patch) | |
tree | 4eafb51ee22936ffab82ca857a500632cec0e059 /controller-server/src | |
parent | 2a1ecdf46cd51dc4629c2be3f4e62954a0db0163 (diff) |
Handle failing stagingtest
Diffstat (limited to 'controller-server/src')
-rw-r--r-- | controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTrigger.java | 39 |
1 files changed, 23 insertions, 16 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTrigger.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTrigger.java index 5b9aaec598d..9cee3e4c572 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTrigger.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTrigger.java @@ -176,7 +176,7 @@ public class DeploymentTrigger { } else { JobStatus componentStatus = application.deploymentJobs().jobStatus().get(JobType.component); - if (changesAvailable(application, componentStatus, systemTestStatus)) { + if (componentStatus != null && changesAvailable(application, componentStatus, systemTestStatus)) { application = trigger(JobType.systemTest, application, false, "Available change in component"); controller.applications().store(application); } @@ -208,33 +208,40 @@ public class DeploymentTrigger { */ private boolean changesAvailable(Application application, JobStatus previous, JobStatus next) { if ( ! application.deploying().isPresent()) return false; + if (next == null) return true; Change change = application.deploying().get(); if (change instanceof Change.VersionChange) { // Propagate upgrade while making sure we never downgrade Version targetVersion = ((Change.VersionChange)change).version(); - // Is the target version tested? - if ( ! lastSuccessfulIs(targetVersion, JobType.stagingTest, application)) - return false; + if (next.type().isTest()) { + // Is it this job's turn to upgrade? + if ( previous != null && ! lastSuccessfulIs(targetVersion, previous.type(), application)) + return false; - // Is it this job's turn to upgrade? - if ( previous.type().isProduction() && ! isOnAtLeastProductionVersion(targetVersion, application, previous.type())) - return false; - - // Is the next a test zone which already completed this upgrade successfully? - if (next != null && next.type().isTest() && lastSuccessfulIs(targetVersion, next.type(), application)) - return false; - - // Is the next a production job for a zone already upgraded to this version or a newer one? - if (next != null && next.type().isProduction() && isOnAtLeastProductionVersion(targetVersion, application, next.type())) - return false; + // Has the upgrade already been done? + if (lastSuccessfulIs(targetVersion, next.type(), application)) + return false; + } + else if (next.type().isProduction()) { + // Is the target version tested? + if ( ! lastSuccessfulIs(targetVersion, JobType.stagingTest, application)) + return false; + + // Is it this job's turn to upgrade? + if ( previous.type().isProduction() && ! isOnAtLeastProductionVersion(targetVersion, application, previous.type())) + return false; + + // Is the next a production job for a zone already upgraded to this version or a newer one? + if (isOnAtLeastProductionVersion(targetVersion, application, next.type())) + return false; + } return true; } else { // revision changes do not need to handle downgrading if ( ! previous.lastSuccess().isPresent()) return false; - if (next == null) return true; if ( ! next.lastSuccess().isPresent()) return true; return previous.lastSuccess().get().revision().isPresent() && ! previous.lastSuccess().get().revision().equals(next.lastSuccess().get().revision()); |