diff options
author | Valerij Fredriksen <freva@users.noreply.github.com> | 2023-09-06 10:35:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-06 10:35:51 +0200 |
commit | 74898adfbe08a2374831f1a4f0eead4b31b3a1b1 (patch) | |
tree | 4d1b7a1e50b5224b461bec0b2c3b2b167db2e93d | |
parent | 14f6e9a535a1481a07a19ccc2daacb7e33b42e98 (diff) | |
parent | 1dc35415406440a2051ba56458bc30787573024e (diff) |
Merge pull request #28419 from vespa-engine/jonmv/deployment-view-improvements
Include message about builds being skipped when equal to the previous
4 files changed, 14 insertions, 8 deletions
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/ApplicationVersion.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/ApplicationVersion.java index 7303320a4f7..058d3c8fb07 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/ApplicationVersion.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/ApplicationVersion.java @@ -169,12 +169,12 @@ public class ApplicationVersion implements Comparable<ApplicationVersion> { return new ApplicationVersion(id, source, authorEmail, compileVersion, allowedMajor, buildTime, sourceUrl, commit, bundleHash, obsoleteAt, hasPackage, true, description, submittedAt, risk); } - /** Whether we still have the package for this revision. */ + /** Whether we have chosen to skip this version. */ public boolean shouldSkip() { return shouldSkip; } - /** Whether this revision should be deployed. */ + /** Whether this revision can be deployed. */ public boolean isDeployable() { return hasPackage && ! shouldSkip; } diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/JobController.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/JobController.java index 03489222922..5ccb59e3ebc 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/JobController.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/JobController.java @@ -591,6 +591,7 @@ public class JobController { application = application.withProjectId(projectId == -1 ? OptionalLong.empty() : OptionalLong.of(projectId)); application = application.withRevisions(revisions -> revisions.with(version.get())); application = withPrunedPackages(application, version.get().id()); + version.set(application.get().revisions().get(version.get().id())); validate(id, submission); 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 d290e52034f..982e81d92b1 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 @@ -221,7 +221,10 @@ class JobControllerApiHandlerHelper { Slime slime = new Slime(); Cursor root = slime.setObject(); ApplicationVersion submitted = jobController.submit(id, submission, projectId); - root.setString("message", "application " + submitted); + String skipped = submitted.shouldSkip() + ? "; only applying deployment spec changes, as this build is otherwise equal to the previous" + : ""; + root.setString("message", "application " + submitted + skipped); root.setLong("build", submitted.buildNumber()); return new SlimeJsonResponse(slime); } diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiTest.java index d3386a3a2ad..ab70dfd6073 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiTest.java +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiTest.java @@ -919,10 +919,11 @@ public class ApplicationApiTest extends ControllerContainerTest { // Fifth attempt has the right content hash in a header, and succeeds. MultiPartStreamer streamer = createApplicationSubmissionData(packageWithService, 123); tester.assertResponse(request("/application/v4/tenant/tenant1/application/application1/instance/instance1/submit", POST) - .screwdriverIdentity(SCREWDRIVER_ID) - .header("X-Content-Hash", Base64.getEncoder().encodeToString(Signatures.sha256Digest(streamer::data))) - .data(streamer), - "{\"message\":\"application build 3, source revision of repository 'repository1', branch 'master' with commit 'commit1', by a@b, built against 6.1 at 1970-01-01T00:00:01Z\",\"build\":3}"); + .screwdriverIdentity(SCREWDRIVER_ID) + .header("X-Content-Hash", Base64.getEncoder().encodeToString(Signatures.sha256Digest(streamer::data))) + .data(streamer), + """ + {"message":"application build 3, source revision of repository 'repository1', branch 'master' with commit 'commit1', by a@b, built against 6.1 at 1970-01-01T00:00:01Z; only applying deployment spec changes, as this build is otherwise equal to the previous","build":3}"""); // Sixth attempt has a multi-instance deployment spec, and is accepted. ApplicationPackage multiInstanceSpec = new ApplicationPackageBuilder() @@ -1808,7 +1809,8 @@ public class ApplicationApiTest extends ControllerContainerTest { tester.assertResponse(request("/application/v4/tenant/tenant1/application/application1/submit/", POST) .data(createApplicationSubmissionData(applicationPackageDefault, SCREWDRIVER_ID.value())) .screwdriverIdentity(SCREWDRIVER_ID), - "{\"message\":\"application build 1, source revision of repository 'repository1', branch 'master' with commit 'commit1', by a@b, built against 6.1 at 1970-01-01T00:00:01Z\",\"build\":1}", + """ + {"message":"application build 1, source revision of repository 'repository1', branch 'master' with commit 'commit1', by a@b, built against 6.1 at 1970-01-01T00:00:01Z","build":1}""", 200); } |