Key takeaways
- Give every flag an owner, a purpose, and a retirement date when it is created.
- Treat release flags, experiment flags, and permission flags as different lifecycle classes.
- Define the removal test before the flag is turned on, not after the rollout ends.
- Put flag cleanup in the delivery plan with a named engineer and a review date.
- Report the open flag count at each release review so the backlog stays visible.
Why a flag needs an end date
A feature flag is a temporary branch in production code. It exists to separate deployment from release, or to limit exposure during a rollout. Once the rollout is complete, the branch becomes a second code path that every future change must respect. Without a retirement date, the team keeps paying for a decision it no longer needs. The team should be able to answer who created it, why it exists, and when it should disappear before the next release.
The cost is rarely visible in one ticket. It appears as a test matrix that doubles, a bug that only reproduces with one combination, and a new engineer who cannot tell which path is current. The delivery plan should treat flag removal as planned work with an estimate, not as cleanup for a quiet week. A flag with no date is an unfinished release.
Inventory flags by owner and purpose
Build a list from the flag service and from the code, because neither source is complete on its own. For each flag record the owner, the service, the creation date, and the intended lifetime. Add the default state and the environments where it is active. A list that only shows the flag key is not enough to decide whether the flag can be removed.
Group the flags by purpose rather than by team. Release flags, experiment flags, operational kill switches, and permission flags age differently and need different reviews. A kill switch may stay forever, but its owner and test should still be current. Naming the class makes the retirement conversation specific instead of a general request to clean up. The owner should confirm the class at creation and revisit it whenever the rollout plan changes.
Separate release flags from permission flags
A release flag controls whether a code path is reachable for a population. A permission flag controls whether a user or an account may use a capability. The first should disappear after the rollout, while the second may be a long-lived product control. Mixing them in one inventory hides the flags that were never meant to persist. The inventory should show the class in its own column so a reviewer can filter the two without reading every description.
For a permission flag, record the policy source and the review cadence. Changing the flag should follow the same approval as changing the permission itself. For a release flag, record the rollout percentage and the date it reached full exposure. That date starts the retirement clock, which makes the next review objective rather than a matter of memory. Store that approval beside the flag so the next reviewer does not have to reconstruct it from chat.
Define the removal test
Before the flag is enabled, write down what must be true before the old path can be deleted. The test usually includes a period at full exposure, a clean error rate, and a support window without flag-specific reports. Name the dashboard and the query that prove each condition. A removal criterion written in advance prevents an argument about whether the rollout was stable enough.
Check that the old path is not the only rollback. If removing the flag also removes the ability to turn the feature off, the team needs a separate operational control or a deployment rollback. Record that decision in the plan. The point of retirement is to reduce complexity, not to trade a code branch for an untested emergency procedure. If no such control exists, the plan should name the gap and the owner who accepts it.
Schedule the cleanup in the delivery plan
Give the removal a ticket, an estimate, and a place in the sprint that follows the rollout. A cleanup item that lives only in a backlog grooming document will lose to feature work every time. Assign one engineer who knows the code path and one reviewer who can confirm the old behavior is gone. The estimate should include test updates and documentation changes.
Run the removal as a normal change with a diff that a reviewer can read. Delete the flag, the old branch, the configuration entry, and the tests that only covered the dead path. Leaving the flag definition in the service creates false confidence that the switch still works. Close the ticket only when the inventory reflects reality. A large diff that mixes removal with refactoring is harder to review and easier to revert by accident.
Handle flags that are already stale
Every existing inventory contains flags whose owner has left or whose feature was removed. Do not start by deleting them, because a stale flag may still guard a path that nobody remembers. First confirm the behavior with the flag on and off in a safe environment. Then record the result and assign a temporary owner for the removal. The temporary owner should be a person who can read the code path, not a team name.
A stale flag with no owner is a good candidate for a one-week investigation, not a permanent exception. If the team cannot determine the effect, treat the flag as production code and add the test that proves its behavior. Removing a flag without that evidence simply hides an unknown branch. The inventory should show the unknown state until the evidence exists.
Report the flag count as a signal
Include the number of open flags in the release review, along with the number past their retirement date. The trend matters more than the absolute count. A team that adds flags faster than it removes them is accumulating hidden branching, even when each individual flag looked reasonable. Show the oldest three flags and their owners beside the number. A chart of the count over three releases is usually enough to show whether cleanup keeps pace with creation.
Use the review to remove or re-date the oldest entries rather than to open a general cleanup project. A small, regular removal keeps the inventory trustworthy and gives the offshore pod a visible maintenance habit. The buyer sees the cost of deferred cleanup without needing to read the code. That visibility is often enough to keep the next flag from becoming permanent.
Questions about assessing Philippine developers
Can a flag stay forever?
A kill switch or a permission flag can, if the owner and the review date stay current. A release flag should not, because its purpose ends when the rollout completes.
Who owns flag cleanup?
The team that created the flag owns its removal. The delivery lead tracks the date, and the reviewer confirms that the old path and its tests are gone.
What if the feature may need to be disabled again?
Use a separate operational control with its own test, or keep the flag only if the owner can justify a permanent lifecycle. Record the reason and the review cadence.
