Repository navigation
fly: describeResources for plan + drift (#767) - #775
Merged
Merged
Conversation
Wire the read-back seam so chant's plan/drift machinery can see live Fly state. The write path (flyApply, #739/#741) already GETs live state to decide create/update/noop and prune owned orphans; this surfaces that same read side through the standard describeResources seam, so buildChangeSet and `chant lifecycle plan` can classify create/update/delete/adopt/noop for Fly. - describeResources lists live flaps resources (apps + machines, volumes, IPs, certs), keyed by chant entity name, with a two-tier ownership verdict (#743): machines per-marker (`managed-by: chant` → owned, else foreign); metadata-less types at the app boundary. Honors the `owned` filter; logs when app-boundary ownership is inferred rather than returning everything. Secrets excluded (D7). - Endpoint + auth reuse the applier's resolveEndpoint (FLY_FLAPS_BASE_URL / FLY_API_TOKEN) verbatim, so plan reads the same target flyApply writes; the update/noop decision reuses configEqual so plan and apply agree. - flyPlan renders the declared-vs-live change set (renderChangeSet) without mutating — an optional dry-run. The safety property is proven live against mudflaps: an unmarked machine reads `foreign` and classifies as `adopt`, never a delete; a removed owned machine is a delete. 90 fly tests pass (6 unit + 1 live integration + existing). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.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.
Closes #767. Wires the read-back seam so chant's plan/drift machinery sees live Fly state — the capability that closes the biggest gap against Terraform.
What
The write path (
flyApply, #739/#741) already reads live state to decide create/update/noop and prune owned orphans. This surfaces that same read side through the standarddescribeResourcesseam, so core'sbuildChangeSetandchant lifecycle plancan classify create/update/delete/adopt/noop for Fly.managed-by: chant→owned, elseforeign); metadata-less types (volumes/IPs/certs) at the app boundary — everything under a chant-managed app isowned. Honors theownedfilter and logs when app-boundary ownership is inferred, per the seam contract. Secrets excluded (D7).resolveEndpoint(FLY_FLAPS_BASE_URL/FLY_API_TOKEN) so plan reads the same target apply writes, andconfigEqualso the update/noop decision agrees with apply.flyPlanrenders the declared-vs-live change set without mutating (optional dry-run).The safety property, proven live against mudflaps
The integration test asserts an unmarked machine is
adoptand never appears as a delete.Verification
90 fly tests pass (6 unit + 1 live mudflaps integration + existing);
validateclean;check-lexiconTier 1 unchanged.Note: core's
chant diffis a build-output-vs-file text diff and doesn't calldescribeResources; the declared-vs-live change-set path ischant lifecycle plan(its handler callsplugin.describeResourcesthenbuildChangeSet), which is what's demonstrated. Core was not touched, so the declared-vs-liveconfigEqualrefinement lives in the fly-sideflyPlanglue.🤖 Generated with Claude Code