Repository navigation
feat(deployment): add deployment subject and queued/started/finished events #319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| { | ||
| "context": { | ||
| "specversion": "0.6.0-draft", | ||
| "id": "271069a8-fc18-44f1-b38f-9d70a1695819", | ||
| "chainId": "4c8cb7dd-3448-41de-8768-eec704e2829b", | ||
| "source": "/event/source/123", | ||
| "type": "dev.cdevents.deployment.finished.0.1.0", | ||
| "timestamp": "2023-03-20T14:27:05.315384Z", | ||
| "schemaUri": "https://myorg.com/schema/custom" | ||
| }, | ||
| "subject": { | ||
| "id": "mySubject123", | ||
| "source": "/event/source/123", | ||
| "content": { | ||
| "artifactId": "pkg:oci/myapp@sha256%3A0b31b1c02ff458ad9b7b81cbdf8f028bd54699fa151f221d1e8de6817db93427", | ||
| "environment": { | ||
| "id": "test123" | ||
| }, | ||
| "outcome": "success" | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| { | ||
| "context": { | ||
| "specversion": "0.6.0-draft", | ||
| "id": "271069a8-fc18-44f1-b38f-9d70a1695819", | ||
| "chainId": "4c8cb7dd-3448-41de-8768-eec704e2829b", | ||
| "source": "/event/source/123", | ||
| "type": "dev.cdevents.deployment.queued.0.1.0", | ||
| "timestamp": "2023-03-20T14:27:05.315384Z", | ||
| "schemaUri": "https://myorg.com/schema/custom" | ||
| }, | ||
| "subject": { | ||
| "id": "mySubject123", | ||
| "source": "/event/source/123", | ||
| "content": { | ||
| "artifactId": "pkg:oci/myapp@sha256%3A0b31b1c02ff458ad9b7b81cbdf8f028bd54699fa151f221d1e8de6817db93427", | ||
| "environment": { | ||
| "id": "test123" | ||
| } | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| { | ||
| "context": { | ||
| "specversion": "0.6.0-draft", | ||
| "id": "271069a8-fc18-44f1-b38f-9d70a1695819", | ||
| "chainId": "4c8cb7dd-3448-41de-8768-eec704e2829b", | ||
| "source": "/event/source/123", | ||
| "type": "dev.cdevents.deployment.started.0.1.0", | ||
| "timestamp": "2023-03-20T14:27:05.315384Z", | ||
| "schemaUri": "https://myorg.com/schema/custom" | ||
| }, | ||
| "subject": { | ||
| "id": "mySubject123", | ||
| "source": "/event/source/123", | ||
| "content": { | ||
| "artifactId": "pkg:oci/myapp@sha256%3A0b31b1c02ff458ad9b7b81cbdf8f028bd54699fa151f221d1e8de6817db93427", | ||
| "environment": { | ||
| "id": "test123" | ||
| } | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| { | ||
| "$id": "cdevents/_defs/deployment", | ||
| "term": "Deployment", | ||
| "definition": "A Deployment is the act of applying a version of a release unit to an environment. It may be carried out by an automated CD pipeline or as a single manual action, such as a one-off `kubectl apply`; a Deployment does not require an orchestrator or pipeline to exist. A Deployment is that act and its outcome only, not the pipeline or tool that performed it, and not the resulting state of the running service, which the `service` subject describes separately.", | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "orchestrator" needs to be added to the dictionary
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. NIT: "release unit" is used in a few places but is not defined anywhere |
||
| "notes": [ | ||
| "A Deployment is not the pipeline or tooling that executed it", | ||
| "A Deployment does not require an orchestrator or CD pipeline to exist; a single manual action, such as a one-off `kubectl apply`, is still a deployment", | ||
| "deployment separates the act of deploying (this subject) from the entity fact of a running service (`service`), mirroring the build/artifact split in CI" | ||
| ], | ||
| "examples": [ | ||
| "Deploying myapp v1.2.3 to the production environment", | ||
| "A Spinnaker pipeline execution that rolls out a service to a Kubernetes cluster", | ||
| "A developer manually running `kubectl apply -f deploy.yaml` and reporting the outcome, with no CD pipeline involved" | ||
| ], | ||
| "counterExamples": [ | ||
| "The pipeline that performed the deployment", | ||
| "The resulting running state of the service (that is `service`)" | ||
| ] | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| { | ||
| "$id": "cdevents/_defs/finished", | ||
| "term": "Finished", | ||
| "definition": "Indicates that execution of an entity has ended, regardless of outcome. The outcome field on the event conveys whether execution succeeded or failed.", | ||
| "notes": [ | ||
| "A finished event does not imply successful execution.", | ||
| "The outcome field must be inspected to determine success or failure.", | ||
| "A finished event is terminal — no further lifecycle events follow for this entity." | ||
| ], | ||
| "examples": [ | ||
| "A deployment completing across all target rollouts", | ||
| "A target rollout completing at its destination", | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "rollout" needs to be added to the dictionary
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, this should be dropped for now |
||
| "A pipeline run terminating with success or failure" | ||
| ], | ||
| "counterExamples": [ | ||
| "Intermediate execution states", | ||
| "Progress or partial completion signals", | ||
| "Cancellation requests (the finished event is emitted after cancellation is complete)" | ||
| ] | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| { | ||
| "$id": "cdevents/_defs/queued", | ||
| "term": "Queued", | ||
| "definition": "Indicates that an entity has been accepted and is waiting to begin execution.", | ||
| "notes": [ | ||
| "A queued event does not imply that execution has started.", | ||
| "The associated entity may be held by scheduling, resource availability, or dependencies." | ||
| ], | ||
| "examples": [ | ||
| "A deployment accepted by a deploy controller and waiting for resources", | ||
| "A target rollout scheduled but not yet executing", | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be dropped for now |
||
| "A pipeline run waiting in a queue before a worker picks it up" | ||
| ], | ||
| "counterExamples": [ | ||
| "Active execution of the entity", | ||
| "Completion or failure of the entity" | ||
| ] | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,140 @@ | ||
| { | ||
| "$schema": "https://json-schema.org/draft/2020-12/schema", | ||
| "$id": "https://cdevents.dev/0.6.0-draft/schema/deployment-finished-event", | ||
| "x-cdevents-semantics": { | ||
| "subject": "cdevents/_defs/deployment", | ||
| "predicate": "cdevents/_defs/finished" | ||
| }, | ||
| "properties": { | ||
| "context": { | ||
| "properties": { | ||
| "specversion": { | ||
| "type": "string", | ||
| "minLength": 1 | ||
| }, | ||
| "id": { | ||
| "type": "string", | ||
| "minLength": 1 | ||
| }, | ||
| "source": { | ||
| "type": "string", | ||
| "minLength": 1, | ||
| "format": "uri-reference" | ||
| }, | ||
| "type": { | ||
| "type": "string", | ||
| "enum": [ | ||
| "dev.cdevents.deployment.finished.0.1.0" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These are new events, the version should be |
||
| ], | ||
| "default": "dev.cdevents.deployment.finished.0.1.0" | ||
| }, | ||
| "timestamp": { | ||
| "type": "string", | ||
| "format": "date-time" | ||
| }, | ||
| "schemaUri": { | ||
| "type": "string", | ||
| "minLength": 1, | ||
| "format": "uri" | ||
| }, | ||
| "chainId": { | ||
| "type": "string", | ||
| "minLength": 1 | ||
| }, | ||
| "links": { | ||
| "$ref": "links/embeddedlinksarray" | ||
| } | ||
| }, | ||
| "additionalProperties": false, | ||
| "type": "object", | ||
| "required": [ | ||
| "specversion", | ||
| "id", | ||
| "source", | ||
| "type", | ||
| "timestamp" | ||
| ] | ||
| }, | ||
| "subject": { | ||
| "properties": { | ||
| "id": { | ||
| "type": "string", | ||
| "minLength": 1 | ||
| }, | ||
| "source": { | ||
| "type": "string", | ||
| "minLength": 1, | ||
| "format": "uri-reference" | ||
| }, | ||
| "content": { | ||
| "properties": { | ||
| "artifactId": { | ||
| "type": "string", | ||
| "minLength": 1 | ||
| }, | ||
| "environment": { | ||
| "properties": { | ||
| "id": { | ||
| "type": "string", | ||
| "minLength": 1 | ||
| }, | ||
| "source": { | ||
| "type": "string", | ||
| "minLength": 1, | ||
| "format": "uri-reference" | ||
| } | ||
| }, | ||
| "additionalProperties": false, | ||
| "type": "object", | ||
| "required": [ | ||
| "id" | ||
| ] | ||
| }, | ||
| "outcome": { | ||
| "type": "string", | ||
| "enum": [ | ||
| "success", | ||
| "failure", | ||
| "cancel", | ||
| "error" | ||
| ] | ||
| } | ||
| }, | ||
| "additionalProperties": false, | ||
| "type": "object", | ||
| "required": [ | ||
| "artifactId", | ||
| "environment", | ||
| "outcome" | ||
| ] | ||
| } | ||
| }, | ||
| "additionalProperties": false, | ||
| "type": "object", | ||
| "required": [ | ||
| "id", | ||
| "content" | ||
| ] | ||
| }, | ||
| "customData": { | ||
| "oneOf": [ | ||
| { | ||
| "type": "object" | ||
| }, | ||
| { | ||
| "type": "string", | ||
| "contentEncoding": "base64" | ||
| } | ||
| ] | ||
| }, | ||
| "customDataContentType": { | ||
| "type": "string" | ||
| } | ||
| }, | ||
| "additionalProperties": false, | ||
| "type": "object", | ||
| "required": [ | ||
| "context", | ||
| "subject" | ||
| ] | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT:
pipelineRunFinishedalso has anerrorsfield - we could have the same here for consistency