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: Create a quality gate for typescript coverage #27717

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from

Conversation

itsyoboieltr
Copy link
Contributor

@itsyoboieltr itsyoboieltr commented Oct 9, 2024

Description

Open in GitHub Codespaces

This PR introduces a quality gate for typescript coverage. It updates the existing fitness function to disallow the creation of new js and jsx files in the repository.

Related issues

Fixes: https://github.com/MetaMask/MetaMask-planning/issues/2399

Manual testing steps

  1. After committing a javascript file, the fitness function should fail.

Screenshots/Recordings

Not applicable

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.

@itsyoboieltr itsyoboieltr requested review from kumavis and a team as code owners October 9, 2024 11:40
Copy link
Contributor

github-actions bot commented Oct 9, 2024

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.

@metamaskbot
Copy link
Collaborator

Builds ready [a9e5c0a]
Page Load Metrics (1708 ± 94 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint24922651638374180
domContentLoaded14112215168618589
load14192260170819694
domInteractive168444209
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

// development/fitness-functions
// development/webpack directories
const E2E_TESTS_REGEX =
/^(test\/e2e|development\/fitness-functions|development\/webpack).*\.(js|ts|jsx|tsx)$/u;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

here I inverted the logic to make it easier to understand, and to match the newly added JS_REGEX behavior

Copy link

sonarcloud bot commented Oct 10, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarCloud

Catch issues before they fail your Quality Gate with our IDE extension SonarLint

@metamaskbot
Copy link
Collaborator

Builds ready [7ab9fbc]
Page Load Metrics (1645 ± 79 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint13882064163916680
domContentLoaded13822053161916378
load13892062164516479
domInteractive2291432010
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@hjetpoluru hjetpoluru self-requested a review October 10, 2024 18:01
Copy link
Contributor

@hjetpoluru hjetpoluru left a comment

Choose a reason for hiding this comment

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

LGTM and you have written tests that much appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Review finalised - Ready to be merged
Development

Successfully merging this pull request may close these issues.

4 participants