summaryrefslogtreecommitdiffstats
path: root/controller-server
diff options
context:
space:
mode:
authorJon Marius Venstad <jonmv@users.noreply.github.com>2020-02-13 10:51:21 +0100
committerGitHub <noreply@github.com>2020-02-13 10:51:21 +0100
commit69eb815faa01bc09db12f15ff95bd4dd9869458f (patch)
treee00114384e331417b72a16d7020fcf2eec59a174 /controller-server
parentc93115373ce94326892057d6a8a6f0c8e312600d (diff)
Revert "Revert "Jvenstad/reapply deployment graph api additions""
Diffstat (limited to 'controller-server')
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentStatus.java3
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java2
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/JobControllerApiHandlerHelper.java82
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/ApplicationPackageBuilder.java2
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/JobControllerApiHandlerHelperTest.java11
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/deployment-overview-2.json356
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/deployment-overview.json138
7 files changed, 402 insertions, 192 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentStatus.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentStatus.java
index 3a60c480100..35ec6c8d769 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentStatus.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentStatus.java
@@ -52,7 +52,8 @@ import static java.util.stream.Collectors.toUnmodifiableMap;
public class DeploymentStatus {
public static List<JobId> jobsFor(Application application, SystemName system) {
- if (DeploymentSpec.empty.equals(application.deploymentSpec()))
+ if ( DeploymentSpec.empty.equals(application.deploymentSpec())
+ || application.projectId().isEmpty())
return List.of();
return application.deploymentSpec().instances().stream()
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java
index f37304025ac..c42bbf7c1b7 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java
@@ -2036,7 +2036,7 @@ public class ApplicationApiHandler extends LoggingRequestHandler {
private HttpResponse submit(String tenant, String application, HttpRequest request) {
Map<String, byte[]> dataParts = parseDataParts(request);
Inspector submitOptions = SlimeUtils.jsonToSlime(dataParts.get(EnvironmentResource.SUBMIT_OPTIONS)).get();
- long projectId = Math.max(1, submitOptions.field("projectId").asLong());
+ long projectId = Math.max(1, submitOptions.field("projectId").asLong()); // Absence of this means it's not a prod app :/
Optional<String> repository = optional("repository", submitOptions);
Optional<String> branch = optional("branch", submitOptions);
Optional<String> commit = optional("commit", submitOptions);
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/JobControllerApiHandlerHelper.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/JobControllerApiHandlerHelper.java
index 73cdf28c366..339facec231 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/JobControllerApiHandlerHelper.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/JobControllerApiHandlerHelper.java
@@ -5,6 +5,7 @@ import com.google.common.base.Joiner;
import com.yahoo.component.Version;
import com.yahoo.config.application.api.DeploymentInstanceSpec;
import com.yahoo.config.application.api.DeploymentSpec;
+import com.yahoo.config.application.api.DeploymentSpec.ChangeBlocker;
import com.yahoo.config.provision.ApplicationId;
import com.yahoo.config.provision.SystemName;
import com.yahoo.config.provision.zone.ZoneId;
@@ -41,14 +42,18 @@ import com.yahoo.vespa.hosted.controller.deployment.Versions;
import com.yahoo.vespa.hosted.controller.versions.VespaVersion;
import java.net.URI;
+import java.time.Instant;
+import java.time.format.TextStyle;
import java.util.ArrayDeque;
import java.util.Comparator;
import java.util.Deque;
import java.util.LinkedHashMap;
import java.util.List;
+import java.util.Locale;
import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors;
+import java.util.stream.Stream;
import static com.yahoo.config.application.api.DeploymentSpec.UpgradePolicy.conservative;
import static com.yahoo.config.application.api.DeploymentSpec.UpgradePolicy.defaultPolicy;
@@ -62,6 +67,7 @@ import static com.yahoo.vespa.hosted.controller.deployment.Step.installReal;
import static com.yahoo.vespa.hosted.controller.versions.VespaVersion.Confidence.broken;
import static com.yahoo.vespa.hosted.controller.versions.VespaVersion.Confidence.high;
import static com.yahoo.vespa.hosted.controller.versions.VespaVersion.Confidence.normal;
+import static java.util.Comparator.naturalOrder;
import static java.util.stream.Collectors.groupingBy;
import static java.util.stream.Collectors.toList;
import static java.util.stream.Collectors.toMap;
@@ -569,6 +575,42 @@ class JobControllerApiHandlerHelper {
stepObject.setBool("declared", stepStatus.isDeclared());
stepObject.setString("instance", stepStatus.instance().value());
+ stepStatus.readyAt(change).ifPresent(ready -> stepObject.setLong("readyAt", ready.toEpochMilli()));
+ stepStatus.readyAt(change)
+ .filter(controller.clock().instant()::isBefore)
+ .ifPresent(until -> stepObject.setLong("delayedUntil", until.toEpochMilli()));
+ stepStatus.pausedUntil().ifPresent(until -> stepObject.setLong("pausedUntil", until.toEpochMilli()));
+ stepStatus.coolingDownUntil(change).ifPresent(until -> stepObject.setLong("coolingDownUntil", until.toEpochMilli()));
+ stepStatus.blockedUntil(change).ifPresent(until -> stepObject.setLong("blockedUntil", until.toEpochMilli()));
+
+ if (stepStatus.type() == DeploymentStatus.StepType.instance) {
+ Cursor deployingObject = stepObject.setObject("deploying");
+ if ( ! change.isEmpty()) {
+ change.platform().ifPresent(version -> deployingObject.setString("platform", version.toString()));
+ change.application().ifPresent(version -> toSlime(deployingObject.setObject("application"), version));
+ }
+
+ Cursor latestVersionsObject = stepObject.setObject("latestVersions");
+ List<ChangeBlocker> blockers = application.deploymentSpec().requireInstance(stepStatus.instance()).changeBlocker();
+ latestVersionPreferablyWithNormalConfidenceNAndotNewerThanSystem(controller.versionStatus().versions())
+ .ifPresent(latestPlatform -> {
+ Cursor latestPlatformObject = latestVersionsObject.setObject("platform");
+ latestPlatformObject.setString("platform", latestPlatform.versionNumber().toFullString());
+ latestPlatformObject.setLong("at", latestPlatform.committedAt().toEpochMilli());
+ latestPlatformObject.setBool("upgrade", application.require(stepStatus.instance()).productionDeployments().values().stream()
+ .anyMatch(deployment -> deployment.version().isBefore(latestPlatform.versionNumber())));
+ toSlime(latestPlatformObject.setArray("blockers"), blockers.stream().filter(ChangeBlocker::blocksVersions));
+ });
+ application.latestVersion().ifPresent(latestApplication -> {
+ Cursor latestApplicationObject = latestVersionsObject.setObject("application");
+ toSlime(latestApplicationObject.setObject("application"), latestApplication);
+ latestApplicationObject.setLong("at", latestApplication.buildTime().orElse(Instant.EPOCH).toEpochMilli());
+ latestApplicationObject.setBool("upgrade", application.require(stepStatus.instance()).productionDeployments().values().stream()
+ .anyMatch(deployment -> deployment.applicationVersion().compareTo(latestApplication) < 0));
+ toSlime(latestApplicationObject.setArray("blockers"), blockers.stream().filter(ChangeBlocker::blocksRevisions));
+ });
+ }
+
stepStatus.job().ifPresent(job -> {
stepObject.setString("jobName", job.type().jobName());
String baseUriForJob = baseUriForDeployments.resolve(baseUriForDeployments.getPath() +
@@ -599,13 +641,6 @@ class JobControllerApiHandlerHelper {
Cursor runObject = toRunArray.addObject();
toSlime(runObject.setObject("versions"), versions);
}
- stepStatus.readyAt(change).ifPresent(ready -> stepObject.setLong("readyAt", ready.toEpochMilli()));
- stepStatus.readyAt(change)
- .filter(controller.clock().instant()::isBefore)
- .ifPresent(until -> stepObject.setLong("delayedUntil", until.toEpochMilli()));
- stepStatus.pausedUntil().ifPresent(until -> stepObject.setLong("pausedUntil", until.toEpochMilli()));
- stepStatus.coolingDownUntil(change).ifPresent(until -> stepObject.setLong("coolingDownUntil", until.toEpochMilli()));
- stepStatus.blockedUntil(change).ifPresent(until -> stepObject.setLong("blockedUntil", until.toEpochMilli()));
Cursor runsArray = stepObject.setArray("runs");
jobStatus.runs().descendingMap().values().stream().limit(10).forEach(run -> {
@@ -626,14 +661,11 @@ class JobControllerApiHandlerHelper {
});
}
- // TODO jonmv: Add latest platform and application status.
-
return new SlimeJsonResponse(slime);
}
private static void toSlime(Cursor versionObject, ApplicationVersion version) {
- version.buildNumber().ifPresent(id -> versionObject.setLong("id", id));
- version.source().ifPresent(source -> versionObject.setString("commit", source.commit()));
+ version.buildNumber().ifPresent(id -> versionObject.setLong("build", id));
version.compileVersion().ifPresent(platform -> versionObject.setString("compileVersion", platform.toFullString()));
version.sourceUrl().ifPresent(url -> versionObject.setString("sourceUrl", url));
version.commit().ifPresent(commit -> versionObject.setString("commit", commit));
@@ -646,5 +678,33 @@ class JobControllerApiHandlerHelper {
versions.sourceApplication().ifPresent(application -> toSlime(versionsObject.setObject("sourceApplication"), application));
}
+ private static void toSlime(Cursor blockersArray, Stream<ChangeBlocker> blockers) {
+ blockers.forEach(blocker -> {
+ Cursor blockerObject = blockersArray.addObject();
+ blocker.window().days().stream()
+ .map(day -> day.getDisplayName(TextStyle.SHORT, Locale.ENGLISH))
+ .forEach(blockerObject.setArray("days")::addString);
+ blocker.window().hours()
+ .forEach(blockerObject.setArray("hours")::addLong);
+ blockerObject.setString("zone", blocker.window().zone().toString());
+ });
+ }
+
+ private static Optional<VespaVersion> latestVersionPreferablyWithNormalConfidenceNAndotNewerThanSystem(List<VespaVersion> versions) {
+ int i;
+ for (i = versions.size(); i-- > 0; )
+ if (versions.get(i).isSystemVersion())
+ break;
+
+ if (i < 0)
+ return Optional.empty();
+
+ for (int j = i; j >= 0; j--)
+ if (versions.get(j).confidence().equalOrHigherThan(normal))
+ return Optional.of(versions.get(j));
+
+ return Optional.of(versions.get(i));
+ }
+
}
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/ApplicationPackageBuilder.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/ApplicationPackageBuilder.java
index 9b0706d184f..ed7ae12168f 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/ApplicationPackageBuilder.java
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/ApplicationPackageBuilder.java
@@ -201,11 +201,11 @@ public class ApplicationPackageBuilder {
xml.append("'/>\n");
}
xml.append(notifications);
- xml.append(blockChange);
if (explicitSystemTest)
xml.append(" <test />\n");
if (explicitStagingTest)
xml.append(" <staging />\n");
+ xml.append(blockChange);
xml.append(" <");
xml.append(environment.value());
if (globalServiceId != null) {
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/JobControllerApiHandlerHelperTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/JobControllerApiHandlerHelperTest.java
index 186534dd288..1c96f46dd31 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/JobControllerApiHandlerHelperTest.java
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/JobControllerApiHandlerHelperTest.java
@@ -5,15 +5,12 @@ import com.yahoo.component.Version;
import com.yahoo.config.provision.zone.ZoneId;
import com.yahoo.container.jdisc.HttpResponse;
import com.yahoo.vespa.hosted.controller.api.application.v4.model.DeployOptions;
-import com.yahoo.vespa.hosted.controller.api.identifiers.DeploymentId;
import com.yahoo.vespa.hosted.controller.api.integration.configserver.ConfigServerException;
import com.yahoo.vespa.hosted.controller.api.integration.deployment.ApplicationVersion;
import com.yahoo.vespa.hosted.controller.api.integration.deployment.JobType;
import com.yahoo.vespa.hosted.controller.application.ApplicationPackage;
import com.yahoo.vespa.hosted.controller.deployment.ApplicationPackageBuilder;
import com.yahoo.vespa.hosted.controller.deployment.DeploymentTester;
-import com.yahoo.vespa.hosted.controller.deployment.InternalStepRunner;
-import com.yahoo.vespa.hosted.controller.deployment.RunStatus;
import org.json.JSONException;
import org.json.JSONObject;
import org.junit.Test;
@@ -26,6 +23,7 @@ import java.nio.file.Path;
import java.nio.file.Paths;
import java.time.Duration;
import java.time.Instant;
+import java.util.Date;
import java.util.Optional;
import static com.yahoo.vespa.hosted.controller.api.integration.configserver.ConfigServerException.ErrorCode.INVALID_APPLICATION_PACKAGE;
@@ -37,13 +35,10 @@ import static com.yahoo.vespa.hosted.controller.api.integration.deployment.JobTy
import static com.yahoo.vespa.hosted.controller.api.integration.deployment.JobType.stagingTest;
import static com.yahoo.vespa.hosted.controller.api.integration.deployment.JobType.systemTest;
import static com.yahoo.vespa.hosted.controller.api.integration.deployment.JobType.testUsCentral1;
-import static com.yahoo.vespa.hosted.controller.api.integration.deployment.TesterCloud.Status.FAILURE;
import static com.yahoo.vespa.hosted.controller.deployment.DeploymentContext.applicationPackage;
import static com.yahoo.vespa.hosted.controller.deployment.RunStatus.deploymentFailed;
-import static com.yahoo.vespa.hosted.controller.deployment.RunStatus.error;
import static com.yahoo.vespa.hosted.controller.deployment.RunStatus.installationFailed;
import static com.yahoo.vespa.hosted.controller.deployment.RunStatus.running;
-import static com.yahoo.vespa.hosted.controller.deployment.RunStatus.testFailure;
import static org.junit.Assert.assertEquals;
/**
@@ -56,6 +51,9 @@ public class JobControllerApiHandlerHelperTest {
public void testResponses() {
ApplicationPackage applicationPackage = new ApplicationPackageBuilder()
.stagingTest()
+ .blockChange(true, true, "mon,tue", "7-13", "UTC")
+ .blockChange(false, true, "sun", "0-23", "CET")
+ .blockChange(true, false, "fri-sat", "8", "America/Los_Angeles")
.region("us-central-1")
.test("us-central-1")
.parallel("us-west-1", "us-east-3")
@@ -139,7 +137,6 @@ public class JobControllerApiHandlerHelperTest {
userApp.runJob(devAwsUsEast2a, applicationPackage);
assertResponse(JobControllerApiHandlerHelper.runResponse(tester.jobs().runs(userApp.instanceId(), devAwsUsEast2a), URI.create("https://some.url:43/root")), "dev-aws-us-east-2a-runs.json");
assertResponse(JobControllerApiHandlerHelper.jobTypeResponse(tester.controller(), userApp.instanceId(), URI.create("https://some.url:43/root/")), "overview-user-instance.json");
-
assertResponse(JobControllerApiHandlerHelper.overviewResponse(tester.controller(), app.application().id(), URI.create("https://some.url:43/root/")), "deployment-overview-2.json");
}
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/deployment-overview-2.json b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/deployment-overview-2.json
index a8be282deaf..de88f914d44 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/deployment-overview-2.json
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/deployment-overview-2.json
@@ -6,19 +6,123 @@
"type": "instance",
"dependencies": [],
"declared": true,
- "instance": "default"
+ "instance": "default",
+ "readyAt": 0,
+ "deploying": {
+ "application": {
+ "build": 3,
+ "compileVersion": "6.1.0",
+ "sourceUrl": "repository1/tree/commit1",
+ "commit": "commit1"
+ }
+ },
+ "latestVersions": {
+ "platform": {
+ "platform": "7.1.0",
+ "at": 0,
+ "upgrade": true,
+ "blockers": [
+ {
+ "days": [
+ "Mon",
+ "Tue"
+ ],
+ "hours": [
+ 7,
+ 8,
+ 9,
+ 10,
+ 11,
+ 12,
+ 13
+ ],
+ "zone": "UTC"
+ },
+ {
+ "days": [
+ "Sun"
+ ],
+ "hours": [
+ 0,
+ 1,
+ 2,
+ 3,
+ 4,
+ 5,
+ 6,
+ 7,
+ 8,
+ 9,
+ 10,
+ 11,
+ 12,
+ 13,
+ 14,
+ 15,
+ 16,
+ 17,
+ 18,
+ 19,
+ 20,
+ 21,
+ 22,
+ 23
+ ],
+ "zone": "CET"
+ }
+ ]
+ },
+ "application": {
+ "application": {
+ "build": 3,
+ "compileVersion": "6.1.0",
+ "sourceUrl": "repository1/tree/commit1",
+ "commit": "commit1"
+ },
+ "at": 1000,
+ "upgrade": true,
+ "blockers": [
+ {
+ "days": [
+ "Mon",
+ "Tue"
+ ],
+ "hours": [
+ 7,
+ 8,
+ 9,
+ 10,
+ 11,
+ 12,
+ 13
+ ],
+ "zone": "UTC"
+ },
+ {
+ "days": [
+ "Fri",
+ "Sat"
+ ],
+ "hours": [
+ 8
+ ],
+ "zone": "America/Los_Angeles"
+ }
+ ]
+ }
+ }
},
{
"type": "test",
"dependencies": [],
"declared": false,
"instance": "default",
+ "readyAt": 0,
"jobName": "system-test",
"url": "https://some.url:43/instance/default/job/system-test",
"environment": "test",
"region": "test.us-east-1",
"toRun": [],
- "readyAt": 0,
"runs": [
{
"id": 3,
@@ -29,17 +133,17 @@
"versions": {
"targetPlatform": "6.1.0",
"targetApplication": {
- "id": 3,
- "commit": "commit1",
+ "build": 3,
"compileVersion": "6.1.0",
- "sourceUrl": "repository1/tree/commit1"
+ "sourceUrl": "repository1/tree/commit1",
+ "commit": "commit1"
},
"sourcePlatform": "6.1.0",
"sourceApplication": {
- "id": 2,
- "commit": "commit1",
+ "build": 2,
"compileVersion": "6.1.0",
- "sourceUrl": "repository1/tree/commit1"
+ "sourceUrl": "repository1/tree/commit1",
+ "commit": "commit1"
}
},
"steps": [
@@ -94,17 +198,17 @@
"versions": {
"targetPlatform": "6.1.0",
"targetApplication": {
- "id": 2,
- "commit": "commit1",
+ "build": 2,
"compileVersion": "6.1.0",
- "sourceUrl": "repository1/tree/commit1"
+ "sourceUrl": "repository1/tree/commit1",
+ "commit": "commit1"
},
"sourcePlatform": "6.1.0",
"sourceApplication": {
- "id": 1,
- "commit": "commit1",
+ "build": 1,
"compileVersion": "6.1.0",
- "sourceUrl": "repository1/tree/commit1"
+ "sourceUrl": "repository1/tree/commit1",
+ "commit": "commit1"
}
},
"steps": [
@@ -159,10 +263,10 @@
"versions": {
"targetPlatform": "6.1.0",
"targetApplication": {
- "id": 1,
- "commit": "commit1",
+ "build": 1,
"compileVersion": "6.1.0",
- "sourceUrl": "repository1/tree/commit1"
+ "sourceUrl": "repository1/tree/commit1",
+ "commit": "commit1"
}
},
"steps": [
@@ -215,6 +319,9 @@
"dependencies": [],
"declared": true,
"instance": "default",
+ "readyAt": 4353000,
+ "delayedUntil": 4353000,
+ "coolingDownUntil": 4353000,
"jobName": "staging-test",
"url": "https://some.url:43/instance/default/job/staging-test",
"environment": "staging",
@@ -224,24 +331,21 @@
"versions": {
"targetPlatform": "6.1.0",
"targetApplication": {
- "id": 3,
- "commit": "commit1",
+ "build": 3,
"compileVersion": "6.1.0",
- "sourceUrl": "repository1/tree/commit1"
+ "sourceUrl": "repository1/tree/commit1",
+ "commit": "commit1"
},
"sourcePlatform": "6.1.0",
"sourceApplication": {
- "id": 1,
- "commit": "commit1",
+ "build": 1,
"compileVersion": "6.1.0",
- "sourceUrl": "repository1/tree/commit1"
+ "sourceUrl": "repository1/tree/commit1",
+ "commit": "commit1"
}
}
}
],
- "readyAt": 4353000,
- "delayedUntil": 4353000,
- "coolingDownUntil": 4353000,
"runs": [
{
"id": 5,
@@ -252,17 +356,17 @@
"versions": {
"targetPlatform": "6.1.0",
"targetApplication": {
- "id": 3,
- "commit": "commit1",
+ "build": 3,
"compileVersion": "6.1.0",
- "sourceUrl": "repository1/tree/commit1"
+ "sourceUrl": "repository1/tree/commit1",
+ "commit": "commit1"
},
"sourcePlatform": "6.1.0",
"sourceApplication": {
- "id": 1,
- "commit": "commit1",
+ "build": 1,
"compileVersion": "6.1.0",
- "sourceUrl": "repository1/tree/commit1"
+ "sourceUrl": "repository1/tree/commit1",
+ "commit": "commit1"
}
},
"steps": [
@@ -333,17 +437,17 @@
"versions": {
"targetPlatform": "6.1.0",
"targetApplication": {
- "id": 3,
- "commit": "commit1",
+ "build": 3,
"compileVersion": "6.1.0",
- "sourceUrl": "repository1/tree/commit1"
+ "sourceUrl": "repository1/tree/commit1",
+ "commit": "commit1"
},
"sourcePlatform": "6.1.0",
"sourceApplication": {
- "id": 1,
- "commit": "commit1",
+ "build": 1,
"compileVersion": "6.1.0",
- "sourceUrl": "repository1/tree/commit1"
+ "sourceUrl": "repository1/tree/commit1",
+ "commit": "commit1"
}
},
"steps": [
@@ -414,17 +518,17 @@
"versions": {
"targetPlatform": "6.1.0",
"targetApplication": {
- "id": 3,
- "commit": "commit1",
+ "build": 3,
"compileVersion": "6.1.0",
- "sourceUrl": "repository1/tree/commit1"
+ "sourceUrl": "repository1/tree/commit1",
+ "commit": "commit1"
},
"sourcePlatform": "6.1.0",
"sourceApplication": {
- "id": 2,
- "commit": "commit1",
+ "build": 2,
"compileVersion": "6.1.0",
- "sourceUrl": "repository1/tree/commit1"
+ "sourceUrl": "repository1/tree/commit1",
+ "commit": "commit1"
}
},
"steps": [
@@ -495,17 +599,17 @@
"versions": {
"targetPlatform": "6.1.0",
"targetApplication": {
- "id": 2,
- "commit": "commit1",
+ "build": 2,
"compileVersion": "6.1.0",
- "sourceUrl": "repository1/tree/commit1"
+ "sourceUrl": "repository1/tree/commit1",
+ "commit": "commit1"
},
"sourcePlatform": "6.1.0",
"sourceApplication": {
- "id": 1,
- "commit": "commit1",
+ "build": 1,
"compileVersion": "6.1.0",
- "sourceUrl": "repository1/tree/commit1"
+ "sourceUrl": "repository1/tree/commit1",
+ "commit": "commit1"
}
},
"steps": [
@@ -576,10 +680,10 @@
"versions": {
"targetPlatform": "6.1.0",
"targetApplication": {
- "id": 1,
- "commit": "commit1",
+ "build": 1,
"compileVersion": "6.1.0",
- "sourceUrl": "repository1/tree/commit1"
+ "sourceUrl": "repository1/tree/commit1",
+ "commit": "commit1"
}
},
"steps": [
@@ -651,19 +755,19 @@
],
"declared": true,
"instance": "default",
+ "readyAt": 3603000,
"jobName": "production-us-central-1",
"url": "https://some.url:43/instance/default/job/production-us-central-1",
"environment": "prod",
"region": "prod.us-central-1",
"currentPlatform": "6.1.0",
"currentApplication": {
- "id": 3,
- "commit": "commit1",
+ "build": 3,
"compileVersion": "6.1.0",
- "sourceUrl": "repository1/tree/commit1"
+ "sourceUrl": "repository1/tree/commit1",
+ "commit": "commit1"
},
"toRun": [],
- "readyAt": 3603000,
"runs": [
{
"id": 3,
@@ -673,17 +777,17 @@
"versions": {
"targetPlatform": "6.1.0",
"targetApplication": {
- "id": 3,
- "commit": "commit1",
+ "build": 3,
"compileVersion": "6.1.0",
- "sourceUrl": "repository1/tree/commit1"
+ "sourceUrl": "repository1/tree/commit1",
+ "commit": "commit1"
},
"sourcePlatform": "6.1.0",
"sourceApplication": {
- "id": 2,
- "commit": "commit1",
+ "build": 2,
"compileVersion": "6.1.0",
- "sourceUrl": "repository1/tree/commit1"
+ "sourceUrl": "repository1/tree/commit1",
+ "commit": "commit1"
}
},
"steps": [
@@ -710,17 +814,17 @@
"versions": {
"targetPlatform": "6.1.0",
"targetApplication": {
- "id": 2,
- "commit": "commit1",
+ "build": 2,
"compileVersion": "6.1.0",
- "sourceUrl": "repository1/tree/commit1"
+ "sourceUrl": "repository1/tree/commit1",
+ "commit": "commit1"
},
"sourcePlatform": "6.1.0",
"sourceApplication": {
- "id": 1,
- "commit": "commit1",
+ "build": 1,
"compileVersion": "6.1.0",
- "sourceUrl": "repository1/tree/commit1"
+ "sourceUrl": "repository1/tree/commit1",
+ "commit": "commit1"
}
},
"steps": [
@@ -747,10 +851,10 @@
"versions": {
"targetPlatform": "6.1.0",
"targetApplication": {
- "id": 1,
- "commit": "commit1",
+ "build": 1,
"compileVersion": "6.1.0",
- "sourceUrl": "repository1/tree/commit1"
+ "sourceUrl": "repository1/tree/commit1",
+ "commit": "commit1"
}
},
"steps": [
@@ -786,17 +890,17 @@
"versions": {
"targetPlatform": "6.1.0",
"targetApplication": {
- "id": 3,
- "commit": "commit1",
+ "build": 3,
"compileVersion": "6.1.0",
- "sourceUrl": "repository1/tree/commit1"
+ "sourceUrl": "repository1/tree/commit1",
+ "commit": "commit1"
},
"sourcePlatform": "6.1.0",
"sourceApplication": {
- "id": 3,
- "commit": "commit1",
+ "build": 3,
"compileVersion": "6.1.0",
- "sourceUrl": "repository1/tree/commit1"
+ "sourceUrl": "repository1/tree/commit1",
+ "commit": "commit1"
}
}
}
@@ -811,17 +915,17 @@
"versions": {
"targetPlatform": "6.1.0",
"targetApplication": {
- "id": 2,
- "commit": "commit1",
+ "build": 2,
"compileVersion": "6.1.0",
- "sourceUrl": "repository1/tree/commit1"
+ "sourceUrl": "repository1/tree/commit1",
+ "commit": "commit1"
},
"sourcePlatform": "6.1.0",
"sourceApplication": {
- "id": 2,
- "commit": "commit1",
+ "build": 2,
"compileVersion": "6.1.0",
- "sourceUrl": "repository1/tree/commit1"
+ "sourceUrl": "repository1/tree/commit1",
+ "commit": "commit1"
}
},
"steps": [
@@ -860,17 +964,17 @@
"versions": {
"targetPlatform": "6.1.0",
"targetApplication": {
- "id": 1,
- "commit": "commit1",
+ "build": 1,
"compileVersion": "6.1.0",
- "sourceUrl": "repository1/tree/commit1"
+ "sourceUrl": "repository1/tree/commit1",
+ "commit": "commit1"
},
"sourcePlatform": "6.1.0",
"sourceApplication": {
- "id": 1,
- "commit": "commit1",
+ "build": 1,
"compileVersion": "6.1.0",
- "sourceUrl": "repository1/tree/commit1"
+ "sourceUrl": "repository1/tree/commit1",
+ "commit": "commit1"
}
},
"steps": [
@@ -915,27 +1019,27 @@
"region": "prod.us-west-1",
"currentPlatform": "6.1.0",
"currentApplication": {
- "id": 2,
- "commit": "commit1",
+ "build": 2,
"compileVersion": "6.1.0",
- "sourceUrl": "repository1/tree/commit1"
+ "sourceUrl": "repository1/tree/commit1",
+ "commit": "commit1"
},
"toRun": [
{
"versions": {
"targetPlatform": "6.1.0",
"targetApplication": {
- "id": 3,
- "commit": "commit1",
+ "build": 3,
"compileVersion": "6.1.0",
- "sourceUrl": "repository1/tree/commit1"
+ "sourceUrl": "repository1/tree/commit1",
+ "commit": "commit1"
},
"sourcePlatform": "6.1.0",
"sourceApplication": {
- "id": 2,
- "commit": "commit1",
+ "build": 2,
"compileVersion": "6.1.0",
- "sourceUrl": "repository1/tree/commit1"
+ "sourceUrl": "repository1/tree/commit1",
+ "commit": "commit1"
}
}
}
@@ -950,17 +1054,17 @@
"versions": {
"targetPlatform": "6.1.0",
"targetApplication": {
- "id": 2,
- "commit": "commit1",
+ "build": 2,
"compileVersion": "6.1.0",
- "sourceUrl": "repository1/tree/commit1"
+ "sourceUrl": "repository1/tree/commit1",
+ "commit": "commit1"
},
"sourcePlatform": "6.1.0",
"sourceApplication": {
- "id": 1,
- "commit": "commit1",
+ "build": 1,
"compileVersion": "6.1.0",
- "sourceUrl": "repository1/tree/commit1"
+ "sourceUrl": "repository1/tree/commit1",
+ "commit": "commit1"
}
},
"steps": [
@@ -987,10 +1091,10 @@
"versions": {
"targetPlatform": "6.1.0",
"targetApplication": {
- "id": 1,
- "commit": "commit1",
+ "build": 1,
"compileVersion": "6.1.0",
- "sourceUrl": "repository1/tree/commit1"
+ "sourceUrl": "repository1/tree/commit1",
+ "commit": "commit1"
}
},
"steps": [
@@ -1023,27 +1127,27 @@
"region": "prod.us-east-3",
"currentPlatform": "6.1.0",
"currentApplication": {
- "id": 1,
- "commit": "commit1",
+ "build": 1,
"compileVersion": "6.1.0",
- "sourceUrl": "repository1/tree/commit1"
+ "sourceUrl": "repository1/tree/commit1",
+ "commit": "commit1"
},
"toRun": [
{
"versions": {
"targetPlatform": "6.1.0",
"targetApplication": {
- "id": 3,
- "commit": "commit1",
+ "build": 3,
"compileVersion": "6.1.0",
- "sourceUrl": "repository1/tree/commit1"
+ "sourceUrl": "repository1/tree/commit1",
+ "commit": "commit1"
},
"sourcePlatform": "6.1.0",
"sourceApplication": {
- "id": 1,
- "commit": "commit1",
+ "build": 1,
"compileVersion": "6.1.0",
- "sourceUrl": "repository1/tree/commit1"
+ "sourceUrl": "repository1/tree/commit1",
+ "commit": "commit1"
}
}
}
@@ -1058,17 +1162,17 @@
"versions": {
"targetPlatform": "6.1.0",
"targetApplication": {
- "id": 2,
- "commit": "commit1",
+ "build": 2,
"compileVersion": "6.1.0",
- "sourceUrl": "repository1/tree/commit1"
+ "sourceUrl": "repository1/tree/commit1",
+ "commit": "commit1"
},
"sourcePlatform": "6.1.0",
"sourceApplication": {
- "id": 1,
- "commit": "commit1",
+ "build": 1,
"compileVersion": "6.1.0",
- "sourceUrl": "repository1/tree/commit1"
+ "sourceUrl": "repository1/tree/commit1",
+ "commit": "commit1"
}
},
"steps": [
@@ -1095,10 +1199,10 @@
"versions": {
"targetPlatform": "6.1.0",
"targetApplication": {
- "id": 1,
- "commit": "commit1",
+ "build": 1,
"compileVersion": "6.1.0",
- "sourceUrl": "repository1/tree/commit1"
+ "sourceUrl": "repository1/tree/commit1",
+ "commit": "commit1"
}
},
"steps": [
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/deployment-overview.json b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/deployment-overview.json
index 027cca5dad2..e75ebc923bd 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/deployment-overview.json
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/deployment-overview.json
@@ -6,19 +6,47 @@
"type": "instance",
"dependencies": [],
"declared": true,
- "instance": "instance1"
+ "instance": "instance1",
+ "readyAt": 0,
+ "deploying": {
+ "application": {
+ "build": 4,
+ "compileVersion": "6.1.0",
+ "sourceUrl": "repository1/tree/commit1",
+ "commit": "commit1"
+ }
+ },
+ "latestVersions": {
+ "platform": {
+ "platform": "6.1.0",
+ "at": "(ignore)",
+ "upgrade": false,
+ "blockers": []
+ },
+ "application": {
+ "application": {
+ "build": 4,
+ "compileVersion": "6.1.0",
+ "sourceUrl": "repository1/tree/commit1",
+ "commit": "commit1"
+ },
+ "at": 1000,
+ "upgrade": false,
+ "blockers": []
+ }
+ }
},
{
"type": "test",
"dependencies": [],
"declared": false,
"instance": "instance1",
+ "readyAt": 0,
"jobName": "system-test",
"url": "http://localhost:8080/application/v4/tenant/tenant1/application/application1/instance/instance1/job/system-test",
"environment": "test",
"region": "test.us-east-1",
"toRun": [],
- "readyAt": 0,
"runs": [
{
"id": 2,
@@ -28,10 +56,10 @@
"versions": {
"targetPlatform": "6.1.0",
"targetApplication": {
- "id": 4,
- "commit": "commit1",
+ "build": 4,
"compileVersion": "6.1.0",
- "sourceUrl": "repository1/tree/commit1"
+ "sourceUrl": "repository1/tree/commit1",
+ "commit": "commit1"
}
},
"steps": [
@@ -86,10 +114,10 @@
"versions": {
"targetPlatform": "6.1.0",
"targetApplication": {
- "id": 1,
- "commit": "commit1",
+ "build": 1,
"compileVersion": "6.1.0",
- "sourceUrl": "repository1/tree/commit1"
+ "sourceUrl": "repository1/tree/commit1",
+ "commit": "commit1"
}
},
"steps": [
@@ -142,12 +170,12 @@
"dependencies": [],
"declared": false,
"instance": "instance1",
+ "readyAt": 0,
"jobName": "staging-test",
"url": "http://localhost:8080/application/v4/tenant/tenant1/application/application1/instance/instance1/job/staging-test",
"environment": "staging",
"region": "staging.us-east-3",
"toRun": [],
- "readyAt": 0,
"runs": [
{
"id": 2,
@@ -157,10 +185,10 @@
"versions": {
"targetPlatform": "6.1.0",
"targetApplication": {
- "id": 4,
- "commit": "commit1",
+ "build": 4,
"compileVersion": "6.1.0",
- "sourceUrl": "repository1/tree/commit1"
+ "sourceUrl": "repository1/tree/commit1",
+ "commit": "commit1"
}
},
"steps": [
@@ -231,10 +259,10 @@
"versions": {
"targetPlatform": "6.1.0",
"targetApplication": {
- "id": 1,
- "commit": "commit1",
+ "build": 1,
"compileVersion": "6.1.0",
- "sourceUrl": "repository1/tree/commit1"
+ "sourceUrl": "repository1/tree/commit1",
+ "commit": "commit1"
}
},
"steps": [
@@ -314,10 +342,10 @@
"versions": {
"targetPlatform": "6.1.0",
"targetApplication": {
- "id": 4,
- "commit": "commit1",
+ "build": 4,
"compileVersion": "6.1.0",
- "sourceUrl": "repository1/tree/commit1"
+ "sourceUrl": "repository1/tree/commit1",
+ "commit": "commit1"
}
}
}
@@ -332,10 +360,10 @@
"versions": {
"targetPlatform": "6.1.0",
"targetApplication": {
- "id": 1,
- "commit": "commit1",
+ "build": 1,
"compileVersion": "6.1.0",
- "sourceUrl": "repository1/tree/commit1"
+ "sourceUrl": "repository1/tree/commit1",
+ "commit": "commit1"
}
},
"steps": [
@@ -371,10 +399,10 @@
"versions": {
"targetPlatform": "6.1.0",
"targetApplication": {
- "id": 4,
- "commit": "commit1",
+ "build": 4,
"compileVersion": "6.1.0",
- "sourceUrl": "repository1/tree/commit1"
+ "sourceUrl": "repository1/tree/commit1",
+ "commit": "commit1"
}
}
}
@@ -388,9 +416,9 @@
"versions": {
"targetPlatform": "6.1.0",
"targetApplication": {
- "id": 1,
- "commit": "commit1",
- "sourceUrl": "repository1/tree/commit1"
+ "build": 1,
+ "sourceUrl": "repository1/tree/commit1",
+ "commit": "commit1"
}
},
"steps": [
@@ -426,10 +454,10 @@
"versions": {
"targetPlatform": "6.1.0",
"targetApplication": {
- "id": 4,
- "commit": "commit1",
+ "build": 4,
"compileVersion": "6.1.0",
- "sourceUrl": "repository1/tree/commit1"
+ "sourceUrl": "repository1/tree/commit1",
+ "commit": "commit1"
}
}
}
@@ -443,10 +471,10 @@
"versions": {
"targetPlatform": "6.1.0",
"targetApplication": {
- "id": 1,
- "commit": "commit1",
+ "build": 1,
"compileVersion": "6.1.0",
- "sourceUrl": "repository1/tree/commit1"
+ "sourceUrl": "repository1/tree/commit1",
+ "commit": "commit1"
}
},
"steps": [
@@ -473,19 +501,39 @@
5
],
"declared": true,
- "instance": "instance2"
+ "instance": "instance2",
+ "deploying": {},
+ "latestVersions": {
+ "platform": {
+ "platform": "6.1.0",
+ "at": "(ignore)",
+ "upgrade": false,
+ "blockers": []
+ },
+ "application": {
+ "application": {
+ "build": 4,
+ "compileVersion": "6.1.0",
+ "sourceUrl": "repository1/tree/commit1",
+ "commit": "commit1"
+ },
+ "at": 1000,
+ "upgrade": false,
+ "blockers": []
+ }
+ }
},
{
"type": "test",
"dependencies": [],
"declared": false,
"instance": "instance2",
+ "readyAt": 0,
"jobName": "system-test",
"url": "http://localhost:8080/application/v4/tenant/tenant1/application/application1/instance/instance2/job/system-test",
"environment": "test",
"region": "test.us-east-1",
"toRun": [],
- "readyAt": 0,
"runs": []
},
{
@@ -493,12 +541,12 @@
"dependencies": [],
"declared": false,
"instance": "instance2",
+ "readyAt": 0,
"jobName": "staging-test",
"url": "http://localhost:8080/application/v4/tenant/tenant1/application/application1/instance/instance2/job/staging-test",
"environment": "staging",
"region": "staging.us-east-3",
"toRun": [],
- "readyAt": 0,
"runs": []
},
{
@@ -517,10 +565,10 @@
"versions": {
"targetPlatform": "6.1.0",
"targetApplication": {
- "id": 4,
- "commit": "commit1",
+ "build": 4,
"compileVersion": "6.1.0",
- "sourceUrl": "repository1/tree/commit1"
+ "sourceUrl": "repository1/tree/commit1",
+ "commit": "commit1"
}
}
}
@@ -543,10 +591,10 @@
"versions": {
"targetPlatform": "6.1.0",
"targetApplication": {
- "id": 4,
- "commit": "commit1",
+ "build": 4,
"compileVersion": "6.1.0",
- "sourceUrl": "repository1/tree/commit1"
+ "sourceUrl": "repository1/tree/commit1",
+ "commit": "commit1"
}
}
}
@@ -569,10 +617,10 @@
"versions": {
"targetPlatform": "6.1.0",
"targetApplication": {
- "id": 4,
- "commit": "commit1",
+ "build": 4,
"compileVersion": "6.1.0",
- "sourceUrl": "repository1/tree/commit1"
+ "sourceUrl": "repository1/tree/commit1",
+ "commit": "commit1"
}
}
}