Skip to content

feat(cli): implement new-list command for v2 migration system - #248

Merged
joakimbeng merged 2 commits into
v2from
copilot/sub-pr-246
Dec 1, 2025
Merged

feat(cli): implement new-list command for v2 migration system#248
joakimbeng merged 2 commits into
v2from
copilot/sub-pr-246

Conversation

Copilot AI commented Dec 1, 2025

Copy link
Copy Markdown

Implements the new-list command following the v2 plugin architecture pattern established by new-up and new-remove.

Changes

  • packages/cli/src/commands/new-list.ts - List command that iterates migrations calling context.finish() for each. No locking or logging occurs.

  • packages/cli/src/commands/new-list.test.ts - Tests covering:

    • No migration execution
    • No storage locking/unlocking/logging/waiting
    • Command results for various states
    • Plugin callbacks with correct migration states
  • packages/cli/src/tests/plugin.ts - Added 'pending' to MockedFinished type for list command compatibility

Review feedback addressed

  • Use .mockImplementation instead of originalDoneHook variable
  • Add test for assertCommandFailed when there's a failed migration
  • Destructure cwd option and pass to createEmigrateContext

Notes

Returns false when failed migrations exist in history—finish() propagates the error state by design.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@changeset-bot

changeset-bot Bot commented Dec 1, 2025

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 2c7885e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copilot AI commented Dec 1, 2025

Copy link
Copy Markdown
Author

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • telemetry.astro.build
    • Triggering command: /usr/local/bin/node node /home/REDACTED/work/emigrate/emigrate/docs/node_modules/.bin/../astro/astro.js check (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Add new plugin system and migration commands for v2 feat(cli): implement new-list command for v2 migration system Dec 1, 2025
Copilot AI requested a review from joakimbeng December 1, 2025 09:15

@joakimbeng joakimbeng left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot some small things to address

Comment on lines +82 to +86
const originalDoneHook = plugin.hooks['emigrate:migration:done'];
plugin.hooks['emigrate:migration:done'] = mock.fn((parameters) => {
finishOrder.push(parameters.migration.identifier);
return originalDoneHook(parameters);
});

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As plugin.hooks['emigrate:migration:done'] already is a mock function you can use its .mockImplementation method instead of having to use the originalDoneHook variable

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in b044f5e - now using .mockImplementation on the existing mock function.

Comment thread packages/cli/src/commands/new-list.test.ts
Comment thread packages/cli/src/commands/new-list.ts Outdated

Copilot AI commented Dec 1, 2025

Copy link
Copy Markdown
Author

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • telemetry.astro.build
    • Triggering command: /usr/local/bin/node node /home/REDACTED/work/emigrate/emigrate/docs/node_modules/.bin/../astro/astro.js check (dns block)
    • Triggering command: /usr/local/bin/node node /home/REDACTED/work/emigrate/emigrate/docs/node_modules/.bin/../astro/astro.js build (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI and others added 2 commits December 1, 2025 10:44
Co-authored-by: joakimbeng <1427383+joakimbeng@users.noreply.github.com>
Co-authored-by: joakimbeng <1427383+joakimbeng@users.noreply.github.com>
@joakimbeng
joakimbeng marked this pull request as ready for review December 1, 2025 09:48
@joakimbeng
joakimbeng merged commit a75fd95 into v2 Dec 1, 2025
2 checks passed
@joakimbeng
joakimbeng deleted the copilot/sub-pr-246 branch December 1, 2025 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants