feat(deployment): add deployment and targetRollout subjects and events - #319
feat(deployment): add deployment and targetRollout subjects and events#319xibz wants to merge 1 commit into
Conversation
Introduces deployment and targetRollout subjects with queued/started/finished lifecycle events, giving DORA-style tooling an unambiguous, multi-target-aware deployment completion fact. service.deployed is retained for backwards compatibility but deprecated in favor of deployment.finished. Signed-off-by: xibz <bjp@apple.com>
|
Hey @xibz, per your instructions for introducing new concepts, this seems a bit lacking in explanation. It is not clear what problem you are solving that CDEvents already solves, or how this approach addresses it. I would really like to understand what you mean by multi-target-aware deployment. How is that different from other deployments? How did you run into the situation? Where did the existing structure fail you? Thanks! |
|
@sol-duara - I updated the PR body which should help |
|
"service.deployed/service.upgraded conflate two different kinds of fact into one event." @xibz These seem to be two separate events. What is the 'fact' that you are referring to, and which one of these events is it in? Are you calling the event that signals a service/application reaching its destination the deployment process proper? I can see the need for a Based on what you (or Claude) have written, I can't follow the intent. Currently, I treat Finally, |
|
Thanks for pushing on this, these are exactly the right questions. 1. "These are two separate events — which one is 'the fact'?" Fair, my earlier phrasing was sloppy. It's not that the two events split one fact between them, each one individually conflates two facts. 2. "I can see the need for a deployment enclosure... make each That's very close to what we're proposing, the disagreement is really just about what fills the "where" slot inside that enclosure, which is point 3. 3. "That's what you're calling a The cleanest way to state the split:
4. "Is your expectation that the event becomes the system source of truth?" No. This is saying what happened. Nothing more. |
Problem
service.deployed/service.upgradedconflate two different kinds of fact into one event. Every other subject pair in the spec separates orchestration (the act of doing something) from entity (the resulting state) —buildis the orchestration event,artifactis the entity fact it produces.service.deployed/upgradedare the one place that doesn't hold: a single event tries to say both "a rollout happened" and "this service instance is now running v2," with no way to talk about the rollout on its own. That's also whyservicehas noqueued/startedpredicates — queuing and starting are true of a deployment, not of a service, so producers who need lifecycle visibility into an in-progress rollout have no canonical event to emit and end up inventing their own conventions.This also means there's no way to represent a single deployment fanning out to multiple simultaneous destinations with one aggregate outcome — e.g. rolling a release out to 3 regions, or to a canary slot plus the main fleet, within the same environment. Today you'd emit N separate
service.deployedevents and the consumer has to infer, out of band, which ones belong to the same deployment attempt and what the combined success/failure state is.Finally,
environmenthas no inbound link to what's running in it.environment.created/modified/deleteddescribe the platform alone; the only way to find out what's deployed into an environment today is to scanserviceevents and filter oncontent.environment.id, a reference that points from the entity down to the environment — backwards from every other "what happened in this environment" query you'd want to run.Solution
Introduces
deployment(the aggregate act of applying a release to one or more target rollouts, one per environment) andtargetRollout(a specific destination within that environment, e.g. a region or canary slot) as the orchestration-side subjectsservicewas missing, each withqueued/started/finishedlifecycle events.targetRollout.finishedcarriesfailureTypefor per-destination failure detail;deployment.finishedis all-or-nothing across all of its target rollouts.targetRolloutalso givesenvironmenta first-class inbound link: querying "what was rolled out to this environment" becomes direct instead of an inference overserviceevents.service.deployed/service.upgradedare unchanged in behavior and retained for backwards compatibility as the entity-side fact, now deprecated in favor ofdeployment.finished/targetRollout.finishedfor the orchestration-side fact.Changes
Submitter Checklist
As the author of this PR, please check off the items in this checklist: