feat(cli): implement new-list command for v2 migration system - #248
Conversation
|
|
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:
If you need me to access, download, or install something from one of these locations, you can either:
|
joakimbeng
left a comment
There was a problem hiding this comment.
@copilot some small things to address
| const originalDoneHook = plugin.hooks['emigrate:migration:done']; | ||
| plugin.hooks['emigrate:migration:done'] = mock.fn((parameters) => { | ||
| finishOrder.push(parameters.migration.identifier); | ||
| return originalDoneHook(parameters); | ||
| }); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Fixed in b044f5e - now using .mockImplementation on the existing mock function.
|
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:
If you need me to access, download, or install something from one of these locations, you can either:
|
Co-authored-by: joakimbeng <1427383+joakimbeng@users.noreply.github.com>
Co-authored-by: joakimbeng <1427383+joakimbeng@users.noreply.github.com>
b044f5e to
2c7885e
Compare
Implements the
new-listcommand following the v2 plugin architecture pattern established bynew-upandnew-remove.Changes
packages/cli/src/commands/new-list.ts- List command that iterates migrations callingcontext.finish()for each. No locking or logging occurs.packages/cli/src/commands/new-list.test.ts- Tests covering:packages/cli/src/tests/plugin.ts- Added'pending'toMockedFinishedtype for list command compatibilityReview feedback addressed
.mockImplementationinstead oforiginalDoneHookvariableassertCommandFailedwhen there's a failed migrationcwdoption and pass tocreateEmigrateContextNotes
Returns
falsewhen 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.