A CDEvent is composed of a context and a subject. The context contains metadata about the event itself, such as its unique identifier, type, source, and timestamp.
Required Context Attributes
id: A unique non-empty String identifier for the event within the given source. A UUID v4 is a common example.type: A String defining the event type using the pattern dev.cdevents.<subject>.<predicate>.<major>.<minor>.<patch>.- Standard CDEvents use the
dev.cdevents. prefix. - Custom events (defined outside the core spec) use the
dev.cdeventsx. prefix.
source: A URI-Reference defining the context where the event occurred (e.g., /tekton or https://www.jenkins.io/). It provides global uniqueness when combined with id.timestamp: A timestamp adhering to [RFC 3339] representing when the event occurred.specversion: A String indicating the CDEvents specification version (e.g., 0.1.1).
Optional Context Attributes
schemaUri: An absolute URI linking to a jsonschema that refines the event schema. This schema must be stricter than the base CDEvents schema.chainId: A String (UUID v4) identifying a chain of events.links: A List of link objects used to indicate connections between events (e.g., PATH, RELATION, or END).
{
"context": {
"specversion": "0.6.0-draft",
"id" : "A234-1234-1234",
"source" : "/staging/tekton/",
"type" : "dev.cdevents.taskrun.started.0.2.0",
"timestamp" : "2018-04-05T17:31:00Z",
"schemaUri": "https://myorg.com/cdevents/schema/taskrun-started-1-1-0"
}
}