Conversation
- Add --dry-run and --format flags to `wfctl infra apply` - Add --dry-run and --format flags to `wfctl ci run` (deploy phase) - Dry-run uses same planning logic (parseInfraResourceSpecsForEnv, computePlanForInfraSpecs) as real apply path - Structured JSON output format for CI automation - Security-aware: shows secret keys but never prints values - Prints provider groups, resource actions, health-check plan, pre-deploy steps, and deploy target naming - Add 7 new tests covering table/JSON output, env resolution, secret safety, and planning logic equivalence - Update docs/WFCTL.md with new flags and examples Agent-Logs-Url: https://github.com/GoCodeAlone/workflow/sessions/abd214b9-ada7-4c1c-ae4b-4a8e8c10421d Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add dry-run support for wfctl infra apply and CI deploy
Add --dry-run support for wfctl infra apply and ci run --phase deploy
May 5, 2026
⏱ Benchmark Results✅ No significant performance regressions detected. benchstat comparison (baseline → PR)
|
Comment on lines
+1090
to
+1091
| // --dry-run: compute and display the plan without executing any mutations. | ||
| if dryRun { |
Comment on lines
+241
to
+249
| for _, entry := range cfg.Secrets.Entries { | ||
| store := "" | ||
| if entry.Store != "" { | ||
| store = entry.Store | ||
| } | ||
| refs = append(refs, DryRunSecretRef{ | ||
| Key: entry.Name, | ||
| Store: store, | ||
| Required: true, |
Comment on lines
+108
to
+109
| fmt.Print(formatPlanTable(plan, showSensitive)) | ||
| fmt.Println() |
Comment on lines
+83
to
+87
| switch format { | ||
| case "json": | ||
| return printDryRunJSON(cfgFile, envName, plan, providerGroups, secretRefs) | ||
| default: | ||
| return printDryRunTable(cfgFile, envName, plan, providerGroups, secretRefs, showSensitive) |
Comment on lines
+209
to
+217
| for _, entry := range cfg.Secrets.Entries { | ||
| store := "" | ||
| if entry.Store != "" { | ||
| store = entry.Store | ||
| } | ||
| refs = append(refs, DryRunSecretRef{ | ||
| Key: entry.Name, | ||
| Store: store, | ||
| Required: true, |
Contributor
|
@copilot apply changes based on the comments in this thread |
- Gracefully handle state-load failure in infra apply dry-run (treat missing/inaccessible backend as empty rather than aborting) - Use ResolveSecretStore for both infra and CI deploy secret collection so env secretsStoreOverride / defaultStore / legacy provider are honored - Resolve deploy target via env-resolved wfCfg infra module names, mirroring newPluginDeployProvider's lookup logic (fixes bmw-staging) - Fall back to module config image field when IMAGE_TAG is unset, matching pluginDeployProvider.Deploy behavior - Fix countActions to include 'replace' and add ± symbol for replace actions; update formatPlanTable and formatPlanMarkdown summaries - Reject unknown --format values with an explicit error (no silent fallback) - Use config.LoadFromFile in ci run deploy dry-run path to honor imports: - Include --config path in follow-up command hint Agent-Logs-Url: https://github.com/GoCodeAlone/workflow/sessions/b7c35821-d464-4ebb-93e4-5f9eb8f5ab40 Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>
Contributor
Author
All 10 review issues addressed in commit 5ac0199:
|
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.
wfctl infra applyandwfctl ci run --phase deployhad no way to preview operations without executing provider mutations. This made it impossible to safely validate the exact apply/deploy path locally before committing to real cloud changes.Changes
cmd/wfctl/infra.go— Add--dry-runand--formatflags torunInfraApply; early-exit to dry-run path before confirmation/bootstrapcmd/wfctl/infra_apply_dryrun.go— Dry-run implementation reusingparseInfraResourceSpecsForEnv+computePlanForInfraSpecs(same planning logic as real apply), outputs provider groups, plan actions, and required secret keys (never values)cmd/wfctl/ci_run.go— Add--dry-runand--formatflags; route deploy phase to dry-run when setcmd/wfctl/ci_run_dryrun.go— Deploy dry-run showing environment, provider, strategy, deploy target, image ref/source, pre-deploy steps, health-check plan, and secret keyscmd/wfctl/dryrun_test.go— 7 tests: table/JSON output for both commands, env-resolved naming (bmw-staging), secret value non-leakage, planning logic equivalencedocs/WFCTL.md— Updated flag tables and examplesUsage
JSON output includes structured
actions,providers,secrets(keys only), andsummaryfields suitable for parsing in GitHub Actions / GitLab / Jenkins pipelines.