-
Notifications
You must be signed in to change notification settings - Fork 184
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
Remove unused feature flags #2136
Conversation
@@ -70,14 +70,12 @@ def valid_available_subdomain(subdomain, *args, **kwargs): | |||
|
|||
|
|||
def default_server_storage(): | |||
return datetime.now(timezone.utc) > settings.PREMIUM_RELEASE_DATE | |||
return True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I kept this since a migration (specifically 0029_profile_add_deleted_metric_and_changeserver_storage_default.py
for the emails
app) pointed to this function as the one to generate a default value. Not sure if there's a better way to do that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: Add a comment like "This historical function is referenced in migration 0029_profile_add_deleted_metric_and_changeserver_storage_default"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea: a12cf6b
@@ -67,15 +67,6 @@ environment variables to the outside world. You can extend this endpoint in | |||
using the `useRuntimeData` hook; you can find this in | |||
`/frontend/src/hooks/api/runtimeData.ts`. | |||
|
|||
## Add a feature flag |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC Se Yeon is writing docs on how feature flagging with Waffle will be done, so I didn't include replacement docs for this.
@@ -4,7 +4,7 @@ export type RuntimeDataWithWaffle = RuntimeData & { | |||
WAFFLE_FLAGS: RuntimeData["WAFFLE_FLAGS"]; | |||
}; | |||
|
|||
export function flagIsActive( | |||
export function isFlagActive( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I renamed this to be aligned with other function names (i.e. start with a verb, is
if it returns a boolean) because I couldn't find this function at first, but since we don't have an explicit guideline for that anyway, I'm happy to drop this commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally, this makes sense to me. +1 from me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Vinnl! I love cleaning up old code!
I've got some suggestions, and we need the migration for the updated model.
@@ -70,14 +70,12 @@ def valid_available_subdomain(subdomain, *args, **kwargs): | |||
|
|||
|
|||
def default_server_storage(): | |||
return datetime.now(timezone.utc) > settings.PREMIUM_RELEASE_DATE | |||
return True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: Add a comment like "This historical function is referenced in migration 0029_profile_add_deleted_metric_and_changeserver_storage_default"
@@ -102,7 +100,7 @@ class Profile(models.Model): | |||
db_index=True, | |||
validators=[valid_available_subdomain], | |||
) | |||
server_storage = models.BooleanField(default=default_server_storage) | |||
server_storage = models.BooleanField(default=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will require a migration, please run ./manage.py makemigrations; black .
and add the new / changed files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, thanks, I did not know that! a1cd4e6
emails/models.py
Outdated
@@ -303,7 +301,7 @@ def emails_replied(self): | |||
@property | |||
def joined_before_premium_release(self): | |||
date_created = self.user.date_joined | |||
return date_created < settings.PREMIUM_RELEASE_DATE | |||
return date_created < datetime.fromisoformat('2021-10-22 17:00:00+00:00') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this the actual premium release date? I wouldn't mind getting that correct, although it may screw up tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe so, since that was the value of this var in .env-dist
: https://github.com/mozilla/fx-private-relay/pull/2136/files#diff-9b75aa53740e3b569fdd203e0b882eaadadc8c03b5c840e648f37a5b2ca7b622L36
There were a couple of tests that overrode the env var to make sure they preceded or followed the given date, but I went over the (non-removed) ones and verified that the dates were still correct relative to this static date.
✅ Deploy Preview for fx-relay-demo canceled.
|
a12cf6b
to
56d945f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
I reviewed the React items. Leaving the Python code up to BE team.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Vinnl, looks good to me!
We're replacing them with a more sophisticated mechanism that does not require recompiling the front-end, and allows gradually enabling features for specific groups of users. Note that this does enable the hitherto gated feature `generateCustomAliasSubdomain` (a popover when clicking your subdomain explaining how to create a custom mask). Additionally, it makes the interview recruitment banner gated by the new-style feature flags, which doesn't have a flag for that feature yet. That means it will in effect be disabled for now.
This makes it consistent with other functions in that it starts with a verb, and specifically with `is` because it returns a boolean.
56d945f
to
2807c8f
Compare
New feature description
This removes "old" feature flags, to be replaced by Waffle-based ones.
Note that this does enable the hitherto gated feature
generateCustomAliasSubdomain
(a popover when clicking yoursubdomain explaining how to create a custom mask).
I'll also ask Tony and Eduardo to confirm that this is OK. (Edit: confirmed!)
Additionally, it makes the interview recruitment banner gated by the new-style
feature flags, which doesn't have a flag for that feature yet. That
means it will in effect be disabled for now - I'm verifying that this is OK.
If not, I'll have to learn how to add it. (Edit: also verified that that's OK!)
Screenshot (if applicable)
Not applicable.
How to test
Nothing should have changed, other than that this popup is now present, and the CSAT survey is restored:
Checklist
/frontend/src/styles/tokens.scss
).