Skip to content
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

Add upgrade 0.35 command module #9175

Merged
merged 3 commits into from
Dec 20, 2024
Merged

Add upgrade 0.35 command module #9175

merged 3 commits into from
Dec 20, 2024

Conversation

Weiko
Copy link
Member

@Weiko Weiko commented Dec 20, 2024

Moving commands from 0.40 to 0.35 since they should be ready for 0.35.

Copy link
Contributor

@greptile-apps greptile-apps bot left a 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 reorganizes database upgrade commands by moving several data structure modifications from version 0.40 to 0.35, creating a clearer separation between schema changes and data migration.

  • Critical bug: Incorrect version number in logging message in 0-35-upgrade-version.command.ts references version 0.40 instead of 0.35
  • Redundant TypeOrmModule registration for FieldMetadataEntity in 0-40-upgrade-version.module.ts
  • Missing error handling in sequential command execution in 0-35-upgrade-version.command.ts could leave database in inconsistent state
  • Clearer upgrade path: schema changes in 0.35 (columns, positions) followed by data migration in 0.40

8 file(s) reviewed, 4 comment(s)
Edit PR Review Bot Settings | Greptile

Comment on lines 35 to 37
this.logger.log(
'Running command to upgrade to 0.40: must start with phone calling code otherwise SyncMetadata will fail',
);
Copy link
Contributor

Choose a reason for hiding this comment

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

syntax: Log message incorrectly references version 0.40 instead of 0.35

Suggested change
this.logger.log(
'Running command to upgrade to 0.40: must start with phone calling code otherwise SyncMetadata will fail',
);
this.logger.log(
'Running command to upgrade to 0.35: must start with phone calling code otherwise SyncMetadata will fail',
);

'Running command to upgrade to 0.40: must start with phone calling code otherwise SyncMetadata will fail',
);

await this.recordPositionBackfillCommand.executeActiveWorkspacesCommand(
Copy link
Contributor

Choose a reason for hiding this comment

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

style: No error handling around sequential commands. If one fails, database could be left in inconsistent state. Consider wrapping in try/catch with rollback capability.

Comment on lines 24 to 27
[ObjectMetadataEntity, FieldMetadataEntity],
'metadata',
),
TypeOrmModule.forFeature([FieldMetadataEntity], 'metadata'),
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: FieldMetadataEntity is imported twice in TypeOrmModule.forFeature(). Remove the duplicate import on line 27.

Comment on lines 31 to 33
await this.phoneCallingCodeMigrateDataCommand.executeActiveWorkspacesCommand(
passedParam,
options,
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: log message still references 0.40 but some commands were moved to 0.35

@Weiko Weiko merged commit 03f8979 into main Dec 20, 2024
22 checks passed
@Weiko Weiko deleted the c--add-0.35-upgrade-command branch December 20, 2024 17:18
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