Skip to content

Commit

Permalink
Add outcome to buildfinished event
Browse files Browse the repository at this point in the history
This commit adds the outcome enum to the buildfinished event

Signed-off-by: benjamin-j-powell <[email protected]>
  • Loading branch information
benjamin-j-powell committed Jan 8, 2024
1 parent c7be12c commit b5e75aa
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
3 changes: 2 additions & 1 deletion continuous-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)

Expand Down
5 changes: 3 additions & 2 deletions examples/build_finished.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@
"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": {
"id": "mySubject123",
"source": "/event/source/123",
"type": "build",
"content": {
"artifactId": "pkg:oci/myapp@sha256%3A0b31b1c02ff458ad9b7b81cbdf8f028bd54699fa151f221d1e8de6817db93427"
"artifactId": "pkg:oci/myapp@sha256%3A0b31b1c02ff458ad9b7b81cbdf8f028bd54699fa151f221d1e8de6817db93427",
"outcome": "succeeded"
}
}
}
15 changes: 12 additions & 3 deletions schemas/buildfinished.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -62,6 +62,15 @@
"properties": {
"artifactId": {
"type": "string"
},
"outcome": {
"type": "string",
"minLength": 1,
"enum": [
"succeeded",
"failed",
"cancelled"
]
}
},
"additionalProperties": false,
Expand Down Expand Up @@ -97,4 +106,4 @@
"context",
"subject"
]
}
}

0 comments on commit b5e75aa

Please sign in to comment.