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

Add all manifest validation logic as separate rules #2572

Merged
merged 23 commits into from
Jul 25, 2024
Merged

Conversation

ritave
Copy link
Member

@ritave ritave commented Jul 11, 2024

fixes #2571

@ritave ritave changed the title Add all manifest validation logic as seperate rules Add all manifest validation logic as separate rules Jul 11, 2024
@ritave ritave marked this pull request as ready for review July 22, 2024 15:00
@ritave ritave requested a review from a team as a code owner July 22, 2024 15:00
Copy link

codecov bot commented Jul 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.17%. Comparing base (12eaf23) to head (c5b114d).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2572      +/-   ##
==========================================
+ Coverage   94.01%   94.17%   +0.15%     
==========================================
  Files         461      476      +15     
  Lines        9678     9813     +135     
  Branches     1486     1496      +10     
==========================================
+ Hits         9099     9241     +142     
+ Misses        579      572       -7     

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

Copy link
Member

@Mrtenz Mrtenz left a comment

Choose a reason for hiding this comment

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

Nice! This seems like a good improvement over the previous manifest logic. I like the approach of different validation rules you've used.

I left some clarifying questions, nits, and some suggestions.

Copy link
Member

@Mrtenz Mrtenz left a comment

Choose a reason for hiding this comment

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

Maybe we should update the build command to have better formatted warnings and errors too, instead of just throwing an error?

$ yarn build
✖ Error: Manifest Error: The manifest is invalid.
"snap.manifest.json" "shasum" field does not match computed shasum. Got "+iXB4ursqJMaWaR3fHJYNCxM8di9xvLeYoTv9jjMfjI=", expected "+iXB4ursqJMaWWR3fHJYNCxM8di9xvLeYoTv9jjMfjI=".
    at ./MetaMask/snaps/packages/snaps-webpack-plugin/dist/chunk-5IQTHQ6D.js:206106:17

Feel free to do that in a separate PR though if you prefer.

@ritave
Copy link
Member Author

ritave commented Jul 25, 2024

Improving the dev experience will be part of #2565

@ritave ritave merged commit 0788b52 into main Jul 25, 2024
156 checks passed
@ritave ritave deleted the ritave/validators branch July 25, 2024 10:56
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.

Refactor bundle and manifest validation logic
2 participants