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

feat: Enable feature Flag Values with Scope Based on "threshold" in mobile #12627

Open
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

joaoloureirop
Copy link
Contributor

Description

Related issues

Fixes: https://github.com/MetaMask/mobile-planning/issues/2065

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Before

After

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Copy link
Contributor

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.

Copy link

socket-security bot commented Dec 10, 2024

Updated dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@metamask/[email protected] 🔁 npm/@metamask/[email protected] None +1 471 kB metamaskbot
npm/@metamask/[email protected] 🔁 npm/@metamask/[email protected] None 0 148 kB metamaskbot

View full report↗︎

@joaoloureirop joaoloureirop force-pushed the feat/feature-flag-threshold branch from 0a4fd9f to 7ffa266 Compare December 11, 2024 17:24
metro.config.js Outdated
Comment on lines 12 to 40
const path = require("path");

const featureFlagModuleDir = path.resolve(__dirname, "../../core/feature-flags/packages/remote-feature-flag-controller");

const extraNodeModules = {
"@metamask/remote-feature-flag-controller": featureFlagModuleDir,
};

const watchFolders = [
featureFlagModuleDir,
];

module.exports = function (baseConfig) {
const defaultConfig = mergeConfig(baseConfig, getDefaultConfig(__dirname));
const {
resolver: { assetExts, sourceExts },
} = defaultConfig;

return mergeConfig(defaultConfig, {
watchFolders,
resolver: {
assetExts: assetExts.filter((ext) => ext !== 'svg'),
sourceExts: [...sourceExts, 'svg', 'cjs', 'mjs'],
resolverMainFields: ['sbmodern', 'react-native', 'browser', 'main'],
extraNodeModules: new Proxy (extraNodeModules, {
get: (target, name) =>
name in target ? target[name] : path.join(process.cwd(), `node_modules/${name}`),
}),
unstable_enableSymlinks: true,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

to be reverted once controller update has been published

package.json Outdated
@@ -188,7 +188,7 @@
"@metamask/react-native-payments": "^2.0.0",
"@metamask/react-native-search-api": "1.0.1",
"@metamask/react-native-webview": "^14.0.4",
"@metamask/remote-feature-flag-controller": "^1.0.0",
"@metamask/remote-feature-flag-controller": "link:../../core/feature-flags/packages/remote-feature-flag-controller",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

to be reverted once controller update has been published

@joaoloureirop joaoloureirop marked this pull request as ready for review December 12, 2024 13:25
@joaoloureirop joaoloureirop requested review from a team as code owners December 12, 2024 13:25
app/core/Engine/Engine.ts Outdated Show resolved Hide resolved
app/core/Engine/Engine.ts Outdated Show resolved Hide resolved
@joaoloureirop
Copy link
Contributor Author

@NicolasMassart The motivation to pass the metametrics id Promise rather than the actual value is to avoid adding another argument into the Engine constructor and to avoid turning functions that call Engine.init into async ones.

We can't await for a Promise inside a class constructor.

NicolasMassart
NicolasMassart previously approved these changes Dec 12, 2024
Copy link
Contributor

@NicolasMassart NicolasMassart left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@joaoloureirop
Copy link
Contributor Author

joaoloureirop commented Dec 12, 2024

Waiting on RemoteFeatureFlagController update npm publish

@NicolasMassart
Copy link
Contributor

Could we split the work on this PR and extract the metametrics changes to its own PR as it would fix #12469 and #12913 ?

@joaoloureirop
Copy link
Contributor Author

Could we split the work on this PR and extract the metametrics changes to its own PR as it would fix #12469 and #12913 ?

Ah yes, all the experimental work done here while in draft mode will be either moved to a different PR or completely dropped.

@joaoloureirop joaoloureirop force-pushed the feat/feature-flag-threshold branch 3 times, most recently from e8ea298 to d755986 Compare January 15, 2025 10:19
@joaoloureirop joaoloureirop force-pushed the feat/feature-flag-threshold branch from d755986 to 9aa427d Compare January 15, 2025 10:22
@joaoloureirop joaoloureirop marked this pull request as ready for review January 15, 2025 10:29
@joaoloureirop joaoloureirop added the Run Smoke E2E Triggers smoke e2e on Bitrise label Jan 15, 2025
Copy link
Contributor

github-actions bot commented Jan 15, 2025

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 3b9aecf
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/e84982af-de12-4825-929e-6edd844f1ef3

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Tip

  • Check the documentation if you have any doubts on how to understand the failure on bitrise

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
33.3% Coverage on New Code (required ≥ 60%)

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Run Smoke E2E Triggers smoke e2e on Bitrise team-mobile-platform
Projects
Status: Review finalised - Ready to be merged
Development

Successfully merging this pull request may close these issues.

3 participants