Skip to content

Commit

Permalink
chore: update sonarcloud related reports, pull request template
Browse files Browse the repository at this point in the history
Signed-off-by: Sai Sankeerth <sanpj2292@github.com>
  • Loading branch information
Sai Sankeerth committed Jan 31, 2024
1 parent 07c544c commit 560e9ad
Show file tree
Hide file tree
Showing 7 changed files with 114 additions and 6 deletions.
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
build
test
reports/
coverage
53 changes: 53 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
## What are the changes introduced in this PR?

Write a brief explainer on your code changes.

## What is the related Linear task?

Resolves INT-XXX

## Please explain the objectives of your changes below

Put down any required details on the broader aspect of your changes. If there are any dependent changes, **mandatorily** mention them here

### Any changes to existing capabilities/behaviour, mention the reason & what are the changes ?

N/A

### Any new dependencies introduced with this change?

N/A

### Any new generic utility introduced or modified. Please explain the changes.

N/A

### Any technical or performance related pointers to consider with the change?

N/A

<hr>

### Developer checklist

- [ ] My code follows the style guidelines of this project

- [ ] **No breaking changes are being introduced.**

- [ ] All related docs linked with the PR?

- [ ] All changes manually tested?

- [ ] Any documentation changes needed with this change?

- [ ] Is the PR limited to 10 file changes?

- [ ] Is the PR limited to one linear task?

- [ ] Are relevant unit and component test-cases added?

### Reviewer checklist

- [ ] Is the type of change in the PR title appropriate as per the changes?

- [ ] Verified that there are no credentials or confidential data exposed with the changes.
21 changes: 18 additions & 3 deletions .github/workflows/code-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:

jobs:
coverage:
name: Code Coverage
name: Tests, lint check & Code Coverage
runs-on: ubuntu-latest

steps:
Expand All @@ -28,14 +28,29 @@ jobs:
- name: Install Dependencies
run: npm ci

- name: Run Tests
- name: Run Tests & lint check
run: |
npm run test
npm run check:lint
- name: Upload Coverage Reports to Codecov
uses: codecov/codecov-action@v3.1.4
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: ./reports/coverage

- name: Fix filesystem paths in generated reports
if: always()
run: |
sed -i 's+home/runner/work/rudderstack-shopify-tracker/rudderstack-shopify-tracker+/github/workspace+g' reports/coverage/lcov.info
sed -i 's+home/runner/work/rudderstack-shopify-tracker/rudderstack-shopify-tracker+/github/workspace+g' reports/ts-coverage/lcov.info
sed -i 's+/home/runner/work/rudderstack-shopify-tracker/rudderstack-shopify-tracker+/github/workspace+g' reports/eslint.json
- name: Update sonar-project.properties
run: |
# Retrieve the version from package.json
version=$(node -e "console.log(require('./package.json').version)")
# Update the sonar-project.properties file with the version
sed -i "s/sonar.projectVersion=.*$/sonar.projectVersion=$version/" sonar-project.properties
- name: SonarCloud Scan
if: always()
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -143,5 +143,5 @@ dist
.svelte-kit

# Others

reports/
# End of https://www.toptal.com/developers/gitignore/api/node
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const config = {
// collectCoverageFrom: undefined,

// The directory where Jest should output its coverage files
coverageDirectory: 'coverage',
coverageDirectory: 'reports/coverage',

// An array of regexp pattern strings used to skip coverage collection
coveragePathIgnorePatterns: ['/node_modules/'],
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"commit-msg": "commitlint --edit",
"test": "jest --passWithNoTests",
"pre-commit": "npx lint-staged && npm run test",
"prepare": "husky install"
"prepare": "husky install",
"check:lint": "eslint . -f json -o reports/eslint.json || exit 0"
},
"lint-staged": {
"*.{js,ts}": "eslint --cache --fix",
Expand Down
35 changes: 35 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
sonar.log.level=INFO
sonar.verbose=false
sonar.qualitygate.wait=false

# Project details
sonar.projectKey=rudderlabs_rudderstack-shopify-tracker
sonar.organization=rudderlabs
sonar.projectName=rudderstack-shopify-tracker
sonar.projectVersion=1.4.9

# Meta-data for the project
sonar.links.scm=https://github.com/rudderlabs/rudderstack-shopify-tracker
sonar.links.issue=https://github.com/rudderlabs/rudderstack-shopify-tracker/issues

# Path to reports
sonar.javascript.lcov.reportPaths=reports/coverage/lcov.info,reports/ts-coverage/lcov.info
sonar.testExecutionReportPaths=reports/sonar/results-report.xml
sonar.eslint.reportPaths=reports/eslint.json

# Path to sources
sonar.sources=src
sonar.inclusions=**/*.js
sonar.exclusions=**/*.json,**/*.html,**/*.png,**/*.jpg,**/*.gif,**/*.svg,**/*.yml

# Path to tests
sonar.tests=test
sonar.test.inclusions=**/*.test.js,**/*.test.ts
sonar.test.exclusions=**/*.json,**/*.html,**/*.png,**/*.jpg,**/*.gif,**/*.svg
sonar.coverage.exclusions=test/**/*,**/*.json,**/*.html,**/*.png,**/*.jpg,**/*.gif,**/*.svg

# Source encoding
sonar.sourceEncoding=UTF-8

# Exclusions for copy-paste detection
sonar.cpd.exclusions=test/**/*

0 comments on commit 560e9ad

Please sign in to comment.