diff options
author | Jon Bratseth <bratseth@yahoo-inc.com> | 2017-10-29 16:10:01 +0100 |
---|---|---|
committer | Jon Bratseth <bratseth@yahoo-inc.com> | 2017-10-29 16:10:01 +0100 |
commit | 15ada5729e316e2042bc9a8dda7975e05efa8626 (patch) | |
tree | e8b738ed6406d541250f69b91f4b8f822f1d3b6b /controller-server | |
parent | ceed02d4656b3575b9b68ccd44e92419eccd577c (diff) |
Return job id and reason in application/v4
Diffstat (limited to 'controller-server')
3 files changed, 48 insertions, 0 deletions
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 6ae9761b305..a6d9f4c5d33 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 @@ -957,8 +957,10 @@ public class ApplicationApiHandler extends LoggingRequestHandler { } private void toSlime(JobStatus.JobRun jobRun, Cursor object) { + object.setLong("id", jobRun.id()); object.setString("version", jobRun.version().toFullString()); jobRun.revision().ifPresent(revision -> toSlime(revision, object.setObject("revision"))); + object.setString("reason", jobRun.reason()); object.setLong("at", jobRun.at().toEpochMilli()); } diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/application-without-change-multiple-deployments.json b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/application-without-change-multiple-deployments.json index a82bdaa454a..fe9c373b7d5 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/application-without-change-multiple-deployments.json +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/application-without-change-multiple-deployments.json @@ -4,11 +4,15 @@ "type": "component", "success": true, "lastCompleted": { + "id": 42, "version": "(ignore)", + "reason": "Application commit", "at": "(ignore)" }, "lastSuccess": { + "id": 42, "version": "(ignore)", + "reason": "Application commit", "at": "(ignore)" } }, @@ -16,6 +20,7 @@ "type": "system-test", "success": true, "lastTriggered": { + "id": -1, "version": "(ignore)", "revision": { "hash": "(ignore)", @@ -25,9 +30,11 @@ "gitCommit": "commit1" } }, + "reason": "component completed successfully in build 42", "at": "(ignore)" }, "lastCompleted": { + "id": 42, "version": "(ignore)", "revision": { "hash": "(ignore)", @@ -37,9 +44,11 @@ "gitCommit": "commit1" } }, + "reason": "component completed successfully in build 42", "at": "(ignore)" }, "lastSuccess": { + "id": 42, "version": "(ignore)", "revision": { "hash": "(ignore)", @@ -49,6 +58,7 @@ "gitCommit": "commit1" } }, + "reason": "component completed successfully in build 42", "at": "(ignore)" } }, @@ -56,6 +66,7 @@ "type": "staging-test", "success": true, "lastTriggered": { + "id": -1, "version": "(ignore)", "revision": { "hash": "(ignore)", @@ -65,9 +76,11 @@ "gitCommit": "commit1" } }, + "reason":"systemTest completed successfully in build 42", "at": "(ignore)" }, "lastCompleted": { + "id": 42, "version": "(ignore)", "revision": { "hash": "(ignore)", @@ -77,9 +90,11 @@ "gitCommit": "commit1" } }, + "reason":"systemTest completed successfully in build 42", "at": "(ignore)" }, "lastSuccess": { + "id": 42, "version": "(ignore)", "revision": { "hash": "(ignore)", @@ -89,6 +104,7 @@ "gitCommit": "commit1" } }, + "reason":"systemTest completed successfully in build 42", "at": "(ignore)" } }, @@ -96,6 +112,7 @@ "type": "production-us-west-1", "success": true, "lastTriggered": { + "id": -1, "version": "(ignore)", "revision": { "hash": "(ignore)", @@ -105,9 +122,11 @@ "gitCommit": "commit1" } }, + "reason":"stagingTest completed successfully in build 42", "at": "(ignore)" }, "lastCompleted": { + "id": 42, "version": "(ignore)", "revision": { "hash": "(ignore)", @@ -117,9 +136,11 @@ "gitCommit": "commit1" } }, + "reason":"stagingTest completed successfully in build 42", "at": "(ignore)" }, "lastSuccess": { + "id": 42, "version": "(ignore)", "revision": { "hash": "(ignore)", @@ -129,6 +150,7 @@ "gitCommit": "commit1" } }, + "reason":"stagingTest completed successfully in build 42", "at": "(ignore)" } }, @@ -136,6 +158,7 @@ "type": "production-us-east-3", "success": true, "lastTriggered": { + "id": -1, "version": "(ignore)", "revision": { "hash": "(ignore)", @@ -145,9 +168,11 @@ "gitCommit": "commit1" } }, + "reason":"productionUsWest1 completed successfully in build 42", "at": "(ignore)" }, "lastCompleted": { + "id": 42, "version": "(ignore)", "revision": { "hash": "(ignore)", @@ -157,9 +182,11 @@ "gitCommit": "commit1" } }, + "reason":"productionUsWest1 completed successfully in build 42", "at": "(ignore)" }, "lastSuccess": { + "id": 42, "version": "(ignore)", "revision": { "hash": "(ignore)", @@ -169,6 +196,7 @@ "gitCommit": "commit1" } }, + "reason":"productionUsWest1 completed successfully in build 42", "at": "(ignore)" } } diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/application.json b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/application.json index cc17e76642f..3dca8103ed7 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/application.json +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/application.json @@ -7,6 +7,7 @@ "type": "system-test", "success": true, "lastTriggered": { + "id": -1, "version": "(ignore)", "revision": { "hash": "(ignore)", @@ -16,9 +17,11 @@ "gitCommit": "commit1" } }, + "reason": "", "at": "(ignore)" }, "lastCompleted": { + "id": 42, "version": "(ignore)", "revision": { "hash": "(ignore)", @@ -28,9 +31,11 @@ "gitCommit": "commit1" } }, + "reason": "", "at": "(ignore)" }, "lastSuccess": { + "id": 42, "version": "(ignore)", "revision": { "hash": "(ignore)", @@ -40,6 +45,7 @@ "gitCommit": "commit1" } }, + "reason": "", "at": "(ignore)" } }, @@ -47,6 +53,7 @@ "type": "staging-test", "success": true, "lastTriggered": { + "id": -1, "version": "(ignore)", "revision": { "hash": "(ignore)", @@ -56,9 +63,11 @@ "gitCommit": "commit1" } }, + "reason": "systemTest completed successfully in build 42", "at": "(ignore)" }, "lastCompleted": { + "id": 42, "version": "(ignore)", "revision": { "hash": "(ignore)", @@ -68,9 +77,11 @@ "gitCommit": "commit1" } }, + "reason": "systemTest completed successfully in build 42", "at": "(ignore)" }, "lastSuccess": { + "id": 42, "version": "(ignore)", "revision": { "hash": "(ignore)", @@ -80,6 +91,7 @@ "gitCommit": "commit1" } }, + "reason": "systemTest completed successfully in build 42", "at": "(ignore)" } }, @@ -87,6 +99,7 @@ "type": "production-corp-us-east-1", "success": false, "lastTriggered": { + "id": -1, "version": "(ignore)", "revision": { "hash": "(ignore)", @@ -96,9 +109,11 @@ "gitCommit": "commit1" } }, + "reason": "Retrying as build 42 just started failing", "at": "(ignore)" }, "lastCompleted": { + "id": 42, "version": "(ignore)", "revision": { "hash": "(ignore)", @@ -108,9 +123,11 @@ "gitCommit": "commit1" } }, + "reason": "stagingTest completed successfully in build 42", "at": "(ignore)" }, "firstFailing": { + "id": 42, "version": "(ignore)", "revision": { "hash": "(ignore)", @@ -120,6 +137,7 @@ "gitCommit": "commit1" } }, + "reason": "stagingTest completed successfully in build 42", "at": "(ignore)" } } |