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

More intuitive flag behaviour #4967

Merged
merged 1 commit into from
Aug 22, 2024
Merged

More intuitive flag behaviour #4967

merged 1 commit into from
Aug 22, 2024

Conversation

Vinnl
Copy link
Collaborator

@Vinnl Vinnl commented Aug 21, 2024

References:

Jira: MNTOR-3528
Figma:

Description

The allowlist now only applies to disabled flags, allowing us to enable those flags for specific users. The code now also makes more explicit that you should always pass the user's email address, the only exception being if they're not logged in. (It makes intuitive sense that a flag can't be enabled for a specific user if that user is not logged in.)

In other words, enabling a flag now always enables it for everyone, regardless of the allowlist.

Also note that I moved disabled feature flags to the top, since those are the ones we'll usually want to take action on, whereas we don't usually want to disable flags once they are enabled. (And once we remove their code, disabling them doesn't do anything anymore.)

This is the right moment to make this change, because the only flag with an allowlist at the moment is RedesignedEmails, which is already set to be removed with the next deploy.

Screenshot (if applicable)

image

How to test

  • Disable a flag, verify that it's no longer active for you.
  • Add yourself to the flag's allowlist, verify that it's now active for you.
  • Enable the flag without removing yourself from the allowlist. Verify that it's also active for other users.

Checklist (Definition of Done)

  • Localization strings (if needed) have been added.
  • Commits in this PR are minimal and have descriptive commit messages.
  • I've added or updated the relevant sections in readme and/or code comments
  • I've added a unit test to test for potential regressions of this bug.
  • If this PR implements a feature flag or experimentation, the Ship Behind Feature Flag status in Jira has been set
  • Product Owner accepted the User Story (demo of functionality completed) or waived the privilege.
  • All acceptance criteria are met.
  • Jira ticket has been updated (if needed) to match changes made during the development process.
  • Jira ticket has been updated (if needed) with suggestions for QA when this PR is deployed to stage.

@Vinnl Vinnl added the Review: XS Code review time: up to 30min label Aug 21, 2024
@Vinnl Vinnl requested review from rhelmer and mansaj August 21, 2024 11:11
@Vinnl Vinnl self-assigned this Aug 21, 2024
Copy link

@@ -56,7 +56,7 @@ export default async function WelcomeToPlusPage() {
};

const enabledFeatureFlags = await getEnabledFeatureFlags({
ignoreAllowlist: false,
isLoggedOut: false,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some places in the code say "signed in/out" and some say "logged in/out", not a huge deal but would be nice to be consistent. I think Mozilla Accounts tends to use the former.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh good callout. Next-Auth uses "sign in/out" as well, so I've updated to align with that too: 7d54a46

The allowlist now only applies to disabled flags, allowing us to
enable those flags for specific users. The code now also makes more
explicit that you should always pass the user's email address, the
only exception being if they're not logged in. (It makes intuitive
sense that a flag can't be enabled for a specific user if that user
is not logged in.)
@Vinnl Vinnl force-pushed the MNTOR-3528-intuitive-flags branch from 7d54a46 to f3e8397 Compare August 22, 2024 09:51
@Vinnl Vinnl merged commit 4f226e2 into main Aug 22, 2024
15 checks passed
@Vinnl Vinnl deleted the MNTOR-3528-intuitive-flags branch August 22, 2024 10:07
Copy link

Cleanup completed - database 'blurts-server-pr-4967' destroyed, cloud run service 'blurts-server-pr-4967' destroyed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Review: XS Code review time: up to 30min
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants