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
Open
xibz
wants to merge
2
commits into
cdevents:main
Choose a base branch
from
xibz:deployment
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| { | ||
| "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-draft", | ||
| "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", | ||
| "tier": "production", | ||
| "outcome": "success" | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| { | ||
| "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-draft", | ||
| "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", | ||
| "tier": "production" | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| { | ||
| "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-draft", | ||
| "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", | ||
| "tier": "production" | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 an artifact 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.", | ||
| "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`)" | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| { | ||
| "$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 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)" | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| { | ||
| "$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 pipeline run waiting in a queue before a worker picks it up" | ||
| ], | ||
| "counterExamples": [ | ||
| "Active execution of the entity", | ||
| "Completion or failure of the entity" | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| { | ||
| "$id": "cdevents/_defs/tier", | ||
| "term": "Tier", | ||
| "definition": "A Tier is the logical environment a deployment targets, such as production or staging, independent of the physical infrastructure it runs on. Tier is the value consumers compare across producers to compute delivery metrics such as lead time to deploy: a change is considered delivered when it is deployed to the production tier.", | ||
| "notes": [ | ||
| "Tier is what is commonly meant by \"environment\" (production, staging). It has its own name because the `environment` subject is defined as a platform, and is commonly used to mean a specific cluster", | ||
| "A Tier names a stage in the delivery path, not a place: a single tier is typically backed by many clusters, regions or slots", | ||
| "Tier is distinct from the `environment` subject, which producers commonly use to describe a specific platform or cluster", | ||
| "Producers should use the same tier values for the same stage across all of their deployments, so that consumers can compare them" | ||
| ], | ||
| "examples": [ | ||
| "production", | ||
| "staging", | ||
| "development" | ||
| ], | ||
| "counterExamples": [ | ||
| "A Kubernetes cluster such as prod-us-east-1", | ||
| "A cloud region such as us-east-1", | ||
| "A namespace or blue/green slot" | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,129 @@ | ||
| { | ||
| "$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-draft" | ||
| ], | ||
| "default": "dev.cdevents.deployment.finished.0.1.0-draft" | ||
| }, | ||
| "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 | ||
| }, | ||
| "tier": { | ||
| "type": "string", | ||
| "minLength": 1 | ||
| }, | ||
| "outcome": { | ||
| "type": "string", | ||
| "enum": [ | ||
| "success", | ||
| "failure", | ||
| "cancel", | ||
| "error" | ||
| ] | ||
| }, | ||
| "errors": { | ||
| "type": "string" | ||
| } | ||
| }, | ||
| "additionalProperties": false, | ||
| "type": "object", | ||
| "required": [ | ||
| "artifactId", | ||
| "tier", | ||
| "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" | ||
| ] | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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