Skip to content

fix(push-platform-notifications): Fix ENABLE_MV3 parsing consistency#25242

Closed
legobeat wants to merge 7 commits intoMetaMask:developfrom
legobeat:fix-notifications-mv3-toggle
Closed

fix(push-platform-notifications): Fix ENABLE_MV3 parsing consistency#25242
legobeat wants to merge 7 commits intoMetaMask:developfrom
legobeat:fix-notifications-mv3-toggle

Conversation

@legobeat
Copy link
Copy Markdown
Contributor

@legobeat legobeat commented Jun 12, 2024

Description

Due to slight difference in parsing of the ENABLE_MV3 environment variable, there is actually currently no value that will consistently disable MV3 (since !!'false' === true while !!'' === false).

This fixes this by:

  • Using the exact same syntax to parse the ENABLE_MV3 environment variable consistently
  • Refactor notifications test to skip MV3-specific tests under MV2, instead of marking them as passing without running them.
  • Changing occurrence of process.env.ENABLE_MV3 in runtime to library function isManifestV3.

After this PR is merged:

  • Setting ENABLE_MV3=true or leaving it unset will enable MV3
  • Setting it to any other value disables it

This is in line with how it is interpreted in other parts of the stack.

Open in GitHub Codespaces

Related issues

Fixes:

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.

@github-actions
Copy link
Copy Markdown
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.

@legobeat legobeat added MV3 team-application-security Application security team team-notifications-deprecated DEPRECATED: please use "team-assets" instead area-buildSystem related to our build system labels Jun 12, 2024
@legobeat legobeat marked this pull request as ready for review June 12, 2024 05:36
@legobeat legobeat requested review from a team as code owners June 12, 2024 05:36
@legobeat legobeat force-pushed the fix-notifications-mv3-toggle branch from 0e927bf to 8be12ed Compare June 12, 2024 12:16
@legobeat legobeat requested a review from Gudahtt June 12, 2024 12:35
DDDDDanica
DDDDDanica previously approved these changes Jun 12, 2024
@legobeat legobeat force-pushed the fix-notifications-mv3-toggle branch 3 times, most recently from ad989d5 to c5f4e79 Compare June 13, 2024 01:11
@legobeat legobeat force-pushed the fix-notifications-mv3-toggle branch from c5f4e79 to 50d8c52 Compare June 13, 2024 02:44
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

test:e2e:firefox and *:mv2 scripts set ENABLE_MV3="false", which here means process.env.ENABLE_MV3 === true, and this would not trigger.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Aha nice catch, I was under the assumption the flag was not set.

Perfect - Approved!

@legobeat legobeat force-pushed the fix-notifications-mv3-toggle branch from 6161242 to 29e2c8a Compare June 15, 2024 00:58
@HowardBraham
Copy link
Copy Markdown
Contributor

@legobeat this is failing 4 unit tests

@legobeat legobeat requested a review from kumavis June 17, 2024 23:45
@legobeat legobeat force-pushed the fix-notifications-mv3-toggle branch from 29e2c8a to 6389af8 Compare June 17, 2024 23:45
@legobeat
Copy link
Copy Markdown
Contributor Author

legobeat commented Jun 17, 2024

@legobeat this is failing 4 unit tests

@HowardBraham Yes - it seems that these tests are not properly confirmed as passing in CI on develop due to the inconsistency addressed in this PR?

@legobeat legobeat mentioned this pull request Jun 18, 2024
@legobeat legobeat force-pushed the fix-notifications-mv3-toggle branch from 6389af8 to 5310e68 Compare June 18, 2024 10:39
@Prithpal-Sooriya
Copy link
Copy Markdown
Contributor

@legobeat if this is becoming a blocker, I'm fine if you need to modify or comment out tests.
Our team/@MetaMask/notifications team can relook into these and add back in the tests.

@legobeat legobeat dismissed stale reviews from Prithpal-Sooriya and DDDDDanica via 1fdb619 June 18, 2024 11:20
@legobeat legobeat force-pushed the fix-notifications-mv3-toggle branch from 8d5e2fc to e56180b Compare June 19, 2024 10:18
@legobeat legobeat force-pushed the fix-notifications-mv3-toggle branch from e56180b to ec429a4 Compare June 20, 2024 06:26
@HowardBraham
Copy link
Copy Markdown
Contributor

Closing because goals were accomplished by #26059

@github-actions github-actions bot locked and limited conversation to collaborators Aug 1, 2024
@legobeat legobeat deleted the fix-notifications-mv3-toggle branch August 11, 2024 21:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-buildSystem related to our build system MV3 team-application-security Application security team team-notifications-deprecated DEPRECATED: please use "team-assets" instead

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants