Skip to content

Commit 0073c74

Browse files
committed
feat: add semantic _defs and link from schemas
Introduce initial opinionated semantic definitions under `_defs` and reference them from event schemas. Definitions are versioned alongside schemas, allowing terminology to evolve explicitly if scope or meaning changes in future CDEvents revisions. Signed-off-by: xibz <bjp@apple.com>
1 parent 3fe839d commit 0073c74

5 files changed

Lines changed: 67 additions & 1 deletion

File tree

.github/linters/.eslintrc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ overrides:
1515
- error
1616
- camelCase: true
1717
snake_case: false
18+
ignores:
19+
- "^x-"
1820
jsonc/key-spacing:
1921
- error
2022
jsonc/no-dupe-keys:

schemas/_defs/artifact.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"$id": "cdevents/_defs/artifact",
3+
"term": "Artifact",
4+
"definition": "A versioned, immutable output of a build or packaging process that represents a deliverable unit intended for consumption by downstream systems.",
5+
"notes": [],
6+
"examples": [
7+
"A container image produced by a CI pipeline",
8+
"A compiled binary packaged for release",
9+
"A versioned deployment bundle generated from source"
10+
],
11+
"counterExamples": [
12+
"Source code repositories or branches",
13+
"Intermediate or temporary build outputs",
14+
"Logs, metrics, or diagnostic data",
15+
"Configuration files not intended for distribution",
16+
"Runtime state or dynamically generated data"
17+
]
18+
}
19+

schemas/_defs/pipelinerun.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"$id": "cdevents/_defs/pipelinerun",
3+
"term": "PipelineRun",
4+
"definition": "A PipelineRun is a concrete invocation of a pipeline definition, representing one complete attempt to execute that pipeline’s workflow from start to termination.",
5+
"notes": [
6+
"A PipelineRun is not a pipeline definition",
7+
"A PipelineRun may fail, succeed, or be aborted"
8+
],
9+
"examples": [
10+
"Tekton PipelineRun",
11+
"GitHub Actions workflow run",
12+
"Spinnaker pipeline execution"
13+
],
14+
"counterExamples": [
15+
"Pipeline templates",
16+
"Reusable pipeline graphs"
17+
]
18+
}
19+

schemas/_defs/started.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"$id": "cdevents/_defs/started",
3+
"term": "Started",
4+
"definition": "Indicates that execution of an entity has begun and that the system has committed to performing the associated work.",
5+
"notes": [
6+
"A started event does not imply successful execution or completion.",
7+
"The associated execution may still fail, be canceled, or terminate early."
8+
],
9+
"examples": [
10+
"A pipeline run entering its first execution step",
11+
"A task beginning execution on a worker",
12+
"A deployment process initiating rollout"
13+
],
14+
"counterExamples": [
15+
"Scheduling or queuing of work",
16+
"Validation or pre-flight checks",
17+
"Completion of execution",
18+
"Failure or cancellation outcomes",
19+
"Progress or intermediate execution states"
20+
]
21+
}
22+

schemas/pipelinerunstarted.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
{
22
"$schema": "https://json-schema.org/draft/2020-12/schema",
33
"$id": "https://cdevents.dev/0.6.0-draft/schema/pipelinerun-started-event",
4+
"x-cdevents-semantics": {
5+
"subject": "cdevents/_defs/pipelinerun",
6+
"predicate": "cdevents/_defs/started"
7+
},
48
"properties": {
59
"context": {
610
"properties": {
@@ -108,4 +112,4 @@
108112
"context",
109113
"subject"
110114
]
111-
}
115+
}

0 commit comments

Comments
 (0)