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 ecto migration generator for new flags #182

Closed
wants to merge 1 commit into from

Conversation

brain-geek
Copy link

While our feature flags are defined in code, after deployment to new environment someone needs to manually create those with current approach. That is sometimes prone to errors like creating feature-flag instead of Feature-flag or feature_flag, which creates confusion during testing.

To simplify this process, I have added an optional generator to generate new (newly disabled) flag during migration.

It's heavily based on ecto.gen.migration, and should help if you have multiple environments and want to deploy more feature flags.

@tompave
Copy link
Owner

tompave commented Oct 11, 2024

Hello, thank you for using the package and for the PR.

I understand your use case, but I'm not sure this is something I would like to add to the package.

I'm also not convinced that this should be done with a DB migration. In my opinion DB migrations are meant to manage the DB schema, not to manipulate data (with rate exceptions).

If users of the library have this use case, they'd be better off with a custom module/function that sets up all required flags (if they don't exist), and then invoke it when the app supervisor starts. For reference, something similar was discussed in #125 and #119.

More in general, every application's needs are slightly different, and this is a simple enough thing to accomplish that I wouldn't provide one opinionated way to do it. If people think that an Ecto migration is the right thing to do, they can create one.

For now, I thank you for the work and for the proposal, but I must decline the PR.

@tompave tompave closed this Oct 11, 2024
@brain-geek brain-geek deleted the fwf-ecto-gen branch October 11, 2024 23:38
@brain-geek
Copy link
Author

@tompave Thanks a lot for the feedback and for explaining the reasoning behind it.

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