Skip to content

update(schemas): relax environment id requirement in service upgraded#309

Open
xibz wants to merge 1 commit into
cdevents:mainfrom
xibz:env
Open

update(schemas): relax environment id requirement in service upgraded#309
xibz wants to merge 1 commit into
cdevents:mainfrom
xibz:env

Conversation

@xibz
Copy link
Copy Markdown
Contributor

@xibz xibz commented Jun 5, 2026

Problem

The environment object in serviceUpgraded (and related service events) currently requires an id field. This creates a real-world problem for CD tools that have no concept of a named environment, but they are forced to populate id with a meaningless placeholder like "n/a".

Environment vs. Cluster conflation

Many CD tools (e.g. Spinnaker) operate at the cluster or namespace level, not the environment level. In these systems, a deployment target is a:

cluster — a concrete infrastructure resource — not an abstract environment like "production" or "staging". These concepts are often conflated:

  • A team may deploy the same service to us-east-1-prod and eu-west-1-prod, both of which are "production" environments, but represented as
    distinct clusters with no shared environment identifier.
  • Other tools model environment purely by name convention (prod, nonprod) with no stable ID to reference.

Requiring id forces these tools to either fabricate an identifier or skip the field entirely by violating the schema, neither of which is useful for consumers of the event. We need to be VERY clear on what is an environment and what is a cluster or target. Blending environment to mean cluster is ambiguous. This is out of scope for this PR, but needs to be addressed in the future, see #310

Changes

  • Adds a name field to the environment object with x-suggested-values: [prod, nonprod, unknown] to provide loose governance without
    restricting the field to an enum.
  • Relaxes the required: [id] constraint to anyOf: [{required: [id]}, {required: [name]}], so producers must supply at least one of id or
    name but not necessarily both.

This allows tools like Spinnaker to emit a meaningful name (e.g. "prod") without needing a stable environment id, while tools that do have environment IDs continue to work as before.

@xibz xibz requested a review from a team as a code owner June 5, 2026 15:45
Some CD tools (e.g. Spinnaker) have no concept of environment, forcing
producers to set id to a placeholder like "n/a". This change adds a
tier field with x-suggested-values (prod, nonprod, unknown) and relaxes
the constraint to require at least one of id or tier, so tools without
a meaningful environment id can use tier instead.

Signed-off-by: xibz <bjp@apple.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant