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

feat: workspace:health nullable fix #3882

Merged
merged 1 commit into from
Feb 8, 2024

Conversation

magrinj
Copy link
Member

@magrinj magrinj commented Feb 8, 2024

This PR is implementing the nullable kind in the --fix option of workspace:health command.
The core was created here #3863

Fix #3840

Copy link

github-actions bot commented Feb 8, 2024

TODOs/FIXMEs:

  • // TODO: Implement nullable fix: packages/twenty-server/src/workspace/workspace-health/services/workspace-fix-nullable.service.ts

Generated by 🚫 dangerJS against ded5220

@@ -188,16 +188,6 @@ export class RelationMetadataHealthService {
});
}

if (relationColumn.isNullable !== relationFieldMetadata.isNullable) {
Copy link
Member Author

Choose a reason for hiding this comment

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

Not needed as we're checking nullability on foreign keys in the field check

import { kebabCase } from 'src/utils/kebab-case';

@Injectable()
export class CommandLogger {
Copy link
Member Author

Choose a reason for hiding this comment

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

Create some command logger logic here that can be shared between commands

this.logger.log('Running in dry run mode, rolling back transaction');

await queryRunner.rollbackTransaction();

await this.workspaceLogsService.saveLogs(storage, workspaceMigrations);
Copy link
Member Author

Choose a reason for hiding this comment

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

Move creation of logs file inside command, doesn't feel to be the correct place directly in the services

@magrinj magrinj marked this pull request as ready for review February 8, 2024 11:15
}

try {
await fs.writeFile(
Copy link
Member

Choose a reason for hiding this comment

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

Should we use fileUploadService here to write to S3 on prod env?

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

@Weiko Already discussed with @charlesBochet, when I've implemented it. As it's only here to write logs of command, we don't want to store this in s3, just locally :)

Copy link
Member

@Weiko Weiko left a comment

Choose a reason for hiding this comment

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

LGTM!

@magrinj magrinj merged commit d3fe1b9 into main Feb 8, 2024
12 of 13 checks passed
@magrinj magrinj deleted the feat/workspace-health-nullable-fix branch February 8, 2024 17:22
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.

feat: add ability to fix nullability conflicts to workspace:health-check command
2 participants