-
-
Notifications
You must be signed in to change notification settings - Fork 739
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add potentiallyStale filter (#8784)
This PR adds support for the `potentiallyStale` value in the feature search API. The value is added as a third option for `state` (in addition to `stale` and `active`). Potentially stale is a subset of active flags, so stale flags are never considered potentially stale, even if they have the flag set in the db. Because potentially stale is a separate column in the db, this complicates the query a bit. As such, I've created a specialized handling function in the feature search store: if the query doesn't include `potentiallyStale`, handle it as we did before (the mapping has just been moved). If the query *does* contain potentially stale, though, the handling is quite a bit more involved because we need to check multiple different columns against each other. In essence, it's based on this logic: when you’re searching for potentially stale flags, you should only get flags that are active and marked as potentially stale. You should not get stale flags. This can cause some confusion, because in the db, we don’t clear the potentially stale status when we mark a flag as stale, so we can get flags that are both stale and potentially stale. However, as a user, if you’re looking for potentially stale flags, I’d be surprised to also get (only some) stale flags, because if a flag is stale, it’s definitely stale, not potentially stale. This leads us to these six different outcomes we need to handle when your search includes potentially stale and stale or active: 1. You filter for “potentially stale” flags only. The API will give you only flags that are active and marked as potentially stale. You will not get stale flags. 2. You filter only for flags that are not potentially stale. You will get all flags that are active and not potentially stale and all stale flags. 3. You search for “is any of stale, potentially stale”. This is our “unhealthy flags” metric. You get all stale flags and all flags that are active and potentially stale 4. You search for “is none of stale, potentially stale”: This gives you all flags that are active and not potentially stale. Healthy flags, if you will. 5. “is any of active, potentially stale”: you get all active flags. Because we treat potentially stale as a subset of active, this is the same as “is active” 6. “is none of active, potentially stale”: you get all stale flags. As in the previous point, this is the same as “is not active”
- Loading branch information
1 parent
8935a01
commit 8da201a
Showing
4 changed files
with
162 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters