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" #12627

Merged
merged 25 commits into from
Jan 23, 2025

Conversation

joaoloureirop
Copy link
Contributor

@joaoloureirop joaoloureirop commented Dec 10, 2024

Description

Remote Feature Flag Controller v1.3.0 requires metaMetricsId string value for its initialization.
metaMetricsId is used to generate a threshold value for Scope based feature flags.

On Mobile, metaMetricsId is managed by the MetaMetrics class, using its method getMetaMetricsId.
Because this method returns a promise, we need to handle it outside Engine constructor.

The route we opted is to await for the Promise to resolve on EngineService.start function, then send it to Engine.init as a parameter, which will pass it the into Engine constructor.

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 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 Show resolved Hide resolved
metro.transform.js Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
@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 changed the title feat: Enable feature Flag Values with Scope Based on "threshold" in mobile feat: Enable feature Flag Values with Scope Based on "threshold" Jan 16, 2025
@joaoloureirop joaoloureirop force-pushed the feat/feature-flag-threshold branch from ae8dacc to 4d7c9b7 Compare January 17, 2025 15:36
app/core/EngineService/EngineService.test.ts Show resolved Hide resolved
app/core/EngineService/EngineService.ts Show resolved Hide resolved
app/core/EngineService/EngineService.ts Show resolved Hide resolved
app/core/Engine/Engine.ts Show resolved Hide resolved
app/core/Engine/Engine.ts Show resolved Hide resolved
@joaoloureirop joaoloureirop added needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Jan 17, 2025
Copy link
Contributor

github-actions bot commented Jan 20, 2025

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 8afed80
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/482ce990-f08b-4962-85b1-001799e5f96a

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

@joaoloureirop joaoloureirop added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Jan 22, 2025
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 joaoloureirop added this pull request to the merge queue Jan 23, 2025
Merged via the queue into main with commit 15cd391 Jan 23, 2025
53 of 54 checks passed
@joaoloureirop joaoloureirop deleted the feat/feature-flag-threshold branch January 23, 2025 19:48
@github-actions github-actions bot removed the needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) label Jan 23, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Jan 23, 2025
@metamaskbot metamaskbot added the release-7.40.0 Issue or pull request that will be included in release 7.40.0 label Jan 23, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-7.40.0 Issue or pull request that will be included in release 7.40.0 Run Smoke E2E Triggers smoke e2e on Bitrise team-mobile-platform
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants