chore: general plans rfc - #1120
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
Disabled knowledge base sources:
📝 WalkthroughWalkthroughRFC 0013 proposes generalizing deployment plan triggers to support deployment-affecting changes beyond version-published events by introducing immutable snapshot-based plans, shifting target resolution to API callers, and simplifying stage-1 dispatch to work with pre-inserted targets derived from snapshot context. ChangesRFC 0013: Generalized Deployment Plans
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Adds RFC 0013 describing a proposal to generalize deployment plans beyond “new version published” by making plans immutable snapshots and letting the API caller scope the plan’s release targets.
Changes:
- Introduces a snapshot-based
deployment_planmodel (e.g.,version_snapshot,deployment_snapshot) to support additional plan triggers like deployment-edit previews. - Proposes moving release-target scoping to the API caller by pre-inserting plan targets rather than resolving them live in stage-1.
- Outlines migration and open questions (especially around variable resolution and trigger typing).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| No change required. `MaybeUpdateTargetCheck` already reads | ||
| `github/{owner,repo}` and `git/sha` from version metadata; the same lookup | ||
| works against any snapshot or `plan.metadata`. The right behavior falls out: | ||
|
|
||
| - Version-published plan → version metadata carries the CI SHA → check posts | ||
| on that SHA. | ||
| - GitOps-managed deployment edit → deployment metadata carries the PR SHA → | ||
| check posts on the deployment PR's SHA. | ||
| - Manual UI preview with no GitHub metadata anywhere → no check posted, just | ||
| UI diff. | ||
|
|
||
| The engine has no `kind` switch; broadcast destinations are inferred from | ||
| metadata present in the plan's snapshots. New notification targets (Slack, | ||
| PagerDuty, etc.) are a new metadata key plus a handler — no engine changes. |
| POST /v1/workspaces/{ws}/deployments/{deploymentId}/plan | ||
| { | ||
| "version_snapshot": { /* version blob (currently deployed or proposed) */ }, | ||
| "deployment_snapshot": { /* deployment blob (current or draft) */ }, | ||
| "targets": [ | ||
| { "environment_id": "...", "resource_id": "..." } |
| - **Schema.** Add `version_snapshot JSONB` and `deployment_snapshot JSONB` | ||
| columns to `deployment_plan`. Backfill existing rows from current state: | ||
| `version_snapshot` from the five `version_*` columns (a clean transform); | ||
| `deployment_snapshot` by reading the deployment by `deployment_id` and | ||
| freezing whatever it looks like at migration time. | ||
| - **Backfill accuracy.** The `deployment_snapshot` backfill is technically | ||
| inaccurate for in-flight plans whose deployment has been edited since | ||
| plan-create. This is acceptable: plans have a bounded `expires_at`, all | ||
| pre-migration plans drain quickly, and the new model only needs to be | ||
| correct going forward. |
Summary by CodeRabbit