From b5e75aa98c4009d8c31ad784c0c302318e0c8b41 Mon Sep 17 00:00:00 2001 From: benjamin-j-powell Date: Mon, 8 Jan 2024 12:21:47 -0600 Subject: [PATCH 1/2] Add outcome to buildfinished event This commit adds the outcome enum to the buildfinished event Signed-off-by: benjamin-j-powell --- continuous-integration.md | 3 ++- examples/build_finished.json | 5 +++-- schemas/buildfinished.json | 15 ++++++++++++--- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/continuous-integration.md b/continuous-integration.md index 34daf71c..cab4c5ba 100644 --- a/continuous-integration.md +++ b/continuous-integration.md @@ -80,7 +80,7 @@ This event represents a Build task that has been started; this build process usu ### [`build finished`](examples/build_finished.json) -This event represents a Build task that has finished. This event will eventually contain the finished status, success, error or failure +This event represents a Build task that has finished and will contain the outcome of the given build. - Event Type: __`dev.cdevents.build.finished.0.1.1`__ - Predicate: finished @@ -92,6 +92,7 @@ This event represents a Build task that has finished. This event will eventually | source | `URI-Reference` | See [source](spec.md#source-subject) | | | | type | `String` | See [type](spec.md#type-subject) | | | artifactId | `Purl` | Identifier of the artifact produced by the build | `pkg:oci/myapp@sha256%3A0b31b1c02ff458ad9b7b81cbdf8f028bd54699fa151f221d1e8de6817db93427`, `pkg:golang/mygit.com/myorg/myapp@234fd47e07d1004f0aed9c` | `build` | | +| outcome | `String` | Represents the finished state of a build. | `succeeded`, `failed`, `cancelled` | | ### [`artifact packaged`](examples/artifact_packaged.json) diff --git a/examples/build_finished.json b/examples/build_finished.json index 72db1245..741a43e5 100644 --- a/examples/build_finished.json +++ b/examples/build_finished.json @@ -3,7 +3,7 @@ "version": "0.4.0-draft", "id": "271069a8-fc18-44f1-b38f-9d70a1695819", "source": "/event/source/123", - "type": "dev.cdevents.build.finished.0.1.1", + "type": "dev.cdevents.build.finished.0.1.2", "timestamp": "2023-03-20T14:27:05.315384Z" }, "subject": { @@ -11,7 +11,8 @@ "source": "/event/source/123", "type": "build", "content": { - "artifactId": "pkg:oci/myapp@sha256%3A0b31b1c02ff458ad9b7b81cbdf8f028bd54699fa151f221d1e8de6817db93427" + "artifactId": "pkg:oci/myapp@sha256%3A0b31b1c02ff458ad9b7b81cbdf8f028bd54699fa151f221d1e8de6817db93427", + "outcome": "succeeded" } } } diff --git a/schemas/buildfinished.json b/schemas/buildfinished.json index e84ac9c4..6dd5cb43 100644 --- a/schemas/buildfinished.json +++ b/schemas/buildfinished.json @@ -20,9 +20,9 @@ "type": { "type": "string", "enum": [ - "dev.cdevents.build.finished.0.1.1" + "dev.cdevents.build.finished.0.1.2" ], - "default": "dev.cdevents.build.finished.0.1.1" + "default": "dev.cdevents.build.finished.0.1.2" }, "timestamp": { "type": "string", @@ -62,6 +62,15 @@ "properties": { "artifactId": { "type": "string" + }, + "outcome": { + "type": "string", + "minLength": 1, + "enum": [ + "succeeded", + "failed", + "cancelled" + ] } }, "additionalProperties": false, @@ -97,4 +106,4 @@ "context", "subject" ] -} \ No newline at end of file +} From de39c8fe4cfea8e07f754231ea15ad7f88527ed0 Mon Sep 17 00:00:00 2001 From: benjamin-j-powell Date: Sun, 28 Jan 2024 22:13:51 -0600 Subject: [PATCH 2/2] fixup! Add outcome to buildfinished event Signed-off-by: benjamin-j-powell --- schemas/buildfinished.json | 4 ++-- schemas/pipelinerunfinished.json | 10 ++++++++-- schemas/taskrunfinished.json | 9 +++++++-- schemas/testcaserunfinished.json | 7 +++---- schemas/testsuiterunfinished.json | 8 ++++---- 5 files changed, 24 insertions(+), 14 deletions(-) diff --git a/schemas/buildfinished.json b/schemas/buildfinished.json index 6dd5cb43..3f9ebd17 100644 --- a/schemas/buildfinished.json +++ b/schemas/buildfinished.json @@ -20,9 +20,9 @@ "type": { "type": "string", "enum": [ - "dev.cdevents.build.finished.0.1.2" + "dev.cdevents.build.finished.0.1.2-draft" ], - "default": "dev.cdevents.build.finished.0.1.2" + "default": "dev.cdevents.build.finished.0.1.2-draft" }, "timestamp": { "type": "string", diff --git a/schemas/pipelinerunfinished.json b/schemas/pipelinerunfinished.json index b63e1210..287f846b 100644 --- a/schemas/pipelinerunfinished.json +++ b/schemas/pipelinerunfinished.json @@ -67,7 +67,13 @@ "type": "string" }, "outcome": { - "type": "string" + "type": "string", + "minLength": 1, + "enum": [ + "passed", + "failed", + "cancelled" + ] }, "errors": { "type": "string" @@ -106,4 +112,4 @@ "context", "subject" ] -} \ No newline at end of file +} diff --git a/schemas/taskrunfinished.json b/schemas/taskrunfinished.json index 5e6b547e..03286ace 100644 --- a/schemas/taskrunfinished.json +++ b/schemas/taskrunfinished.json @@ -85,7 +85,12 @@ ] }, "outcome": { - "type": "string" + "type": "string", + "enum": [ + "succeeded", + "failed", + "cancelled" + ] }, "errors": { "type": "string" @@ -124,4 +129,4 @@ "context", "subject" ] -} \ No newline at end of file +} diff --git a/schemas/testcaserunfinished.json b/schemas/testcaserunfinished.json index 47da6948..52c9e34a 100644 --- a/schemas/testcaserunfinished.json +++ b/schemas/testcaserunfinished.json @@ -60,10 +60,9 @@ "outcome": { "type": "string", "enum": [ - "pass", - "fail", - "cancel", - "error" + "passed", + "failed", + "cancelled" ] }, "severity": { diff --git a/schemas/testsuiterunfinished.json b/schemas/testsuiterunfinished.json index 29049fd3..c709d57d 100644 --- a/schemas/testsuiterunfinished.json +++ b/schemas/testsuiterunfinished.json @@ -100,11 +100,11 @@ }, "outcome": { "type": "string", + "minLength": 1, "enum": [ - "pass", - "fail", - "cancel", - "error" + "passed", + "failed", + "cancelled" ] }, "severity": {