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

Integrate Glam Onboarding Feature Flag #502

Merged
merged 5 commits into from
Dec 12, 2024
Merged

Integrate Glam Onboarding Feature Flag #502

merged 5 commits into from
Dec 12, 2024

Conversation

meisekimiu
Copy link
Member

@meisekimiu meisekimiu commented Dec 9, 2024

Instead of using localStorage, Glam onboarding is now configured with a feature flag defined in the environment's database. Also let the Feature Flag service use environment variables as fallback to make it easier to test them in local or other ephemeral environments.

Steps to Test:

  1. Sign up in an environment with the feature flag disabled and verify that old onboarding is presented to the user
  2. Enable the feature flag and verify that glam onboarding is now shown instead

To test this in local, you can add glam-onboarding to optional-secrets and .env, and restart the development server whenever the flag is changed. An empty string (or absent flag) is considered a disabled feature flag.

Copy link

codecov bot commented Dec 9, 2024

Codecov Report

Attention: Patch coverage is 92.30769% with 1 line in your changes missing coverage. Please review.

Project coverage is 43.18%. Comparing base (0cc75ce) to head (6e1211d).
Report is 25 commits behind head on main.

Files with missing lines Patch % Lines
src/app/feature-flag/feature-flag.module.ts 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #502      +/-   ##
==========================================
+ Coverage   43.16%   43.18%   +0.01%     
==========================================
  Files         362      363       +1     
  Lines       11094    11102       +8     
  Branches     1809     1809              
==========================================
+ Hits         4789     4794       +5     
- Misses       6143     6144       +1     
- Partials      162      164       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@meisekimiu meisekimiu requested review from k8lyn6 and removed request for k8lyn6 December 9, 2024 17:10
@meisekimiu
Copy link
Member Author

This doesn't seem to be working on dev right now (I believe it is a configuration issue), so I will fix this before requesting QA.

@meisekimiu meisekimiu requested a review from k8lyn6 December 9, 2024 19:57
@meisekimiu
Copy link
Member Author

This should be ready for QA now. New changes did add some uncovered code, but as I've said before, module constructors are essentially the main() part of an Angular application so they don't really need to be tested.

@k8lyn6 k8lyn6 requested a review from yeslikesolo December 10, 2024 15:41
This is mainly for use in development environments, where setting
feature flags in local Stela can be a bit annoying. A secret loaded from
the `.env` file can be used in place of fetching a feature flag from the
back-end. It will not overwrite a value from the back-end so this is
only a fallback method to set values not defined in Stela already.

Also add the ability to store secrets with kebab-case formats.

To actually get this to work, a dev will have to temporarily store the
feature flag in the "optional secrets" file. I do not recommend actually
comitting that change though.

PER-9570: Integrate Glam Onboarding Feature Flag
Integrate the new FeatureFlagService into Glam Onboarding and replace
checks with localStorage's `isGlam` key with the new `glam-onboarding`
feature flag.

PER-9570: Integrate Glam Onboarding Feature Flag
Include the FeatureFlagModule in the AppModule so that it's
automatically loaded at the start of each page load. Do not pass in
Authorization for fetching feature flags, since it's not needed and it
seems slow on local environments.

PER-9570: Integrate Glam Onboarding Feature Flag
The final feature-flag endpoint returns an object with an `items` field.
Use this `items` value instead of expecting a bare array from the API.
This is something that was also different after the actual
implementation of the Feature Flag endpoint. Previously we may have
expected some disabled flags would still show up in the response but
with a `globallyEnabled` flag set to false. The current endpoint just
gives us a list of enabled flags.
@meisekimiu meisekimiu merged commit b151f0a into main Dec 12, 2024
4 checks passed
@meisekimiu meisekimiu deleted the glam-feature-flag branch December 12, 2024 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants