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

chore(flags): stop checking clickhouse for feature flag status endpoint #26951

Merged
merged 4 commits into from
Dec 16, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions posthog/models/feature_flag/flag_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class FeatureFlagStatus(StrEnum):
# - ACTIVE: The feature flag is actively evaluated and the evaluations continue to vary.
# - STALE: The feature flag has been fully rolled out to users. Its evaluations can not vary.
# - INACTIVE: The feature flag is not being actively evaluated. STALE takes precedence over INACTIVE.
# NOTE: This status is not currently used, but may be used in the future to automatically archive flags.
havenbarnes marked this conversation as resolved.
Show resolved Hide resolved
# - DELETED: The feature flag has been soft deleted.
# - UNKNOWN: The feature flag is not found in the database.
class FeatureFlagStatusChecker:
Expand All @@ -49,10 +50,6 @@ def get_status(self) -> tuple[FeatureFlagStatus, FeatureFlagStatusReason]:
if is_flag_fully_rolled_out:
return FeatureFlagStatus.STALE, fully_rolled_out_explanation

# Final, and most expensive check: see if the flag has been evaluated recently.
if self.is_flag_unevaluated_recently(flag):
return FeatureFlagStatus.INACTIVE, "Flag has not been evaluated recently"

return FeatureFlagStatus.ACTIVE, "Flag is not fully rolled out and may still be active"

def is_flag_fully_rolled_out(self, flag: FeatureFlag) -> tuple[bool, FeatureFlagStatusReason]:
Expand Down
Loading