Skip to content

feat(cli): #200 migrate status command#216

Merged
JerrettDavis merged 2 commits into
mainfrom
feat/200-cli-status
May 28, 2026
Merged

feat(cli): #200 migrate status command#216
JerrettDavis merged 2 commits into
mainfrom
feat/200-cli-status

Conversation

@JerrettDavis

Copy link
Copy Markdown
Owner

Summary

  • Implements CLI: migrate status command #200: new wrap-god migrate status subcommand that reads <schema>.state.json without running any migration
  • Human-readable and --json output modes with --verbose per-rule detail flag
  • Exit codes: 0 (no manual), 2 (manual entries present), 1 (corrupt state / missing schema)
  • Highlights <state> synthetic SkippedRewrite entries from corruption-recovery runs (Migration Engine: State tracking (state file, idempotent re-runs) #197)
  • Schema hash mismatch warning when schema has changed since last apply
  • --project flag for relative --schema resolution

Test plan

  • 17 TinyBDD scenarios in MigrateStatusCliTests.cs, all green
  • Happy-01: applied/skipped/manual counts in stdout, exit 2
  • Happy-02: --json parses as JSON with applied/skipped/manual fields
  • Happy-03: zero manual exits 0
  • Happy-04: manual present exits 2
  • Happy-05: --verbose includes per-rule IDs from all three lists
  • Sad-01: missing state file exits 0 with "No migration runs recorded"
  • Sad-02: corrupt state exits 1 with corrupt/invalid mention
  • Sad-03: missing schema path exits 1
  • Sad-04: missing --schema flag exits non-zero
  • Edge-01: schema hash mismatch warns "schema has changed"
  • Edge-02: empty state (0/0/0) exits 0
  • Edge-03: manual rule with empty MatchedFiles shows "(no files matched yet)" placeholder
  • Edge-04: --json with no state outputs { "status": "no-runs-recorded" }
  • Edge-05: <state> synthetic SkippedRewrite outputs recovery mention
  • Edge-06: --help lists --schema and --json
  • Edge-07: corrupt state mentions .bak/backup/archived/corrupt
  • Edge-08: --project resolves relative --schema
  • CliCommandTests.cs: ExpectedMigrateCommands updated to include status
  • Full suite: 789 passed, 0 failed, 1 skipped (NuGet network), build -warnaserror clean

Generated with Claude Code

Implements wrap-god migrate status reading <schema>.state.json without running migrations.

- --schema, --project, --json, --verbose flags
- Human-readable summary with per-rule grouping
- JSON summary for tooling
- Exit codes: 0 no-manual, 2 manual present, 1 corrupt/schema-missing
- Highlights <state> synthetic SkippedRewrite for corruption-recovery awareness
- 17 TinyBDD scenarios (all green)
- docs/guide/cli.md updated with migrate status section
- docs/migration/state.md cross-linked
- WrapGod.Cli.csproj: added WrapGod.Migration.Engine project reference
- CliCommandTests.cs: added status to ExpectedMigrateCommands

Closes #200

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions

github-actions Bot commented May 28, 2026

Copy link
Copy Markdown

⚠️ Deprecation Warning: The deny-licenses option is deprecated for possible removal in the next major release. For more information, see issue 997.

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@github-actions

github-actions Bot commented May 28, 2026

Copy link
Copy Markdown

Test Results

792 tests   791 ✅  2m 17s ⏱️
  1 suites    1 💤
  1 files      0 ❌

Results for commit da540c4.

♻️ This comment has been updated with latest results.

…project-dir alignment

Addresses review on PR #216:
- Adds progressPct + library/from/to to JSON output per plan
- Adds "N / M rules applied (P%)" line in human output (or "n/a" when 0 rules)
- Renames --project to --project-dir to match plan and #199 sibling command
- Adds Status_ZeroRules_HandlesNa test scenario
- Adds Status_ProgressRatio_PopulatedWhenTotalRulesNonZero test scenario
- Help test verifies --verbose and --project-dir present
- TODO comment in CliCommandTests.ExpectedMigrateCommands for #199 coordination
- Drops JsonIgnoreCondition.WhenWritingNull so progressPct/library/from/to are
  emitted as explicit null when not applicable (tooling distinguishes missing vs n/a)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions github-actions Bot added size/xl and removed size/l labels May 28, 2026
@JerrettDavis JerrettDavis merged commit 2cd196a into main May 28, 2026
12 checks passed
@JerrettDavis JerrettDavis deleted the feat/200-cli-status branch May 28, 2026 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant