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

ci: 8253 - Add fitness function action for enzyme imports #8789

Merged
merged 23 commits into from
Mar 14, 2024

Conversation

Cal-L
Copy link
Contributor

@Cal-L Cal-L commented Feb 29, 2024

Description

These changes introduces a fitness function in the form of a Github action. Currently, it is only used to prevent any new enzyme imports but can be extended to check for other things moving forward. Mostly copied over from extension:
https://github.com/MetaMask/metamask-extension/blob/develop/.github/workflows/fitness-functions.yml
https://github.com/MetaMask/metamask-extension/blob/develop/development/fitness-functions/index.ts
https://github.com/MetaMask/metamask-extension/blob/develop/development/fitness-functions/rules/sinon-assert-syntax.ts
Credits to @pedronfigueiredo

TODO: Follow up with team to identify where GH action READMEs belong

Related issues

Fixes:

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Before

After

Pass without new enzyme usage
https://github.com/MetaMask/metamask-mobile/assets/10508597/b62eccd1-dc7b-4e01-8a88-73240fea77cb

Fail with new enzyme import
https://github.com/MetaMask/metamask-mobile/assets/10508597/063d6acb-b48f-4ae7-964c-922e8c931fff

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • I've clearly explained what problem this PR is solving and how it is solved.
  • I've linked related issues
  • I've included manual testing steps
  • I've included screenshots/recordings if applicable
  • I’ve included tests if applicable
  • I’ve documented my code using JSDoc format if applicable
  • I’ve applied the right labels on the PR (see labeling guidelines). Not required for external contributors.
  • I’ve properly set the pull request status:
    • In case it's not yet "ready for review", I've set it to "draft".
    • In case it's "ready for review", I've changed it from "draft" to "non-draft".

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.

@Cal-L Cal-L requested a review from a team as a code owner February 29, 2024 21:40
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.

@codecov-commenter
Copy link

codecov-commenter commented Feb 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 41.60%. Comparing base (c575f53) to head (82326b2).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8789   +/-   ##
=======================================
  Coverage   41.60%   41.60%           
=======================================
  Files        1269     1269           
  Lines       30859    30859           
  Branches     3082     3082           
=======================================
  Hits        12840    12840           
  Misses      17243    17243           
  Partials      776      776           

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

@Cal-L Cal-L force-pushed the ci/8253-fitness-function-for-enzyme-import branch from 188ef55 to 2cfc0d8 Compare March 2, 2024 03:38
@gauthierpetetin gauthierpetetin added needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) team-mobile-platform labels Mar 5, 2024
Copy link

sonarcloud bot commented Mar 5, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

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.
In a future iteration I wish we could have these externalised in a GH action though.

@Cal-L Cal-L merged commit e63269f into main Mar 14, 2024
30 checks passed
@Cal-L Cal-L deleted the ci/8253-fitness-function-for-enzyme-import branch March 14, 2024 14:13
@github-actions github-actions bot removed the needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) label Mar 14, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Mar 14, 2024
@metamaskbot metamaskbot added the release-7.19.0 Issue or pull request that will be included in release 7.19.0 label Mar 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-7.19.0 Issue or pull request that will be included in release 7.19.0 team-mobile-platform
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

5 participants