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: Make disableMigration option handled by environment variable #8634

Merged

Conversation

0417taehyun
Copy link
Contributor

About the changes

Closes #

Important files

Discussion points

In some cases, people want to disable database migration. For example, some people or companies want to grant whole permissions to handle the schema by DBAs, not by application level hence I use parseEnvVarBoolean to handle disableMigration option by environment variable. I set the default value as false for the backward compatibility.

However, I wonder where to add test code of it because all the unit and e2e test is a kind of testing the whole configuration.

Copy link

vercel bot commented Nov 4, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
unleash-monorepo-frontend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 5, 2024 10:09am

Copy link

vercel bot commented Nov 4, 2024

@0417taehyun is attempting to deploy a commit to the unleash-team Team on Vercel.

A member of the Team first needs to authorize it.

@gastonfournier
Copy link
Contributor

gastonfournier commented Nov 5, 2024

Hi @0417taehyun I think this makes sense because this is already a configurable option. There's a linting issue you should just run yarn lint:fix.

Regarding testing, we test that after the migrations applied Unleash works well, if migrations are not applied there's no guarantee that Unleash will work well and most likely it won't work, so I don't think there's need to test this. Maybe the only thing that comes to mind is testing that when this is disabled the migrations are not executed.

Maybe just checking if this log is written:

if (config.db.disableMigration) {
logger.info('DB migration: disabled');

But to be honest, I'm ok if you don't test this

@0417taehyun
Copy link
Contributor Author

@gastonfournier

Thanks for answering my question and checking linting issue! I fixed the issued by using yarn lint:fix and check the DB migration: disabled log. I also agree that it is okay not to test about this logic. Thanks!

Copy link
Contributor

@gastonfournier gastonfournier left a comment

Choose a reason for hiding this comment

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

Looks good! Thanks for the contribution!

@gastonfournier gastonfournier merged commit ef8417a into Unleash:main Nov 5, 2024
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants