Skip to content

Commit bbfe9d7

Browse files
chore: sonar integration (MetaMask#22603)
## **Description** This PR enables the basic sonar analysis for each PR as part of for overall integration. More configuration will be done once we enabled Sonarscan in each PR. https://sonarcloud.io/project/overview?id=metamask-extension <img width="1469" alt="Screenshot 2024-03-28 at 12 15 56" src="https://github.com/MetaMask/metamask-extension/assets/12678455/fe6c2aba-24e3-460a-8125-7d0fb96d1a26"> **_PS: For the future:_** - [ ] Update the action triggers to run on PRs and pushes to `develop` - [ ] Merge this PR into develop so analysis can be run on base branch - [ ] Take the CircleCI coverage results and pass them to this GH action - [ ] Configure the test coverage exclusions according to your project specifics (e.g. exclude other test files). This coverage may not exactly map to CodeCov values. We are looking for a relative trend upwards. ## **Related issues** Fixes: MetaMask/MetaMask-planning#1311 ## **Manual testing steps** 1. Go to this page... 2. 3. ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [ ] I’ve followed [MetaMask Coding Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md). - [ ] 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](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)). 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. --------- Co-authored-by: Danica Shen <[email protected]>
1 parent f29a78e commit bbfe9d7

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

.github/workflows/sonar.yml

+12-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@ on:
44
secrets:
55
SONAR_TOKEN:
66
required: true
7+
pull_request:
8+
branches:
9+
- develop
10+
types:
11+
- opened
12+
- reopened
13+
- synchronize
14+
- labeled
15+
- unlabeled
16+
717
jobs:
818
sonarcloud:
919
name: SonarCloud
@@ -13,8 +23,8 @@ jobs:
1323
with:
1424
fetch-depth: 0 # Shallow clones should be disabled for better relevancy of analysis
1525
- name: SonarCloud Scan
16-
# v1.9.1
17-
uses: SonarSource/sonarcloud-github-action@5875562561d22a34be0c657405578705a169af6c
26+
# This is SonarSource/[email protected]
27+
uses: SonarSource/sonarcloud-github-action@4b4d7634dab97dcee0b75763a54a6dc92a9e6bc1
1828
with:
1929
args: >
2030
-Dsonar.javascript.lcov.reportPaths=tests/coverage/lcov.info

sonar-project.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ sonar.sources=app/
1515
sonar.test.inclusions=**.test.**
1616

1717
# Encoding of the source code. Default is default system encoding
18-
sonar.sourceEncoding=UTF-8
18+
sonar.sourceEncoding=UTF-8

0 commit comments

Comments
 (0)