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] allow creating a flag with a specific ID #286

Closed
sesquipedalian-dev opened this issue Aug 29, 2019 · 4 comments
Closed

[feat] allow creating a flag with a specific ID #286

sesquipedalian-dev opened this issue Aug 29, 2019 · 4 comments

Comments

@sesquipedalian-dev
Copy link
Contributor

Request adding the ability to create a flag with a specific ID, and/or modify the ID after the fact. When developing against Flagr, I may want to test a flag in multiple environments and we sometimes hardcode the flag ID to check. I would want to be able to set up a local flagr to use the same IDs as a production environment. Possibly this is somewhat low priority because you can export / import as a workaround.

Expected Behavior

Add an 'id' field to relevant CRUD methods for Flag in the API, and make it editable in the UI.

Current Behavior

The id is set automatically when creating a flag, and can't be changed.

Possible Solution

Might need to make the flag ID that is visible in the API a different field than the actual database ID.

Steps to Reproduce (for bugs)

Create a flag, observe the ID that is used in the evaluation API can't be edited.

Context

I start a local instance of the flagr docker to test some code that uses flagr's evaluation API. To do this I need to temporarily edit the flag ID used by my code.

@wesleimp
Copy link
Contributor

I think changing the ID is a weird behavior. What do you think about add another field in database named number, for example, and then you add a common number for all environments. May this number can be created automatically and can be updated whenever you want.

@zhouzhuojie
Copy link
Collaborator

I think we already have flagKey and variantKey, and those are sufficient enough for referring to the same flag and same variant in multiple environments (assuming you want to create/update them with the same keys). IDs are required to be immutable for flagr records' analytics.

@wesleimp
Copy link
Contributor

I think we already have flagKey and variantKey, and those are sufficient enough for referring to the same flag and same variant in multiple environments (assuming you want to create/update them with the same keys). IDs are required to be immutable for flagr records' analytics.

@zhouzhuojie Sure.

Following your comment, can we close this issue?

@sesquipedalian-dev
Copy link
Contributor Author

Closing this works for me! After digging into the tools available more, I can use flagKey or entityContext to get what I need done just fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants