feat(platform): add the metamask-extension overlay for feature-flags - #157
Draft
MajorLift wants to merge 1 commit into
Draft
feat(platform): add the metamask-extension overlay for feature-flags#157MajorLift wants to merge 1 commit into
metamask-extension overlay for feature-flags#157MajorLift wants to merge 1 commit into
Conversation
The extension's helper is a direct port of mobile's and its header says so, so the exported names match. Three things do not, and they are what the overlay is for. The version basis inverts mobile's warning: mobile compares against the native binary version, the extension against `packageJson.version`. Two modules export `hasMinimumRequiredVersion`, `validatedVersionGatedFeatureFlag` and `VersionGatedFeatureFlag` with different semantics. Only one unwraps progressive-rollout wrappers, and an import of either name compiles against either module. `getBooleanFeatureFlag` is the house entry point rather than mobile's, at 17 production call sites against 6, and it takes the fallback as a required argument instead of a trailing `??`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
The
feature-flagsskill in #147 ships with a mobile overlay only, so an agent working inmetamask-extensiongets the shared skill and no client specifics.Writing that overlay by transposing mobile's API would have produced something mostly right and wrong where it matters. The extension's helper is a direct port of mobile's, and
shared/lib/remote-feature-flag-utils.ts:7says so in its own header, so the exported names do match. Three things do not.The version basis inverts mobile's warning. Mobile's overlay says the comparison is against the native binary version, not
package.json. The extension resolvesAPP_VERSIONfrompackageJson.version. Same symbol, opposite source, and the mobile sentence is actively misleading in this repo.Two modules export the same three names with different semantics.
shared/lib/remote-feature-flag-utils.tsandshared/lib/feature-flags/version-gating.tsboth exporthasMinimumRequiredVersion,validatedVersionGatedFeatureFlagandVersionGatedFeatureFlag. The second typesminimumVersionasstring | nulland does not unwrap progressive-rollout wrappers. An import of either name compiles against either module, which is the trap a reader of the mobile overlay walks into.getBooleanFeatureFlagis the house entry point, not mobile's. Counting invocations outside tests and outside the defining modules: 17 against 6. It takes the fallback as a required second argument rather than a trailing?? localFlag.Overview
Adds
domains/platform/skills/feature-flags/repos/metamask-extension.md. Based on #147's branch, so it should merge after it.Sections: the canonical API and the two-module collision, requirements, adding a flag, testing, what the extension does not have, and what it has that mobile does not.
Five things the mobile overlay covers have no extension counterpart and are named as absent rather than invented: the native binary version, multi-version
{ versions: {...} }flags, a centralFeatureFlagNamesregistry,OVERRIDE_REMOTE_FEATURE_FLAGS, and auseRemoteFeatureFlaghook. Each was established with a positive control on the same search shape.Showcase
No trial run. The evidence is that every symbol and path named was read from the repository, with the file it came from recorded.
Two things a reviewer should settle rather than inherit:
remote-feature-flag-utilson importer count (13 production files against 4), recency and wrapper support, and says explicitly that this is a preference rather than repo policy.getBooleanFeatureFlag's dominance is a decision or accretion is likewise unrecorded.Separate defect, found on the way and not fixed here:
domains/testing/skills/ab-testing/repos/metamask-extension.md:78onmaintells readers to useFixtureBuilder.withRemoteFeatureFlags(...). That method does not exist. The string appears twice inmetamask-extension, both inside doc comments intest/e2e/feature-flags/feature-flag-registry.ts. The real method iswithRemoteFeatureFlagController, attest/e2e/fixtures/fixture-builder-v2.ts:428. This overlay names the real one.