Skip to content

Commit

Permalink
Add an optional schemaUri to the context (#184)
Browse files Browse the repository at this point in the history
* Add an optional schemaURI to the context

Add schemaURI to the context. It can be used to link to
a custom schema that further refines the event content.

Context:
- #168
- #91

Fixes: #91

Signed-off-by: Andrea Frittoli <andrea.frittoli@gmail.com>
  • Loading branch information
afrittoli authored Mar 4, 2024
1 parent d6b6f88 commit f1aafdb
Show file tree
Hide file tree
Showing 90 changed files with 486 additions and 193 deletions.
16 changes: 8 additions & 8 deletions continuous-deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ A `service` can represent for example a binary that is running, a daemon, an app

This event represents an environment that has been created. Such an environment can be used to deploy services in.

- Event Type: __`dev.cdevents.environment.created.0.1.1`__
- Event Type: __`dev.cdevents.environment.created.0.2.0-draft`__
- Predicate: created
- Subject: [`environment`](#environment)

Expand All @@ -67,7 +67,7 @@ This event represents an environment that has been created. Such an environment

This event represents an environment that has been modified.

- Event Type: __`dev.cdevents.environment.modified.0.1.1`__
- Event Type: __`dev.cdevents.environment.modified.0.2.0-draft`__
- Predicate: modified
- Subject: [`environment`](#environment)

Expand All @@ -83,7 +83,7 @@ This event represents an environment that has been modified.

This event represents an environment that has been deleted.```

- Event Type: __`dev.cdevents.environment.deleted.0.1.1`__
- Event Type: __`dev.cdevents.environment.deleted.0.2.0-draft`__
- Predicate: deleted
- Subject: [`environment`](#environment)

Expand All @@ -98,7 +98,7 @@ This event represents an environment that has been deleted.```

This event represents a new instance of a service that has been deployed

- Event Type: __`dev.cdevents.service.deployed.0.1.1`__
- Event Type: __`dev.cdevents.service.deployed.0.2.0-draft`__
- Predicate: deployed
- Subject: [`service`](#service)

Expand All @@ -114,7 +114,7 @@ This event represents a new instance of a service that has been deployed

This event represents an existing instance of a service that has been upgraded to a new version

- Event Type: __`dev.cdevents.service.upgraded.0.1.1`__
- Event Type: __`dev.cdevents.service.upgraded.0.2.0-draft`__
- Predicate: upgraded
- Subject: [`service`](#service)

Expand All @@ -130,7 +130,7 @@ This event represents an existing instance of a service that has been upgraded t

This event represents an existing instance of a service that has been rolled back to a previous version

- Event Type: __`dev.cdevents.service.rolledback.0.1.1`__
- Event Type: __`dev.cdevents.service.rolledback.0.2.0-draft`__
- Predicate: rolledback
- Subject: [`service`](#service)

Expand All @@ -146,7 +146,7 @@ This event represents an existing instance of a service that has been rolled bac

This event represents the removal of a previously deployed service instance and is thus not longer present in the specified environment

- Event Type: __`dev.cdevents.service.removed.0.1.1`__
- Event Type: __`dev.cdevents.service.removed.0.2.0-draft`__
- Predicate: removed
- Subject: [`service`](#service)

Expand All @@ -161,7 +161,7 @@ This event represents the removal of a previously deployed service instance and

This event represents an existing instance of a service that has an accessible URL for users to interact with it. This event can be used to let other tools know that the service is ready and also available for consumption.

- Event Type: __`dev.cdevents.service.published.0.1.1`__
- Event Type: __`dev.cdevents.service.published.0.2.0-draft`__
- Predicate: published
- Subject: [`service`](#service)

Expand Down
8 changes: 4 additions & 4 deletions continuous-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ An `artifact` is usually produced as output of a build process. Events need to b

This event represents a Build task that has been queued; this build process usually is in charge of producing a binary from source code.

- Event Type: __`dev.cdevents.build.queued.0.1.1`__
- Event Type: __`dev.cdevents.build.queued.0.2.0-draft`__
- Predicate: queued
- Subject: [`build`](#build)

Expand All @@ -70,7 +70,7 @@ This event represents a Build task that has been queued; this build process usua

This event represents a Build task that has been started; this build process usually is in charge of producing a binary from source code.

- Event Type: __`dev.cdevents.build.started.0.1.1`__
- Event Type: __`dev.cdevents.build.started.0.2.0-draft`__
- Predicate: started
- Subject: [`build`](#build)

Expand All @@ -84,7 +84,7 @@ This event represents a Build task that has been started; this build process usu

This event represents a Build task that has finished. This event will eventually contain the finished status, success, error or failure

- Event Type: __`dev.cdevents.build.finished.0.1.1`__
- Event Type: __`dev.cdevents.build.finished.0.2.0-draft`__
- Predicate: finished
- Subject: [`build`](#build)

Expand Down Expand Up @@ -117,7 +117,7 @@ This event is usually produced by the build system. If an SBOM URI is available
The event represents an artifact that has been signed. The signature is included in the events itself.
An artifact may be signed after it has been packaged or sometimes after it has published, depending on the tooling being used and the type of artifact. The `artifact signed` event is typically produced by the CI or build system.

- Event Type: __`dev.cdevents.artifact.signed.0.1.0`__
- Event Type: __`dev.cdevents.artifact.signed.0.2.0-draft`__
- Predicate: signed
- Subject: [`artifact`](#artifact)

Expand Down
6 changes: 3 additions & 3 deletions continuous-operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ An `incident` represents a problem in a production environment.

This event represents an incident that has been detected by a system or human.

- Event Type: __`dev.cdevents.incident.detected.0.1.0`__
- Event Type: __`dev.cdevents.incident.detected.0.2.0-draft`__
- Predicate: detected
- Subject: [`incident`](#incident)

Expand All @@ -58,7 +58,7 @@ This event represents an incident that has been detected by a system or human.

This event represents an incident that has been reported through a ticketing system. Compared to the `detected` predicated, it introduces a ticket URI.

- Event Type: __`dev.cdevents.incident.reported.0.1.0`__
- Event Type: __`dev.cdevents.incident.reported.0.2.0-draft`__
- Predicate: reported
- Subject: [`incident`](#incident)

Expand All @@ -77,7 +77,7 @@ This event represents an incident that has been reported through a ticketing sys

This event represents an incident that has been resolved, meaning that the problem identified by the incident has been solved or recalled.

- Event Type: __`dev.cdevents.incident.resolved.0.1.0`__
- Event Type: __`dev.cdevents.incident.resolved.0.2.0-draft`__
- Predicate: resolved
- Subject: [`incident`](#incident)

Expand Down
10 changes: 5 additions & 5 deletions core.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Due the dynamic nature of Pipelines, most of actual work needs to be queued to
happen in a distributed way, hence queued events are added. Adopters can choose
to ignore these events if they don't apply to their use cases.

- Event Type: __`dev.cdevents.pipelinerun.queued.0.1.1`__
- Event Type: __`dev.cdevents.pipelinerun.queued.0.2.0-draft`__
- Predicate: queued
- Subject: [`pipelineRun`](#pipelinerun)

Expand All @@ -84,7 +84,7 @@ to ignore these events if they don't apply to their use cases.

A pipelineRun has started and it is running.

- Event Type: __`dev.cdevents.pipelinerun.started.0.1.1`__
- Event Type: __`dev.cdevents.pipelinerun.started.0.2.0-draft`__
- Predicate: started
- Subject: [`pipelineRun`](#pipelinerun)

Expand All @@ -100,7 +100,7 @@ A pipelineRun has started and it is running.

A pipelineRun has finished, successfully or not.

- Event Type: __`dev.cdevents.pipelinerun.finished.0.1.1`__
- Event Type: __`dev.cdevents.pipelinerun.finished.0.2.0-draft`__
- Predicate: finished
- Subject: [`pipelineRun`](#pipelinerun)

Expand All @@ -118,7 +118,7 @@ A pipelineRun has finished, successfully or not.

A taskRun has started and it is running.

- Event Type: __`dev.cdevents.taskrun.started.0.1.1`__
- Event Type: __`dev.cdevents.taskrun.started.0.2.0-draft`__
- Predicate: started
- Subject: [`taskRun`](#taskrun)

Expand All @@ -135,7 +135,7 @@ A taskRun has started and it is running.

A taskRun has finished, successfully or not.

- Event Type: __`dev.cdevents.taskrun.finished.0.1.1`__
- Event Type: __`dev.cdevents.taskrun.finished.0.2.0-draft`__
- Predicate: finished
- Subject: [`taskRun`](#taskrun)

Expand Down
3 changes: 2 additions & 1 deletion examples/artifact_deleted.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"id": "271069a8-fc18-44f1-b38f-9d70a1695819",
"source": "/event/source/123",
"type": "dev.cdevents.artifact.deleted.0.1.0-draft",
"timestamp": "2023-03-20T14:27:05.315384Z"
"timestamp": "2023-03-20T14:27:05.315384Z",
"schemaUri": "https://myorg.com/schema/custom"
},
"subject": {
"id": "pkg:golang/mygit.com/myorg/myapp@234fd47e07d1004f0aed9c",
Expand Down
3 changes: 2 additions & 1 deletion examples/artifact_downloaded.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"id": "271069a8-fc18-44f1-b38f-9d70a1695819",
"source": "/event/source/123",
"type": "dev.cdevents.artifact.downloaded.0.1.0-draft",
"timestamp": "2023-03-20T14:27:05.315384Z"
"timestamp": "2023-03-20T14:27:05.315384Z",
"schemaUri": "https://myorg.com/schema/custom"
},
"subject": {
"id": "pkg:golang/mygit.com/myorg/myapp@234fd47e07d1004f0aed9c",
Expand Down
3 changes: 2 additions & 1 deletion examples/artifact_packaged.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"id": "271069a8-fc18-44f1-b38f-9d70a1695819",
"source": "/event/source/123",
"type": "dev.cdevents.artifact.packaged.0.2.0-draft",
"timestamp": "2023-03-20T14:27:05.315384Z"
"timestamp": "2023-03-20T14:27:05.315384Z",
"schemaUri": "https://myorg.com/schema/custom"
},
"subject": {
"id": "pkg:golang/mygit.com/myorg/myapp@234fd47e07d1004f0aed9c",
Expand Down
3 changes: 2 additions & 1 deletion examples/artifact_published.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"id": "271069a8-fc18-44f1-b38f-9d70a1695819",
"source": "/event/source/123",
"type": "dev.cdevents.artifact.published.0.2.0-draft",
"timestamp": "2023-03-20T14:27:05.315384Z"
"timestamp": "2023-03-20T14:27:05.315384Z",
"schemaUri": "https://myorg.com/schema/custom"
},
"subject": {
"id": "pkg:golang/mygit.com/myorg/myapp@234fd47e07d1004f0aed9c",
Expand Down
5 changes: 3 additions & 2 deletions examples/artifact_signed.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
"version": "0.4.0-draft",
"id": "271069a8-fc18-44f1-b38f-9d70a1695819",
"source": "/event/source/123",
"type": "dev.cdevents.artifact.signed.0.1.0",
"timestamp": "2023-03-20T14:27:05.315384Z"
"type": "dev.cdevents.artifact.signed.0.2.0-draft",
"timestamp": "2023-03-20T14:27:05.315384Z",
"schemaUri": "https://myorg.com/schema/custom"
},
"subject": {
"id": "pkg:golang/mygit.com/myorg/myapp@234fd47e07d1004f0aed9c",
Expand Down
5 changes: 3 additions & 2 deletions examples/branch_created.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
"version": "0.4.0-draft",
"id": "271069a8-fc18-44f1-b38f-9d70a1695819",
"source": "/event/source/123",
"type": "dev.cdevents.branch.created.0.1.2",
"timestamp": "2023-03-20T14:27:05.315384Z"
"type": "dev.cdevents.branch.created.0.2.0-draft",
"timestamp": "2023-03-20T14:27:05.315384Z",
"schemaUri": "https://myorg.com/schema/custom"
},
"subject": {
"id": "mySubject123",
Expand Down
5 changes: 3 additions & 2 deletions examples/branch_deleted.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
"version": "0.4.0-draft",
"id": "271069a8-fc18-44f1-b38f-9d70a1695819",
"source": "/event/source/123",
"type": "dev.cdevents.branch.deleted.0.1.2",
"timestamp": "2023-03-20T14:27:05.315384Z"
"type": "dev.cdevents.branch.deleted.0.2.0-draft",
"timestamp": "2023-03-20T14:27:05.315384Z",
"schemaUri": "https://myorg.com/schema/custom"
},
"subject": {
"id": "mySubject123",
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,8 +3,9 @@
"version": "0.4.0-draft",
"id": "271069a8-fc18-44f1-b38f-9d70a1695819",
"source": "/event/source/123",
"type": "dev.cdevents.build.finished.0.1.1",
"timestamp": "2023-03-20T14:27:05.315384Z"
"type": "dev.cdevents.build.finished.0.2.0-draft",
"timestamp": "2023-03-20T14:27:05.315384Z",
"schemaUri": "https://myorg.com/schema/custom"
},
"subject": {
"id": "mySubject123",
Expand Down
5 changes: 3 additions & 2 deletions examples/build_queued.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
"version": "0.4.0-draft",
"id": "271069a8-fc18-44f1-b38f-9d70a1695819",
"source": "/event/source/123",
"type": "dev.cdevents.build.queued.0.1.1",
"timestamp": "2023-03-20T14:27:05.315384Z"
"type": "dev.cdevents.build.queued.0.2.0-draft",
"timestamp": "2023-03-20T14:27:05.315384Z",
"schemaUri": "https://myorg.com/schema/custom"
},
"subject": {
"id": "mySubject123",
Expand Down
5 changes: 3 additions & 2 deletions examples/build_started.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
"version": "0.4.0-draft",
"id": "271069a8-fc18-44f1-b38f-9d70a1695819",
"source": "/event/source/123",
"type": "dev.cdevents.build.started.0.1.1",
"timestamp": "2023-03-20T14:27:05.315384Z"
"type": "dev.cdevents.build.started.0.2.0-draft",
"timestamp": "2023-03-20T14:27:05.315384Z",
"schemaUri": "https://myorg.com/schema/custom"
},
"subject": {
"id": "mySubject123",
Expand Down
5 changes: 3 additions & 2 deletions examples/change_abandoned.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
"version": "0.4.0-draft",
"id": "271069a8-fc18-44f1-b38f-9d70a1695819",
"source": "/event/source/123",
"type": "dev.cdevents.change.abandoned.0.1.2",
"timestamp": "2023-03-20T14:27:05.315384Z"
"type": "dev.cdevents.change.abandoned.0.2.0-draft",
"timestamp": "2023-03-20T14:27:05.315384Z",
"schemaUri": "https://myorg.com/schema/custom"
},
"subject": {
"id": "mySubject123",
Expand Down
5 changes: 3 additions & 2 deletions examples/change_created.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
"version": "0.4.0-draft",
"id": "271069a8-fc18-44f1-b38f-9d70a1695819",
"source": "/event/source/123",
"type": "dev.cdevents.change.created.0.2.0",
"timestamp": "2023-03-20T14:27:05.315384Z"
"type": "dev.cdevents.change.created.0.3.0-draft",
"timestamp": "2023-03-20T14:27:05.315384Z",
"schemaUri": "https://myorg.com/schema/custom"
},
"subject": {
"id": "mySubject123",
Expand Down
5 changes: 3 additions & 2 deletions examples/change_merged.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
"version": "0.4.0-draft",
"id": "271069a8-fc18-44f1-b38f-9d70a1695819",
"source": "/event/source/123",
"type": "dev.cdevents.change.merged.0.1.2",
"timestamp": "2023-03-20T14:27:05.315384Z"
"type": "dev.cdevents.change.merged.0.2.0-draft",
"timestamp": "2023-03-20T14:27:05.315384Z",
"schemaUri": "https://myorg.com/schema/custom"
},
"subject": {
"id": "mySubject123",
Expand Down
5 changes: 3 additions & 2 deletions examples/change_reviewed.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
"version": "0.4.0-draft",
"id": "271069a8-fc18-44f1-b38f-9d70a1695819",
"source": "/event/source/123",
"type": "dev.cdevents.change.reviewed.0.1.2",
"timestamp": "2023-03-20T14:27:05.315384Z"
"type": "dev.cdevents.change.reviewed.0.2.0-draft",
"timestamp": "2023-03-20T14:27:05.315384Z",
"schemaUri": "https://myorg.com/schema/custom"
},
"subject": {
"id": "mySubject123",
Expand Down
5 changes: 3 additions & 2 deletions examples/change_updated.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
"version": "0.4.0-draft",
"id": "271069a8-fc18-44f1-b38f-9d70a1695819",
"source": "/event/source/123",
"type": "dev.cdevents.change.updated.0.1.2",
"timestamp": "2023-03-20T14:27:05.315384Z"
"type": "dev.cdevents.change.updated.0.2.0-draft",
"timestamp": "2023-03-20T14:27:05.315384Z",
"schemaUri": "https://myorg.com/schema/custom"
},
"subject": {
"id": "mySubject123",
Expand Down
5 changes: 3 additions & 2 deletions examples/environment_created.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
"version": "0.4.0-draft",
"id": "271069a8-fc18-44f1-b38f-9d70a1695819",
"source": "/event/source/123",
"type": "dev.cdevents.environment.created.0.1.1",
"timestamp": "2023-03-20T14:27:05.315384Z"
"type": "dev.cdevents.environment.created.0.2.0-draft",
"timestamp": "2023-03-20T14:27:05.315384Z",
"schemaUri": "https://myorg.com/schema/custom"
},
"subject": {
"id": "mySubject123",
Expand Down
5 changes: 3 additions & 2 deletions examples/environment_deleted.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
"version": "0.4.0-draft",
"id": "271069a8-fc18-44f1-b38f-9d70a1695819",
"source": "/event/source/123",
"type": "dev.cdevents.environment.deleted.0.1.1",
"timestamp": "2023-03-20T14:27:05.315384Z"
"type": "dev.cdevents.environment.deleted.0.2.0-draft",
"timestamp": "2023-03-20T14:27:05.315384Z",
"schemaUri": "https://myorg.com/schema/custom"
},
"subject": {
"id": "mySubject123",
Expand Down
5 changes: 3 additions & 2 deletions examples/environment_modified.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
"version": "0.4.0-draft",
"id": "271069a8-fc18-44f1-b38f-9d70a1695819",
"source": "/event/source/123",
"type": "dev.cdevents.environment.modified.0.1.1",
"timestamp": "2023-03-20T14:27:05.315384Z"
"type": "dev.cdevents.environment.modified.0.2.0-draft",
"timestamp": "2023-03-20T14:27:05.315384Z",
"schemaUri": "https://myorg.com/schema/custom"
},
"subject": {
"id": "mySubject123",
Expand Down
2 changes: 1 addition & 1 deletion examples/incident_detected.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.4.0-draft",
"id": "F4BD2B55-B6F6-4F44-AF72-BD2D0E7A8708",
"source": "/monitoring/prod1",
"type": "dev.cdevents.incident.detected.0.1.0",
"type": "dev.cdevents.incident.detected.0.2.0-draft",
"timestamp": "2022-11-11T13:52:20.079Z"
},
"subject": {
Expand Down
Loading

0 comments on commit f1aafdb

Please sign in to comment.