Closed dzucconi closed 1 year ago
Nice. Love the naming convention idea! On the TX team, we use Unleash flags in Force, but also Exchange, Pulse, and Volt. So our flag "private_sales_checkout" would need to remain active as it's being used in Volt and Exchange.
Good initiative! I'm a big fan of the 'avoid' section.
Regarding the maintenance / end-of-life of specific feature flags, I think creating a ticket is too free-form. More productized solutions for a/b-testing and rolling out features allow the user to set an 'expiry date'. With Unleash already highlighting which flags are active, could we agree on removing stale flags after a certain while?
What would the expiry date do though?
Unleash doesn't accurately report which flags are active because, due to the way it's integrated right now, we request all the flags.
@dzucconi - might be worthwhile to expand or do a follow-up on how we could revise Force's implementation so that we don't request everything on every request. Might be simple to fix.
Most of this sounds reasonable. This bit runs contrary to my thinking:
Do not share flags across different apps. If you need a flag for the same feature in both Volt and Force, then create separate flags for each application.
Toggling platform-wide features on/off, segmenting consistently for split tests, or granting access based on other criteria (user, environment, subscription tier, etc.) was always the intent of this shared feature-toggling service. We tend to roll out features to one client at a time, but I'd rather our conventions not assume a toggle applies to one client.
@joeyAghion what about listing the relevant apps in the prefix: force-volt-exchange_tx_private-sales-checkout
?
I suppose I find it surprising that a feature would have to be toggled across multiple apps but I see your point.
@dzucconi TX frequently works across multiple apps and we could separate them by app, but this would make it challenging to keep user id access consistent across all the flags. Adding all apps in the prefix as you suggested would be my preference.
I really like the idea and the proposal, except that the underscore-dash notation looks a bit weird, but I understand the sense behind it. I just wish there was a prettier way to write this. Depending on in which programming language we are writing the names I would prefer only underscore or something else.
Thanks for raising this @dzucconi . I totally agree with this. I took a look at all the CX available flags and we removed all code related to them.
About the flags naming, I don't have any strong preferences there, only suggestion I have is to ensure the naming by either checking the name added on Forque or even better generate the name using the UI. For example if you select, CX, Force, My Collection the feature flag created will be CX-Force-My-Collection
Agreed with most everything but also seconding the point that there can be a flag in multiple apps - and especially when it's to do with experiments you want the certitude of referring to the same set. In a previous life, we enabled PMs to also turn flags on and off. I guess with the new admin, it's easy enough to add these kinds of controls so you don't need to let them at unleash. I very much like the approach of create the ticket to remove as part of the completion. I was once at a talk where Uber talked about the amount of dead code behind unused feature flags and it's indeed a cognitive burden and they have a tool for that. I think given our size just good hygiene probably suffices.
what about listing the relevant apps in the prefix
I like the team prefix. Seems like an immediate win to have each flag/toggle explicit owned by a product team and documented within the flag/toggle name.
Unleash also supports toggle descriptions and tags. I wonder if we could include the intended system consumers in the description (systems: force, gravity
) or as individual tags (system:force
, system:gravity
)? That might also give some flexibility to add/remove a system as the use of a shared flag expands/contracts.
I'm all for documenting these things somewhere but I'm not yet sold on the constraint that they have be documented within the flag/toggle name itself if we have other mechanisms available.
Thanks to everyone for the feedback. I've updated the description incorporating it. I'm going to close this for now and:
Feature flags are permutation & complexity time bombs and, as such, there should be some urgency to get them out of the codebase. They have their purpose and we shouldn’t be afraid of using them — but I think they hang around the codebase and in Unleash for far too long.
There’s currently no real process for maintaining them and due to the way we’ve implemented both creation and exposing them to the application, we have no way of knowing what’s active and in use or who created them in the first place.
Naming Convention
{team}_{feature-name}
Examples
The prefix of the team makes it easy to understand who to talk to when interfacing with a flag in a codebase you’re working in.
Avoid when naming:
Descriptions
Include a description of the functionality that the flag enables. Include additional metadata specifying the systems it targets, the team that owns it and the developer who created it.
The additional metadata here attempts to make maintenance easier, allowing for understanding which systems might be affected by the removal or modification of a flag.
Example
Maintenance
Proposal
When creating a feature flag, concurrently you should also create a ticket to remove it.
How is this RFC resolved?