update(schemas): relax environment id requirement in service upgraded#309
Open
xibz wants to merge 1 commit into
Open
update(schemas): relax environment id requirement in service upgraded#309xibz wants to merge 1 commit into
xibz wants to merge 1 commit into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
environmentobject inserviceUpgraded(and related service events) currently requires anidfield. This creates a real-world problem for CD tools that have no concept of a named environment, but they are forced to populateidwith 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:
us-east-1-prodandeu-west-1-prod, both of which are "production" environments, but represented asdistinct clusters with no shared environment identifier.
prod,nonprod) with no stable ID to reference.Requiring
idforces 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 #310Changes
namefield to theenvironmentobject withx-suggested-values: [prod, nonprod, unknown]to provide loose governance withoutrestricting the field to an enum.
required: [id]constraint toanyOf: [{required: [id]}, {required: [name]}], so producers must supply at least one ofidornamebut not necessarily both.This allows tools like Spinnaker to emit a meaningful
name(e.g."prod") without needing a stable environmentid, while tools that do have environment IDs continue to work as before.