feat(cigen): per-phase secret scoping + migration --format json/--env#805
Merged
Conversation
…er-phase secret scoping + #4 migration flags Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- C1/C2: new tests in internal package cigen files (analyze_phase_test.go, render_gha_phase_test.go) — unexported funcs reachable, own config/strings imports - C3: Task 5 regen uses REAL ci plan/generate flags (--out, --write; no --stdout/--format/--output-dir) per GAP.md recipe - Important: add on-disk golden test (multisite_evidence_test.go) locking the committed evidence - note pre-existing render tests survive (Contains-asserts) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…s to *_phase_test.go) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… --format json) + on-disk golden test; honest GAP.md
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
⏱ Benchmark Results✅ No significant performance regressions detected. benchstat comparison (baseline → PR)
|
intel352
added a commit
that referenced
this pull request
May 31, 2026
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.
What
Two fidelity fixes to
cigen's GitHub Actions output, narrowing measured gaps vs the hand-tuned multisite workflow (follow-on to v0.67.0; closes the two gaps recorded incigen/testdata/multisite/GAP.md):Analyzenow loads the prereq config fromopts.PhaseConfigand runs the existingderiveSecretsper config, so each apply job'senv:carries only the secrets that phase's config references.DeployPhasegainsSecrets []SecretRef+Scoped bool; the renderer branches itsenv:source onphase.Scoped(a scoped-but-empty phase emits no block; an unscoped/unloadable phase falls back to the plan-wide union). Measured effect on multisite:apply-prereqdrops 6 deploy-only secrets (inclMULTISITE_DB_URL);apply-deployis unchanged.wfctl migrations upnow always emits--format json(machine-readable; matches the deployed workflow).--env <env>is derived only when exactly oneci.migrations[0].environmentskey exists; ≥2 → omitted + aWarnings[]note. Multisite declares noenvironments:, so it correctly gets--format jsonand no--env— honest, not faked.Both flags verified to exist on the real
runMigrationsUp(cmd/wfctl/migrations.go:--env,--format text|json).Scope / non-goals
GHA only (GitLab/Jenkins/CircleCI untouched). No plugin release —
wfctl ci generategets the fix directly; the ci-generator plugin picks it up on its next workflow-dep bump.DeployPhase.{Secrets,Scoped}are additive (json:",omitempty") — oldplan.jsonconsumers unaffected.Evidence (demonstration-fidelity)
cigen/testdata/multisite/{plan.json,generated-infra.yml}regenerated with the realwfctl ci plan/ci generatebinary (recipe inGAP.md). A new on-disk golden test (cigen/multisite_evidence_test.go) reads the committedgenerated-infra.ymland asserts:apply-prereqenv lacksMULTISITE_DB_URL,apply-deploykeeps it,--format jsonpresent, no--env.GAP.mdupdated honestly —--envstays in "not derivable" for multisite.Verification
GOWORK=off go test ./cigen/...— green (38 tests, incl 4 new internal-package test files + the on-disk golden)GOWORK=off go build ./cmd/wfctl— exit 0GOWORK=off golangci-lint run --new-from-rev=origin/main ./cigen/...— 0 issuesPipeline
Full autodev pipeline: design adversarial PASS (2 cycles) → plan adversarial PASS (2 cycles; caught the test-package/compile + fictional-CLI-flag traps) → alignment PASS → scope-lock → implement → code review PASS. Design + plan + lock included.
Rollback
Revert the PR;
wfctl ci generatereverts to union-scoping + bare-migrations output. No release, no migration, no state.🤖 Generated with Claude Code