openflagr/flagr

[Feature] Add flag name and be able to search by name

cszczepaniak opened this issue · 4 comments

Expected Behavior

Right now to find flags, you either need to know the ID or search by description. Two flags can have the same description. It may be useful for a flag to have a unique name that can be used to fetch a flag from the API.

Current Behavior

Right now, you can either fetch the flag by ID, or search flags by description, but description isn't guaranteed unique.

Possible Solution

Add name to the flag entity and an endpoint to get flags by name.

Context

Right now to get around this, I find flags by description, but when doing so, there's a possibility that I may get multiple flags back because description isn't guaranteed to be unique. Also, being forced to search by description, we give up the option to actually give flags a real description.

I'm happy to work on this and open a PR if it's something you'd like added.

Wouldn't this be the same as Flag Key? It is unique, can be changed to something human-readable like a name, and the API to search by it is available (though having that in the UI would be nice).

Can be changed to something human-readable? Can the key be edited? Otherwise, if I'm consuming the API, I would need to know the key of the flag I'm looking for. Either that, or I'd have to store a mapping of name to key on my side to lookup a flag by name.

Yeah, the key can be edited.
Screen Shot 2020-12-10 at 10 29 29 AM

Then consider this issue irrelevant!