-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhance ActiveWorkspaceCommand to order, limit and startFrom workspaceId #10378
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This PR enhances the ActiveWorkspaceCommand with pagination and ordering capabilities, while improving error handling for workspace migrations.
- Added
startFromWorkspaceId
option inactive-workspaces.command.ts
to process workspaces starting from a specific ID - Added
workspaceCountLimit
option inactive-workspaces.command.ts
to limit the number of processed workspaces - Changed workspace ordering to use
id
instead ofcreatedAt
inactive-workspaces.command.ts
for consistent pagination - Improved error resilience in
0-42-migrate-rich-text-field.command.ts
by handling failures per workspace instead of stopping entire migration - Ensured proper cleanup of data sources by moving
destroyDataSourceForWorkspace
outside try-catch block
2 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile
'Limit the number of workspaces to process. Workspaces are processed in ascending order of id.', | ||
required: false, | ||
}) | ||
parseWorkspaceCountLimit(val: number): number { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: val parameter should be typed as string since CLI inputs are strings by default. Need to convert to number internally.
parseWorkspaceCountLimit(val: number): number { | |
parseWorkspaceCountLimit(val: string): number { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Could miss a few workspaces if new ones are created after but those probably won't need any command anyway!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a very good improvement
'Start from a specific workspace id. Workspaces are processed in ascending order of id.', | ||
required: false, | ||
}) | ||
parseStartFromWorkspaceId(val: string): string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NItpick: Unless I'm mistaken should be optional
required: false, | ||
}) | ||
parseWorkspaceCountLimit(val: number): number { | ||
this.workspaceCountLimit = val; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: Unless I'm mistaken should validate is > 0 and should be optional
Unless I'm mistaken this might not be an issue as if a new workspace is created it should already be migrated by definition |
…eId (#10378) I have tested it locally with all combinaisons of params
I have tested it locally with all combinaisons of params