Skip to content

Conversation

@FrederikBolding
Copy link
Member

@FrederikBolding FrederikBolding commented May 23, 2025

Validate platformVersion against the rough version used in production for MetaMask (by inspecting GitHub) and produce a warning if the Snap is using a newer version.

Closes https://github.com/MetaMask/MetaMask-planning/issues/4980

@FrederikBolding FrederikBolding marked this pull request as ready for review May 26, 2025 09:24
@FrederikBolding FrederikBolding requested a review from a team as a code owner May 26, 2025 09:24
*/
const determineProductionVersion = useFileSystemCache(
'snaps-production-version',
inMilliseconds(7, Duration.Day),
Copy link
Contributor

@GuillaumeRx GuillaumeRx May 26, 2025

Choose a reason for hiding this comment

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

Does that mean that if there's a new release in-between the 7 days of caching the CLI will miss it ?

Copy link
Member Author

Choose a reason for hiding this comment

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

That's correct. We can reduce the TTL if we think 7 days is too long

Copy link
Member Author

Choose a reason for hiding this comment

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

WDYT @Mrtenz ?

Copy link
Member

Choose a reason for hiding this comment

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

It doesn't seem to be a particularly demanding request, so maybe one day or a couple days is fine?

Copy link
Member Author

Choose a reason for hiding this comment

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

Reduced to 3 days

@FrederikBolding FrederikBolding force-pushed the fb/validate-platform-version-against-prod branch from 0cb6fb9 to 767aa66 Compare May 26, 2025 10:04
@codecov
Copy link

codecov bot commented May 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.16%. Comparing base (cbee1d7) to head (713f7ee).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3417   +/-   ##
=======================================
  Coverage   98.15%   98.16%           
=======================================
  Files         401      402    +1     
  Lines       11067    11109   +42     
  Branches     1748     1753    +5     
=======================================
+ Hits        10863    10905   +42     
  Misses        204      204           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

inMilliseconds(7, Duration.Day),
async () => {
try {
const latestRelease = await fetch(
Copy link
Member

Choose a reason for hiding this comment

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

My only concern with this is that there can be a delay between the release being created on GitHub and it actually being live in Chrome, Firefox, etc., especially given the slow rollout sometimes.

Not something we need to resolve right now as this is much better than not having any validation, but it's something to keep in mind.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, it's not ideal, but way better than no warning at all IMO

@FrederikBolding FrederikBolding added this pull request to the merge queue May 26, 2025
Merged via the queue into main with commit d14de6e May 26, 2025
117 checks passed
@FrederikBolding FrederikBolding deleted the fb/validate-platform-version-against-prod branch May 26, 2025 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants