-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
feat(27255): allow local modification for remote feature flags #29696
feat(27255): allow local modification for remote feature flags #29696
Conversation
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
@metamaskbot update-policies |
No dependency changes detected. Learn more about Socket for GitHub ↗︎ 👍 No dependency changes detected in pull request |
Policy update failed. You can review the logs or retry the policy update here |
1e9217f
to
1905574
Compare
@metamaskbot update-policies |
Policy update failed. You can review the logs or retry the policy update here |
1905574
to
ced7bf4
Compare
@metamaskbot update-policies |
Policies updated. 🧠 Learn how: https://lavamoat.github.io/guides/policy-diff/#what-to-look-for-when-reviewing-a-policy-diff |
704d4ab
to
511c2d5
Compare
@metamaskbot update-policies |
Policies updated. 🧠 Learn how: https://lavamoat.github.io/guides/policy-diff/#what-to-look-for-when-reviewing-a-policy-diff |
6ccfac6
to
804e3d7
Compare
@metamaskbot update-policies |
Builds ready [804e3d7]
Page Load Metrics (1723 ± 60 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Policies updated. 🧠 Learn how: https://lavamoat.github.io/guides/policy-diff/#what-to-look-for-when-reviewing-a-policy-diff |
Builds ready [16c667e]
Page Load Metrics (1860 ± 60 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Walk through the PR changes from here - |
/** | ||
* Feature flags to control business logic behavior | ||
*/ | ||
remoteFeatureFlags?: { |
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.
- Include the type of
remoteFeatureFlags
in manifest as optional value. We includetestFlagForThreshold
that's created for testing purpose in remote feature flag API .
development/build/manifest.js
Outdated
@@ -11,6 +11,7 @@ const baradDurManifest = isManifestV3 | |||
? require('../../app/manifest/v3/_barad_dur.json') | |||
: require('../../app/manifest/v2/_barad_dur.json'); | |||
const { loadBuildTypesConfig } = require('../lib/build-type'); | |||
const manifestFlags = require('../../manifest-flags.json'); |
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.
- Read customized manifestFlags from
manifest-flags.json
so we can override the one from controller (API) - old build system
@@ -1,3 +1,5 @@ | |||
import manifestFlags from '../../../../../manifest-flags.json'; |
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.
- Read customized manifestFlags from
manifest-flags.json
so we can override the one from controller (API) - webpack build
development/build/manifest.js
Outdated
@@ -47,8 +48,10 @@ function createManifestTasks({ | |||
browserVersionMap[platform], | |||
await getBuildModifications(buildType, platform), | |||
customArrayMerge, | |||
{ |
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.
- Add customized local
manifestFlags
to manifest file (old build system)
Builds ready [4248edf]
Page Load Metrics (1641 ± 46 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [1071e2b]
Page Load Metrics (1663 ± 46 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [dcb78e3]
Page Load Metrics (1998 ± 150 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [96fe46d]
Page Load Metrics (1824 ± 84 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
ui/pages/settings/developer-options-tab/developer-options-tab.tsx
Outdated
Show resolved
Hide resolved
Builds ready [5ad5fdb]
Page Load Metrics (1873 ± 90 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
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.
Find one typo. Don't be mad 😅
Co-authored-by: David Murdoch <[email protected]>
Builds ready [1e89e33]
Page Load Metrics (1811 ± 73 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Description
Note
You can now follow the steps here to review the PR.
Local Feature Flag Override System
This PR implements a system that allows developers to override remote feature flags locally through
manifest.json
, providing more flexibility in development and testing environments.Key Features
Local Feature Flag Override
remoteFeatureFlag
values by defining them in.manifest-overrides.json
Testing Integration
remoteFeatureFlag
objects to be passed within testwithFixtures
Developer Validation
This enhancement streamlines the development workflow by providing local control over feature flags without requiring changes to the controller or deployment configurations.
Usage Example
A. Local build
remoteFeatureFlags
in.manifest-overrides.json
:B. e2e test
Add the customized value in
Related issues
Fixes: #27255
Manual testing steps
Please check <### Usage Example> above to check how to test manually.
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist