[AS-222] Tech note: Ephemeral environments with GraphOS - #39
Conversation
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
The doc structure and lifecycle framing are solid and the per-PR variant pattern is the right approach. One blocking issue: the teardown command is wrong.
rover variant delete is not a real Rover command. To delete a variant you use rover graph delete my-graph@<variant> --confirm, which deletes the variant and all its subgraphs. This is load-bearing: the teardown step is a core acceptance criterion, and a CI job running rover variant delete will fail. The command appears twice (the topology diagram and Step 1).
Secondary correctness issue on the same teardown block: the comment claims the delete is "idempotent: safe to run if the variant was never created." rover graph delete returns a non-zero exit on a nonexistent variant, so a re-run (or a closed PR whose variant never got created) will fail the cleanup step. Either guard the step (e.g. || true, or check existence first) or drop the idempotency claim.
Minor (non-blocking): the prose uses em dashes in several places (lines 5, 47, 64, 116); Apollo docs style prefers avoiding them. Worth a pass before this gets upstreamed.
Fix the variant-delete command and the idempotency note and this is good to merge as the interim reference.
| ``` | ||
|
|
||
| The variant key (`pr-<number>`) is the contract between CI and infrastructure. Use the GitHub-provided `PR_NUMBER`, not a sha or branch name, so re-pushes still target the same variant. | ||
|
|
There was a problem hiding this comment.
rover variant delete is not a real command. Use rover graph delete my-graph@pr-${PR_NUMBER} --confirm (deletes the variant and all its subgraphs). Also, the comment above says this is idempotent/safe when the variant was never created, but rover graph delete exits non-zero on a missing variant and will fail the CI teardown step; guard it (e.g. || true) or remove the idempotency claim.
There was a problem hiding this comment.
Verified at 81f0912: Step 1 teardown now uses rover graph delete my-graph@pr-${PR_NUMBER} --confirm || true, and the surrounding comment correctly states the command exits non-zero on a missing variant and is guarded with || true rather than claiming idempotency. This thread can be resolved.
| deploy subgraph services on pr-142.example │ | ||
| comment PR with the env URL │ | ||
| │ | ||
| PR merged / closed ──► tear down namespace ──► rover variant delete pr-142 |
There was a problem hiding this comment.
Same command error in the diagram: rover variant delete should be rover graph delete.
There was a problem hiding this comment.
Verified at 81f0912: the topology diagram teardown line now reads rover graph delete my-graph@pr-142, matching the corrected Step 1 command. This thread can be resolved.
Address docs-reviewer feedback. `rover variant delete` is not a real command; deleting a variant uses `rover graph delete my-graph@<variant> --confirm` (which removes the variant and all its subgraphs). Also correct the idempotency claim: `rover graph delete` exits non-zero on a missing variant, so guard the teardown step with `|| true` (or skip it when no variant was created for the PR). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Re-reviewed at 81f0912. The blocking teardown issue from the prior review is fully fixed. rover variant delete is gone in both locations: the topology diagram now uses rover graph delete my-graph@pr-142, and Step 1 uses rover graph delete my-graph@pr-${PR_NUMBER} --confirm. The idempotency claim has been corrected; the comment now notes the command exits non-zero on a missing variant and the step is guarded with || true. Acceptance criterion (working teardown) is met and no new blockers. The non-blocking em dash note still applies in a few spots and can be cleaned up before upstreaming, but it does not gate this interim reference. Approving.
Summary
Adds
docs/ephemeral-environments.md— a reference for the per-PR variant pattern (one GraphOS variant per pull request, ephemeral Router + subgraphs deployed against it, automatic cleanup on PR close).Covers: topology diagram,
roverlifecycle commands keyed on PR number, Router pointed at the per-PR variant viaAPOLLO_GRAPH_REF, PR-comment URL plumbing, required API key scopes, and cost/quota gotchas (usage reporting from PR routers polluting prod dashboards, variant limits on usage-based plans).Tracks AS-222.
Note
Placement: apollographql/docs archived, apollographql/platform-docs needs SAML grant. Landing in
apollosolutions/reference-architecture/docs/as interim home.Test plan
rovercommands match current CLI surface🤖 Generated with Claude Code