diff --git a/.spellcheck-en-custom.txt b/.spellcheck-en-custom.txt index 23556b78..b2921f17 100644 --- a/.spellcheck-en-custom.txt +++ b/.spellcheck-en-custom.txt @@ -17,6 +17,7 @@ SRE Tekton URI UUID +YAML american assignees br diff --git a/README.md b/README.md index 5713b99a..28e122e1 100644 --- a/README.md +++ b/README.md @@ -90,9 +90,9 @@ Handling Events associated with Test execution performed independently or as par Defining how CDEvents are mapped to CloudEvents for transportation and delivery -### [Schemas](./schemas/) and [Examples](./examples/) +### [Schemas](./schemas/) and [Conformance](./conformance/) -The [schemas](./schemas/) folder contains `jsonschemas` for all events in the spec. The [examples](./examples/) contains simple `JSON` examples for all events. +The [schemas](./schemas/) folder contains `jsonschemas` for all events in the spec. The [conformance](./conformance/) folder contains simple `JSON` examples for all events. The content of the conformance folder is used for testing purposes: the structure of the files in there is sound, the values have correct types but are not particularly meaningful. ## CDEvents SDKs diff --git a/conformance/README.md b/conformance/README.md new file mode 100644 index 00000000..74a5129f --- /dev/null +++ b/conformance/README.md @@ -0,0 +1,4 @@ +# Conformance Files + +All the YAML example files in this folder are used for validation testing of the specification as well as for conformance testing of the SDKs. +The structures are values are valid and up-to-date with the specification. The values do not bear special meaning though and should not be used as a reference when producing or consuming CDEvents. diff --git a/examples/artifact_deleted.json b/conformance/artifact_deleted.json similarity index 100% rename from examples/artifact_deleted.json rename to conformance/artifact_deleted.json diff --git a/examples/artifact_downloaded.json b/conformance/artifact_downloaded.json similarity index 100% rename from examples/artifact_downloaded.json rename to conformance/artifact_downloaded.json diff --git a/examples/artifact_packaged.json b/conformance/artifact_packaged.json similarity index 100% rename from examples/artifact_packaged.json rename to conformance/artifact_packaged.json diff --git a/examples/artifact_published.json b/conformance/artifact_published.json similarity index 100% rename from examples/artifact_published.json rename to conformance/artifact_published.json diff --git a/examples/artifact_signed.json b/conformance/artifact_signed.json similarity index 100% rename from examples/artifact_signed.json rename to conformance/artifact_signed.json diff --git a/examples/branch_created.json b/conformance/branch_created.json similarity index 100% rename from examples/branch_created.json rename to conformance/branch_created.json diff --git a/examples/branch_deleted.json b/conformance/branch_deleted.json similarity index 100% rename from examples/branch_deleted.json rename to conformance/branch_deleted.json diff --git a/examples/build_finished.json b/conformance/build_finished.json similarity index 100% rename from examples/build_finished.json rename to conformance/build_finished.json diff --git a/examples/build_queued.json b/conformance/build_queued.json similarity index 100% rename from examples/build_queued.json rename to conformance/build_queued.json diff --git a/examples/build_started.json b/conformance/build_started.json similarity index 100% rename from examples/build_started.json rename to conformance/build_started.json diff --git a/examples/change_abandoned.json b/conformance/change_abandoned.json similarity index 100% rename from examples/change_abandoned.json rename to conformance/change_abandoned.json diff --git a/examples/change_created.json b/conformance/change_created.json similarity index 100% rename from examples/change_created.json rename to conformance/change_created.json diff --git a/examples/change_merged.json b/conformance/change_merged.json similarity index 100% rename from examples/change_merged.json rename to conformance/change_merged.json diff --git a/examples/change_reviewed.json b/conformance/change_reviewed.json similarity index 100% rename from examples/change_reviewed.json rename to conformance/change_reviewed.json diff --git a/examples/change_updated.json b/conformance/change_updated.json similarity index 100% rename from examples/change_updated.json rename to conformance/change_updated.json diff --git a/examples/environment_created.json b/conformance/environment_created.json similarity index 100% rename from examples/environment_created.json rename to conformance/environment_created.json diff --git a/examples/environment_deleted.json b/conformance/environment_deleted.json similarity index 100% rename from examples/environment_deleted.json rename to conformance/environment_deleted.json diff --git a/examples/environment_modified.json b/conformance/environment_modified.json similarity index 100% rename from examples/environment_modified.json rename to conformance/environment_modified.json diff --git a/examples/incident_detected.json b/conformance/incident_detected.json similarity index 100% rename from examples/incident_detected.json rename to conformance/incident_detected.json diff --git a/examples/incident_reported.json b/conformance/incident_reported.json similarity index 100% rename from examples/incident_reported.json rename to conformance/incident_reported.json diff --git a/examples/incident_resolved.json b/conformance/incident_resolved.json similarity index 100% rename from examples/incident_resolved.json rename to conformance/incident_resolved.json diff --git a/examples/pipelinerun_finished.json b/conformance/pipelinerun_finished.json similarity index 100% rename from examples/pipelinerun_finished.json rename to conformance/pipelinerun_finished.json diff --git a/examples/pipelinerun_queued.json b/conformance/pipelinerun_queued.json similarity index 100% rename from examples/pipelinerun_queued.json rename to conformance/pipelinerun_queued.json diff --git a/examples/pipelinerun_started.json b/conformance/pipelinerun_started.json similarity index 100% rename from examples/pipelinerun_started.json rename to conformance/pipelinerun_started.json diff --git a/examples/repository_created.json b/conformance/repository_created.json similarity index 100% rename from examples/repository_created.json rename to conformance/repository_created.json diff --git a/examples/repository_deleted.json b/conformance/repository_deleted.json similarity index 100% rename from examples/repository_deleted.json rename to conformance/repository_deleted.json diff --git a/examples/repository_modified.json b/conformance/repository_modified.json similarity index 100% rename from examples/repository_modified.json rename to conformance/repository_modified.json diff --git a/examples/service_deployed.json b/conformance/service_deployed.json similarity index 100% rename from examples/service_deployed.json rename to conformance/service_deployed.json diff --git a/examples/service_published.json b/conformance/service_published.json similarity index 100% rename from examples/service_published.json rename to conformance/service_published.json diff --git a/examples/service_removed.json b/conformance/service_removed.json similarity index 100% rename from examples/service_removed.json rename to conformance/service_removed.json diff --git a/examples/service_rolledback.json b/conformance/service_rolledback.json similarity index 100% rename from examples/service_rolledback.json rename to conformance/service_rolledback.json diff --git a/examples/service_upgraded.json b/conformance/service_upgraded.json similarity index 100% rename from examples/service_upgraded.json rename to conformance/service_upgraded.json diff --git a/examples/taskrun_finished.json b/conformance/taskrun_finished.json similarity index 100% rename from examples/taskrun_finished.json rename to conformance/taskrun_finished.json diff --git a/examples/taskrun_started.json b/conformance/taskrun_started.json similarity index 100% rename from examples/taskrun_started.json rename to conformance/taskrun_started.json diff --git a/examples/testcaserun_finished.json b/conformance/testcaserun_finished.json similarity index 100% rename from examples/testcaserun_finished.json rename to conformance/testcaserun_finished.json diff --git a/examples/testcaserun_queued.json b/conformance/testcaserun_queued.json similarity index 100% rename from examples/testcaserun_queued.json rename to conformance/testcaserun_queued.json diff --git a/examples/testcaserun_skipped.json b/conformance/testcaserun_skipped.json similarity index 100% rename from examples/testcaserun_skipped.json rename to conformance/testcaserun_skipped.json diff --git a/examples/testcaserun_started.json b/conformance/testcaserun_started.json similarity index 100% rename from examples/testcaserun_started.json rename to conformance/testcaserun_started.json diff --git a/examples/testoutput_published.json b/conformance/testoutput_published.json similarity index 100% rename from examples/testoutput_published.json rename to conformance/testoutput_published.json diff --git a/examples/testsuiterun_finished.json b/conformance/testsuiterun_finished.json similarity index 100% rename from examples/testsuiterun_finished.json rename to conformance/testsuiterun_finished.json diff --git a/examples/testsuiterun_queued.json b/conformance/testsuiterun_queued.json similarity index 100% rename from examples/testsuiterun_queued.json rename to conformance/testsuiterun_queued.json diff --git a/examples/testsuiterun_started.json b/conformance/testsuiterun_started.json similarity index 100% rename from examples/testsuiterun_started.json rename to conformance/testsuiterun_started.json diff --git a/examples/ticket_closed.json b/conformance/ticket_closed.json similarity index 100% rename from examples/ticket_closed.json rename to conformance/ticket_closed.json diff --git a/examples/ticket_created.json b/conformance/ticket_created.json similarity index 100% rename from examples/ticket_created.json rename to conformance/ticket_created.json diff --git a/examples/ticket_updated.json b/conformance/ticket_updated.json similarity index 100% rename from examples/ticket_updated.json rename to conformance/ticket_updated.json diff --git a/continuous-deployment.md b/continuous-deployment.md index 65254586..d29fc2ca 100644 --- a/continuous-deployment.md +++ b/continuous-deployment.md @@ -47,7 +47,7 @@ A `service` can represent for example a binary that is running, a daemon, an app ## Events -### [`environment created`](examples/environment_created.json) +### [`environment created`](conformance/environment_created.json) This event represents an environment that has been created. Such an environment can be used to deploy services in. @@ -63,7 +63,7 @@ This event represents an environment that has been created. Such an environment | name | `String` | Name of the environment | `dev`, `staging`, `production`, `ci-123`| | | url | `String` | URL to reference where the environment is located | `https://my-cluster.zone.my-cloud-provider`| | -### [`environment modified`](examples/environment_modified.json) +### [`environment modified`](conformance/environment_modified.json) This event represents an environment that has been modified. @@ -79,7 +79,7 @@ This event represents an environment that has been modified. | name | `String` | Name of the environment | `dev`, `staging`, `production`, `ci-123`| | | url | `String` | URL to reference where the environment is located | `https://my-cluster.zone.my-cloud-provider`| | -### [`environment deleted`](examples/environment_deleted.json) +### [`environment deleted`](conformance/environment_deleted.json) This event represents an environment that has been deleted.``` @@ -94,7 +94,7 @@ This event represents an environment that has been deleted.``` | type | `String` | See [type](spec.md#type-subject) | `environment` | | | name | `String` | Name of the environment | `dev`, `staging`, `production`, `ci-123`| | -### [`service deployed`](examples/service_deployed.json) +### [`service deployed`](conformance/service_deployed.json) This event represents a new instance of a service that has been deployed @@ -110,7 +110,7 @@ This event represents a new instance of a service that has been deployed | environment | `Object` ([`environment`](#environment)) | Reference for the environment where the service runs | `{"id": "1234"}`, `{"id": "maven123, "source": "tekton-dev-123"}` | ✅ | | artifactId | `Purl` | Identifier of the artifact deployed with this service | `0b31b1c02ff458ad9b7b81cbdf8f028bd54699fa151f221d1e8de6817db93427`, `927aa808433d17e315a258b98e2f1a55f8258e0cb782ccb76280646d0dbe17b5`, `six-1.14.0-py2.py3-none-any.whl` | ✅ | -### [`service upgraded`](examples/service_upgraded.json) +### [`service upgraded`](conformance/service_upgraded.json) This event represents an existing instance of a service that has been upgraded to a new version @@ -126,7 +126,7 @@ This event represents an existing instance of a service that has been upgraded t | environment | `Object` ([`environment`](#environment)) | Reference for the environment where the service runs | `{"id": "1234"}`, `{"id": "maven123, "source": "tekton-dev-123"}` | ✅ | | artifactId | `Purl` | Identifier of the artifact deployed with this service |`pkg:oci/myapp@sha256%3A0b31b1c02ff458ad9b7b81cbdf8f028bd54699fa151f221d1e8de6817db93427`, `pkg:golang/mygit.com/myorg/myapp@234fd47e07d1004f0aed9c` | ✅ | -### [`service rolledback`](examples/service_rolledback.json) +### [`service rolledback`](conformance/service_rolledback.json) This event represents an existing instance of a service that has been rolled back to a previous version @@ -142,7 +142,7 @@ This event represents an existing instance of a service that has been rolled bac | environment | `Object` ([`environment`](#environment)) | Reference for the environment where the service runs | `{"id": "1234"}`, `{"id": "maven123, "source": "tekton-dev-123"}` | ✅ | | artifactId | `Purl` | Identifier of the artifact deployed with this service | `pkg:oci/myapp@sha256%3A0b31b1c02ff458ad9b7b81cbdf8f028bd54699fa151f221d1e8de6817db93427`, `pkg:golang/mygit.com/myorg/myapp@234fd47e07d1004f0aed9c` | ✅ | -### [`service removed`](examples/service_removed.json) +### [`service removed`](conformance/service_removed.json) This event represents the removal of a previously deployed service instance and is thus not longer present in the specified environment @@ -157,7 +157,7 @@ This event represents the removal of a previously deployed service instance and | type | `String` | See [type](spec.md#type-subject) | `service` | | | environment | `Object` ([`environment`](#environment)) | Reference for the environment where the service runs | `{"id": "1234"}`, `{"id": "maven123, "source": "tekton-dev-123"}` | ✅ | -### [`service published`](examples/service_published.json) +### [`service published`](conformance/service_published.json) 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. diff --git a/continuous-integration.md b/continuous-integration.md index a57ac40d..c936182b 100644 --- a/continuous-integration.md +++ b/continuous-integration.md @@ -52,7 +52,7 @@ An `artifact` is usually produced as output of a build process. Events need to b ## Events -### [`build queued`](examples/build_queued.json) +### [`build queued`](conformance/build_queued.json) This event represents a Build task that has been queued; this build process usually is in charge of producing a binary from source code. @@ -66,7 +66,7 @@ This event represents a Build task that has been queued; this build process usua | source | `URI-Reference` | See [source](spec.md#source-subject) | | | | type | `String` | See [type](spec.md#type-subject) | `build` | | -### [`build started`](examples/build_started.json) +### [`build started`](conformance/build_started.json) This event represents a Build task that has been started; this build process usually is in charge of producing a binary from source code. @@ -80,7 +80,7 @@ This event represents a Build task that has been started; this build process usu | source | `URI-Reference` | See [source](spec.md#source-subject) | | | | type | `String` | See [type](spec.md#type-subject) | `build` | | -### [`build finished`](examples/build_finished.json) +### [`build finished`](conformance/build_finished.json) This event represents a Build task that has finished. This event will eventually contain the finished status, success, error or failure @@ -95,7 +95,7 @@ This event represents a Build task that has finished. This event will eventually | 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` | | -### [`artifact packaged`](examples/artifact_packaged.json) +### [`artifact packaged`](conformance/artifact_packaged.json) The event represents an artifact that has been packaged for distribution; this artifact is now versioned with a fixed version. This event is usually produced by the build system. If an SBOM URI is available at this stage, it should be included. @@ -112,7 +112,7 @@ This event is usually produced by the build system. If an SBOM URI is available | change | `object` | The change (tag, commit, revision) of the repository which was used to build the artifact" | `{"id": "527d4a1aca5e8d0df24813df5ad65d049fc8d312", "source": "my-git.example/an-org/a-repo"}`, `{"id": "feature1234", "source": "my-git.example/an-org/a-repo"}` | ✅ | | sbom | [`sbom`](#sbom) | The Software Bill of Material (SBOM) associated with the artifact | `{"uri": "https://sbom.storage.service/my-projects/3A0b31b1c02ff458ad9b7b81cbdf8f028bd54699fa151f221d1e8de6817db93427.sbom"}` | | -### [`artifact signed`](examples/artifact_signed.json) +### [`artifact signed`](conformance/artifact_signed.json) 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. @@ -128,7 +128,7 @@ An artifact may be signed after it has been packaged or sometimes after it has p | type | `String` | See [type](spec.md#type-subject) | `artifact` | | | signature | `string` | The signature of the artifact | `MEYCIQCBT8U5ypDXWCjlNKfzTV4KH516/SK13NZSh8znnSMNkQIhAJ3XiQlc9PM1KyjITcZXHotdMB+J3NGua5T/yshmiPmp` | ✅ | -### [`artifact published`](examples/artifact_published.json) +### [`artifact published`](conformance/artifact_published.json) The event represents an artifact that has been published and it can be advertised for others to use. The `artifact published` event is typically produced by the artifact registry, but it may also be produced by the build system. @@ -144,7 +144,7 @@ The `artifact published` event is typically produced by the artifact registry, b | type | `String` | See [type](spec.md#type-subject) | `artifact` | | | user | `String` | The user who published to the artifact registry. [^user] | `mybot-myapp` | | -### [`artifact downloaded`](examples/artifact_downloaded.json) +### [`artifact downloaded`](conformance/artifact_downloaded.json) The event represents an artifact that has been downloaded from the registry. The `artifact downloaded` event is preferably produced by the artifact registry. @@ -160,7 +160,7 @@ The `artifact downloaded` event is preferably produced by the artifact registry. | type | `String` | See [type](spec.md#type-subject) | `artifact` | | | user | `String` | The user who downloaded from the artifact registry. [^user] | `mybot-myapp` | | -### [`artifact deleted`](examples/artifact_deleted.json) +### [`artifact deleted`](conformance/artifact_deleted.json) The event represents an artifact that has been deleted from an artifact registry. The `artifact deleted` event is preferably produced by the artifact registry. diff --git a/continuous-operations.md b/continuous-operations.md index bb1c047b..ed4799f3 100644 --- a/continuous-operations.md +++ b/continuous-operations.md @@ -58,7 +58,7 @@ A ticket can request a change, report a problem, or document an [`incident`](#in ## Events -### [`incident detected`](examples/incident_detected.json) +### [`incident detected`](conformance/incident_detected.json) This event represents an incident that has been detected by a system or human. @@ -76,7 +76,7 @@ This event represents an incident that has been detected by a system or human. | service | `Object` ([`service`](./continuous-deployment.md#service)) | Reference to the service | `{"id": "service123"}`, `{"id": "service123", "source": "region1/k8s/namespace"}` | | | artifactId | `Purl` | Identifier of the artifact deployed with this service | `0b31b1c02ff458ad9b7b81cbdf8f028bd54699fa151f221d1e8de6817db93427`, `927aa808433d17e315a258b98e2f1a55f8258e0cb782ccb76280646d0dbe17b5`, `six-1.14.0-py2.py3-none-any.whl` | | -### [`incident reported`](examples/incident_reported.json) +### [`incident reported`](conformance/incident_reported.json) This event represents an incident that has been reported through a ticketing system. Compared to the `detected` predicated, it introduces a ticket URI. @@ -95,7 +95,7 @@ This event represents an incident that has been reported through a ticketing sys | service | `Object` ([`service`](./continuous-deployment.md#service)) | Reference to the service | `{"id": "service123"}`, `{"id": "service123", "source": "region1/k8s/namespace"}` | | | artifactId | `Purl` | Identifier of the artifact deployed with this service | `0b31b1c02ff458ad9b7b81cbdf8f028bd54699fa151f221d1e8de6817db93427`, `927aa808433d17e315a258b98e2f1a55f8258e0cb782ccb76280646d0dbe17b5`, `six-1.14.0-py2.py3-none-any.whl` | | -### [`incident resolved`](examples/incident_resolved.json) +### [`incident resolved`](conformance/incident_resolved.json) This event represents an incident that has been resolved, meaning that the problem identified by the incident has been solved or recalled. @@ -113,7 +113,7 @@ This event represents an incident that has been resolved, meaning that the probl | service | `Object` ([`service`](./continuous-deployment.md#service)) | Reference to the service | `{"id": "service123"}`, `{"id": "service123", "source": "region1/k8s/namespace"}` | | | artifactId | `Purl` | Identifier of the artifact deployed with this service | `0b31b1c02ff458ad9b7b81cbdf8f028bd54699fa151f221d1e8de6817db93427`, `927aa808433d17e315a258b98e2f1a55f8258e0cb782ccb76280646d0dbe17b5`, `six-1.14.0-py2.py3-none-any.whl` | | -### [`ticket created`](examples/ticket_created.json) +### [`ticket created`](conformance/ticket_created.json) This event represents a ticket that has been created within some ticketing system. @@ -136,7 +136,7 @@ This event represents a ticket that has been created within some ticketing syste | milestone | `String` | An ID that represents a goal for when this ticket is to be completed | `123`, `sprint-123`, `Q1` | | | uri | `URI-Reference` | A link to the ticket itself | `https://example.issues.com/ticket123` | ✅ | -### [`ticket updated`](examples/ticket_updated.json) +### [`ticket updated`](conformance/ticket_updated.json) This event indicates that a ticket has been updated within some ticketing system. @@ -160,7 +160,7 @@ This event indicates that a ticket has been updated within some ticketing system | uri | `URI-Reference` | A link to the ticket itself | `https://example.issues.com/ticket123` | ✅ | | updatedBy | `String` | The person who authored the updates | `Bob` | | -### [`ticket closed`](examples/ticket_closed.json) +### [`ticket closed`](conformance/ticket_closed.json) This event indicates that a ticket has been closed or resolved within some ticketing system. diff --git a/core.md b/core.md index 70c7942a..b6fb24c8 100644 --- a/core.md +++ b/core.md @@ -62,7 +62,7 @@ associated, in which case it is acceptable to generate only taskRun events. ## Events -### [`pipelineRun queued`](examples/pipelinerun_queued.json) +### [`pipelineRun queued`](conformance/pipelinerun_queued.json) 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 @@ -80,7 +80,7 @@ to ignore these events if they don't apply to their use cases. | pipelineName | `String` | The name of the pipeline | `MyPipeline`, `Unit tests for my repo` | | | url | `URI` | url to the `pipelineRun` | `https://dashboard.org/namespace/pipelinerun-1234`, `https://api.cdsystem.com/namespace/pipelinerun-1234` | | -### [`pipelineRun Started`](examples/pipelinerun_started.json) +### [`pipelineRun Started`](conformance/pipelinerun_started.json) A pipelineRun has started and it is running. @@ -96,7 +96,7 @@ A pipelineRun has started and it is running. | pipelineName | `String` | The name of the pipeline | `MyPipeline`, `Unit tests for my repo` | | | url | `URI` | url to the `pipelineRun` | `https://dashboard.org/namespace/pipelinerun-1234`, `https://api.cdsystem.com/namespace/pipelinerun-1234` | | -### [`pipelineRun Finished`](examples/pipelinerun_finished.json) +### [`pipelineRun Finished`](conformance/pipelinerun_finished.json) A pipelineRun has finished, successfully or not. @@ -114,7 +114,7 @@ A pipelineRun has finished, successfully or not. | outcome | `String (enum)` | outcome of a finished `pipelineRun` | `success`, `error` or `failure`| | | errors | `String` | In case of error or failed pipeline, provides details about the failure | `Invalid input param 123`, `Timeout during execution`, `pipelineRun canceled by user`, `Unit tests failed`| | -### [`taskRun Started`](examples/taskrun_started.json) +### [`taskRun Started`](conformance/taskrun_started.json) A taskRun has started and it is running. @@ -131,7 +131,7 @@ A taskRun has started and it is running. | pipelineRun | `Object` ([`pipelineRun`](#pipelinerun)) | The `pipelineRun` that this `taskRun` belongs to. | `{"id": "namespace/pipelinerun-1234"}`| | | url | `URI` | url to the `taskRun` | `https://dashboard.org/namespace/taskrun-1234`, `https://api.cdsystem.com/namespace/taskrun-1234` | | -### [`taskRun Finished`](examples/taskrun_finished.json) +### [`taskRun Finished`](conformance/taskrun_finished.json) A taskRun has finished, successfully or not. diff --git a/source-code-version-control.md b/source-code-version-control.md index be090894..ddb8d202 100644 --- a/source-code-version-control.md +++ b/source-code-version-control.md @@ -63,7 +63,7 @@ A `change` identifies a proposed set of changes to the content of a `repository` ## Events -### [`repository created`](examples/repository_created.json) +### [`repository created`](conformance/repository_created.json) A new Source Code Repository was created to host source code for a project. @@ -81,7 +81,7 @@ A new Source Code Repository was created to host source code for a project. | url | `URI` | URL to the `repository` | `git://my-git.example/an-org/a-repo` | ✅ | | viewUrl | `URI` | URL for humans to view the content of the `repository` | `https://my-git.example/an-org/a-repo/view`| | -### [`repository modified`](examples/repository_modified.json) +### [`repository modified`](conformance/repository_modified.json) A Source Code Repository modified some of its attributes, like location, or owner. @@ -99,7 +99,7 @@ A Source Code Repository modified some of its attributes, like location, or owne | url | `URI` | URL to the `repository` | `git://my-git.example/an-org/a-repo` | ✅ | | viewUrl | `URI` | URL for humans to view the content of the `repository` | `https://my-git.example/an-org/a-repo/view`| | -### [`repository deleted`](examples/repository_deleted.json) +### [`repository deleted`](conformance/repository_deleted.json) - Event Type: __`dev.cdevents.repository.deleted.0.2.0`__ - Predicate: modified @@ -115,7 +115,7 @@ A Source Code Repository modified some of its attributes, like location, or owne | url | `URI` | URL to the `repository` | `git://my-git.example/an-org/a-repo` | | | viewUrl | `URI` | URL for humans to view the content of the `repository` | `https://my-git.example/an-org/a-repo/view`| | -### [`branch created`](examples/branch_created.json) +### [`branch created`](conformance/branch_created.json) A branch inside the Repository was created. @@ -130,7 +130,7 @@ A branch inside the Repository was created. | type | `String` | See [type](spec.md#type-subject) | `branch` | | | repository | `Object` | A reference to the repository where the change event happened | `{"id": "an-org/a-repo"}` | | -### [`branch deleted`](examples/branch_deleted.json) +### [`branch deleted`](conformance/branch_deleted.json) A branch inside the Repository was deleted. @@ -145,7 +145,7 @@ A branch inside the Repository was deleted. | type | `String` | See [type](spec.md#type-subject) | `branch` | | | repository | `Object` | A reference to the repository where the change event happened | `{"id": "an-org/a-repo"}` | | -### [`change created`](examples/change_created.json) +### [`change created`](conformance/change_created.json) A source code change was created and submitted to a repository specific branch. Examples: PullRequest sent to Github, MergeRequest sent to Gitlab, Change created in Gerrit. @@ -161,7 +161,7 @@ A source code change was created and submitted to a repository specific branch. | description | `String` | Description associated with the change, e.g. A pull request's description | `This PR addresses a fix for some feature`| | | repository | `Object` | A reference to the repository where the change event happened | `{"id": "an-org/a-repo"}` | | -### [`change reviewed`](examples/change_reviewed.json) +### [`change reviewed`](conformance/change_reviewed.json) Someone (user) or an automated system submitted an review to the source code change. A user or an automated system needs to be in charge of understanding how many approvals/rejections are needed for this change to be merged or rejected. The review event needs to include if the change is approved by the reviewer, more changes are needed or if the change is rejected. @@ -176,7 +176,7 @@ Someone (user) or an automated system submitted an review to the source code cha | type | `String` | See [type](spec.md#type-subject) | `change` | | | repository | `Object` | A reference to the repository where the change event happened | `{"id": "an-org/a-repo"}` | | -### [`change merged`](examples/change_merged.json) +### [`change merged`](conformance/change_merged.json) A change is merged to the target branch where it was submitted. @@ -191,7 +191,7 @@ A change is merged to the target branch where it was submitted. | type | `String` | See [type](spec.md#type-subject) | `change` | | | repository | `Object` | A reference to the repository where the change event happened | `{"id": "an-org/a-repo"}` | | -### [`change abandoned`](examples/change_abandoned.json) +### [`change abandoned`](conformance/change_abandoned.json) A tool or a user decides that the change has been inactive for a while and it can be considered abandoned. @@ -206,7 +206,7 @@ A tool or a user decides that the change has been inactive for a while and it ca | type | `String` | See [type](spec.md#type-subject) | `change` | | | repository | `Object` | A reference to the repository where the change event happened | `{"id": "an-org/a-repo"}` | | -### [`change updated`](examples/change_updated.json) +### [`change updated`](conformance/change_updated.json) A Change has been updated, for example a new commit is added or removed from an existing Change. diff --git a/testing-events.md b/testing-events.md index 8caccb2e..43c5f313 100644 --- a/testing-events.md +++ b/testing-events.md @@ -70,7 +70,7 @@ One or more `testOutput` artifacts are usually produced as the result of a test ## Events -### [`testCaseRun queued`](examples/testcaserun_queued.json) +### [`testCaseRun queued`](conformance/testcaserun_queued.json) This event represents when a testCaseRun has been queued for execution - and is waiting for applicable preconditions (resource availability, other tasks, etc.) to be fulfilled before actually executing. @@ -88,7 +88,7 @@ This event represents when a testCaseRun has been queued for execution - and is | testSuiteRun | `Object` [`testSuiteRun`](#testsuiterun) | A testSuiteRun to associate this testCaseRun with a containing testSuiteRun | `{"id":"Auth-TestSuite-execution-12334", "source": "staging/testkube"}` | | | trigger | `Object` [trigger](#trigger) | What triggered this testSuiteRun | `{"type": "schedule"}` | -### [`testCaseRun started`](examples/testcaserun_started.json) +### [`testCaseRun started`](conformance/testcaserun_started.json) This event represents a started testCase execution. @@ -105,7 +105,7 @@ This event represents a started testCase execution. | testSuiteRun | `Object` [`testSuiteRun`](#testsuiterun) | A testSuiteRun to associate this testCaseRun with a containing testSuiteRun | `{"id":"Auth-TestSuite-execution-12334", "source": "staging/testkube"}` | | | trigger | `Object` [trigger](#trigger) | What triggered this testSuiteRun | `{"type": "event"}` | -### [`testCaseRun finished`](examples/testcaserun_finished.json) +### [`testCaseRun finished`](conformance/testcaserun_finished.json) This event represents a finished testCase execution. The event will contain the outcome and additional metadata as applicable. @@ -124,7 +124,7 @@ This event represents a finished testCase execution. The event will contain the | severity | `String (enum)` | Severity if the test failed, one of `low`, `medium`, `high`, `critical` | `critical` | | reason | `String` | A reason related to the outcome of the execution | `Canceled by user`, `Failed assertion`, `Timed out` | | -### [`testCaseRun skipped`](examples/testcaserun_skipped.json) +### [`testCaseRun skipped`](conformance/testcaserun_skipped.json) This event represents a skipped testCaseRun execution. The event should only be emitted if there has been no prior "queued" or "started" event. @@ -142,7 +142,7 @@ This event represents a skipped testCaseRun execution. The event should only be | severity | `String` | Severity if the test failed, one of `low`, `medium`, `high`, `critical` | `critical` | | reason | `String` | A reason for skipping the test case run. | `Not running in given environment`, `Skipping slow tests` | | -### [`testSuiteRun queued`](examples/testsuiterun_queued.json) +### [`testSuiteRun queued`](conformance/testsuiterun_queued.json) This event represents when a testSuiteRun has been queued for execution - and is waiting for applicable preconditions (resource availability, other tasks, etc.) to be met before actually executing. @@ -159,7 +159,7 @@ This event represents when a testSuiteRun has been queued for execution - and is | testSuite | `Object` [`testSuite`](#testsuite) | Definition of the testSuite being executed | `{"id": "92834723894", "name": "Auth TestSuite"}` | | | trigger | `Object` [trigger](#trigger) | What triggered this testSuiteRun | `{"type": "manual"}` | -### [`testSuiteRun started`](examples/testsuiterun_started.json) +### [`testSuiteRun started`](conformance/testsuiterun_started.json) This event represents a started testSuite execution. @@ -175,7 +175,7 @@ This event represents a started testSuite execution. | testSuite | `Object` [`testSuite`](#testsuite) | Definition of the testSuite being executed | `{"id": "92834723894", "name": "Auth TestSuite"}` | | | trigger | `Object` [trigger](#trigger) | What triggered this testSuiteRun | `{"type": "pipeline"}` | -### [`testSuiteRun finished`](examples/testsuiterun_finished.json) +### [`testSuiteRun finished`](conformance/testsuiterun_finished.json) This event represents a finished testSuite execution. The event will contain the outcome and additional metadata as applicable. @@ -193,7 +193,7 @@ This event represents a finished testSuite execution. The event will contain the | reason | `String` | A reason related to the outcome of the execution | `Canceled by user`, `Failed testCase` | | | testSuite | `Object` [`testSuite`](#testsuite) | Definition of the testSuite being executed | `{"id": "92834723894", "name": "Auth TestSuite"}` | | -### [`testOutput published`](examples/testoutput_published.json) +### [`testOutput published`](conformance/testoutput_published.json) The event represents a test execution output that has been published. diff --git a/tools/validate.sh b/tools/validate.sh index 7d70d0e9..8015d247 100755 --- a/tools/validate.sh +++ b/tools/validate.sh @@ -36,7 +36,7 @@ set -o noglob # Folders ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)" -EXAMPLES_FOLDER="${ROOT}/examples" +EXAMPLES_FOLDER="${ROOT}/conformance" SCHEMAS_FOLDER="${ROOT}/schemas" EMBEDDED_LINKS_SCHEMAS="${ROOT}/schemas/links/embedded*.json" JSON_VALIDATOR_OPTIONS="--strict=false --spec=draft2020 -c ajv-formats" @@ -61,10 +61,10 @@ ajv compile ${JSON_VALIDATOR_OPTIONS} -r "${EMBEDDED_LINKS_SCHEMAS}" -s custom/s echo "$(( num_schemas - schema_failed )) out of ${num_schemas} schemas are valid" -# Loop over all example files -# - examples are subject_predicate.json +# Loop over all conformance files +# - conformance are subject_predicate.json # - schemas are subjectpredicate.json -echo -e "\n==> Testing Example Files" +echo -e "\n==> Testing Conformance Files" example_failed=0 num_examples=$(find "${EXAMPLES_FOLDER}" -type f -name '*json' | wc -l | awk '{ print $1 }') find "${EXAMPLES_FOLDER}" -type f -name '*.json' | while read -r example; do