Skip to content

feat(cli): list migrations from registered apps - #649

Open
oxura wants to merge 4 commits into
cot-rs:masterfrom
oxura:feat/624-runtime-migration-list
Open

feat(cli): list migrations from registered apps#649
oxura wants to merge 4 commits into
cot-rs:masterfrom
oxura:feat/624-runtime-migration-list

Conversation

@oxura

@oxura oxura commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Related issue or discussion

Closes #624

Description

cot migration list currently scans src/migrations, which means it has no way to see migrations that come from registered dependency apps. I changed the normal Cot-project path to ask the application for the list instead.

There are two parts to this:

  • Cot applications now have a migration list task that registers the apps and prints every migration they expose. It stops before database setup, so listing does not need a database connection.
  • cot-cli detects a runnable Cot package and delegates to that task through Cargo. The old source scan remains as a fallback for virtual workspace roots and non-runnable packages.

I also added a recursion guard for the Cot workspace itself. Without it, running the command from cot-cli could delegate back into the same binary.

As a smoke test, I generated a fresh project and ran cot migration list against it. The output included the built-in cot and cot_session migrations, neither of which exists in the project source tree.

Type of change

  • Bug fix
  • New feature
  • Documentation
  • Refactor / cleanup
  • Performance improvement
  • Other (describe above)

Checklist

  • I've read the contributing guide
  • Tests pass locally (just test-all)
  • Code passes clippy (just clippy)
  • Code is properly formatted (cargo fmt)
  • New tests added (regression test for bugs, coverage for new features)
  • Documentation (both code and site) updated (if applicable)

Local checks: the full cot package passed (1,345 tests), the cot-cli library and all migration-list unit/snapshot tests passed, and focused clippy passed with warnings denied. The full cot-cli integration run had five logging snapshot mismatches in unrelated new/migration make cases because this terminal emitted raw timestamps instead of the snapshots' filtered TIMESTAMP marker.

@github-actions github-actions Bot added C-cli Crate: cot-cli (issues and Pull Requests related to Cot CLI) C-lib Crate: cot (main library crate) labels Aug 29, 2026
@codecov

codecov Bot commented Aug 29, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.83249% with 22 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cot-cli/src/migration_generator.rs 91.30% 5 Missing and 5 partials ⚠️
cot/src/cli.rs 82.14% 9 Missing and 1 partial ⚠️
cot-cli/src/handlers.rs 66.66% 1 Missing ⚠️
cot-cli/src/utils.rs 95.65% 1 Missing ⚠️
Flag Coverage Δ
rust 90.11% <88.83%> (-0.11%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
cot-cli/src/handlers.rs 94.44% <66.66%> (-1.50%) ⬇️
cot-cli/src/utils.rs 94.67% <95.65%> (+0.66%) ⬆️
cot-cli/src/migration_generator.rs 89.63% <91.30%> (+0.06%) ⬆️
cot/src/cli.rs 86.35% <82.14%> (-0.99%) ⬇️

... and 4 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-cli Crate: cot-cli (issues and Pull Requests related to Cot CLI) C-lib Crate: cot (main library crate)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

migration list command should list migrations in dependecies

2 participants