Skip to content

chore: general plans rfc - #1120

Merged
adityachoudhari26 merged 1 commit into
mainfrom
general-plans-rfc
May 11, 2026
Merged

adityachoudhari26 merged 1 commit into
mainfrom
general-plans-rfc

Conversation

@adityachoudhari26

@adityachoudhari26 adityachoudhari26 commented May 11, 2026 •

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • Documentation
    • Added RFC 0013 documentation outlining a proposal to expand deployment triggering capabilities beyond version publishing to include deployment configuration and variable changes.

Review Change Stack

Copilot AI review requested due to automatic review settings May 11, 2026 20:12
@adityachoudhari26
adityachoudhari26 merged commit ebfc3d9 into main May 11, 2026
5 of 6 checks passed
@adityachoudhari26
adityachoudhari26 deleted the general-plans-rfc branch May 11, 2026 20:13
@coderabbitai

coderabbitai Bot commented May 11, 2026 •

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: dea31190-f258-4a8b-88e3-f61f1bc23394

📥 Commits

Reviewing files that changed from the base of the PR and between c2fd344 and 0aff090.

📒 Files selected for processing (1)
  • docs/rfc/0013-generalized-deployment-plans.mdx

Disabled knowledge base sources:

  • Linear integration is disabled

You can enable these sources in your CodeRabbit configuration.


📝 Walkthrough

Walkthrough

RFC 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.

Changes

RFC 0013: Generalized Deployment Plans

Layer / File(s) Summary
RFC Overview and Scope
docs/rfc/0013-generalized-deployment-plans.mdx
RFC 0013 identifier, status, and scope are introduced, defining the goal to generalize plan triggers beyond version-published events while explicitly excluding resource and environment-level plans.
Motivation and Current Limitations Existing plannable/dry-run capabilities motivate the change; current schema and controller assumptions restrict triggers to version-published events, with upstream stage-1 dependency preventing caller scoping.
Proposed Schema: Immutable Snapshots Plan becomes an immutable snapshot with version_snapshot and deployment_snapshot JSONB fields replacing version-specific columns, enabling deployment-edit previews and incremental extension for new trigger types.
API Contract and Stage-1 Simplification API callers supply target scope upfront with a targets list; the endpoint inserts plan and target rows transactionally; stage-1 consumes pre-inserted targets, derives dispatch context from snapshots, persists results, and enqueues stage-2.
Broadcast and Metadata-Driven Behavior GitHub checks and broadcasts remain metadata-driven without engine-kind switching; new notification destinations are handled via metadata and handlers.
Stage-1 Execution Steps Stage-1 flow is simplified to consume targets, derive context from snapshots, persist results, and enqueue stage-2; variable resolution is deferred to open questions.
Migration Plan and Implementation Details Schema adds snapshot columns with backfill from existing rows and deployment state; GetReleaseTargets is replaced with GetPlanTargets and live deployment reads are removed; API handler internals change while agent and lifecycle operations remain unchanged.
Open Design Questions Unresolved decisions include whether plans should be fully generic or deployment-scoped, how variable resolution reconciles snapshot immutability with engine-dependent needs, and whether trigger identity is keyed via plan.metadata or an explicit indexed column.
Adjacent Considerations Plan deduplication for rapid edits and result retention/expiry strategies are discussed, with decisions pending on whether variation by trigger type is necessary or uniformity is preferred.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

🐰 A snapshot in time, so clear and so bright,
Plans dance freely from dawn until night.
No version-walls bind what deployment can do—
Stages and targets now flow crystal-blue.
One RFC to rule them all,
Generalized beauty, standing tall! 🎯

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch general-plans-rfc

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_plan model (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.

Comment on lines +123 to +136
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.
Comment on lines +92 to +97
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": "..." }
Comment on lines +153 to +162
- **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.
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.

2 participants