Skip to content

Commit

Permalink
ci: make sonarcloud more quiet (cosmos#14585)
Browse files Browse the repository at this point in the history
Co-authored-by: Marko <[email protected]>
  • Loading branch information
julienrbrt and tac0turtle authored Jan 12, 2023
1 parent c7e10f2 commit 538f7ce
Show file tree
Hide file tree
Showing 17 changed files with 31 additions and 41 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr-reviews.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
- ready_for_review
branches:
- "main"
- "releases/**"
- "release/**"

jobs:
request:
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ jobs:
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_CLIENT_V2 }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
projectBaseDir: client/v2/

Expand Down Expand Up @@ -301,7 +301,7 @@ jobs:
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_CORE }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
projectBaseDir: core/

Expand Down Expand Up @@ -331,7 +331,7 @@ jobs:
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_DEPINJECT }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

test-errors:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -359,7 +359,7 @@ jobs:
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_ERRORS }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
projectBaseDir: errors/

Expand Down Expand Up @@ -389,7 +389,7 @@ jobs:
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_MATH }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
projectBaseDir: math/

Expand Down Expand Up @@ -424,7 +424,7 @@ jobs:
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_SIMAPP }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
projectBaseDir: simapp/

Expand Down Expand Up @@ -454,7 +454,7 @@ jobs:
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_TX }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
projectBaseDir: tx/

Expand Down Expand Up @@ -488,7 +488,7 @@ jobs:
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_ROSETTA }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
projectBaseDir: tools/rosetta/

Expand Down Expand Up @@ -518,7 +518,7 @@ jobs:
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_COLLECTIONS }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
projectBaseDir: collections/

Expand Down Expand Up @@ -548,7 +548,7 @@ jobs:
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_COSMOVISOR }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
projectBaseDir: tools/cosmovisor/

Expand Down Expand Up @@ -578,7 +578,7 @@ jobs:
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_X_NFT }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
projectBaseDir: x/nft/

Expand Down Expand Up @@ -608,6 +608,6 @@ jobs:
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_CONFIX }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
projectBaseDir: tools/confix/
5 changes: 3 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,12 +186,13 @@ For consistency between our CI and the local tests, `GOWORK=off` is set in the `

When extracting a package to its own go modules, some extra steps are required, for keeping our CI checks and Dev UX:

* Add a CHANGELOG.md / README.md under the new package folder
* Add the package in [`go.work.example`](./go.work.example)
* Add weekly dependabot checks (see [dependabot.yml](./.github/dependabot.yml))
* Pre-configure SonarCloud
* Add tests to github workflow [test.yml](.github/workflows/test.yml) (under submodules)
* Configure SonarCloud
* Add `sonar-projects.properties` (see math [sonar-projects.properties](./math/sonar-projects.properties) for example)
* Add a GitHub Workflow entry for running the scans (see [test.yml](.github/workflows/test.yml))
* Add an entry for skipping the tests (see [test-skip.yml](.github/workflows/test-skip.yml))
* Ask the team to add the project to SonarCloud

## Protobuf
Expand Down
3 changes: 1 addition & 2 deletions client/v2/sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ sonar.test.inclusions=**/*_test.go
sonar.go.coverage.reportPaths=coverage.out

sonar.sourceEncoding=UTF-8
sonar.scm.provider=git
sonar.pullrequest.github.summary_comment=true
sonar.scm.provider=git
3 changes: 1 addition & 2 deletions collections/sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ sonar.test.inclusions=**/*_test.go
sonar.go.coverage.reportPaths=coverage.out

sonar.sourceEncoding=UTF-8
sonar.scm.provider=git
sonar.pullrequest.github.summary_comment=true
sonar.scm.provider=git
3 changes: 1 addition & 2 deletions core/sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ sonar.test.inclusions=**/*_test.go
sonar.go.coverage.reportPaths=coverage.out

sonar.sourceEncoding=UTF-8
sonar.scm.provider=git
sonar.pullrequest.github.summary_comment=true
sonar.scm.provider=git
3 changes: 1 addition & 2 deletions depinject/sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ sonar.test.inclusions=**/*_test.go
sonar.go.coverage.reportPaths=coverage.out

sonar.sourceEncoding=UTF-8
sonar.scm.provider=git
sonar.pullrequest.github.summary_comment=true
sonar.scm.provider=git
2 changes: 2 additions & 0 deletions errors/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import (
grpcstatus "google.golang.org/grpc/status"
)

// foo

// UndefinedCodespace when we explicitly declare no codespace
const UndefinedCodespace = "undefined"

Expand Down
5 changes: 2 additions & 3 deletions errors/sonar-project.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
sonar.projectKey=cosmos-sdk-errors
sonar.organization=cosmos

sonar.projectName=Cosmos SDK Errors
sonar.projectName=Cosmos SDK - Errors
sonar.project.monorepo.enabled=true

sonar.sources=.
Expand All @@ -11,5 +11,4 @@ sonar.test.inclusions=**/*_test.go
sonar.go.coverage.reportPaths=coverage.out

sonar.sourceEncoding=UTF-8
sonar.scm.provider=git
sonar.pullrequest.github.summary_comment=true
sonar.scm.provider=git
3 changes: 1 addition & 2 deletions math/sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ sonar.test.inclusions=**/*_test.go
sonar.go.coverage.reportPaths=coverage.out

sonar.sourceEncoding=UTF-8
sonar.scm.provider=git
sonar.pullrequest.github.summary_comment=true
sonar.scm.provider=git
3 changes: 1 addition & 2 deletions simapp/sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ sonar.test.inclusions=**/*_test.go
sonar.go.coverage.reportPaths=coverage.out

sonar.sourceEncoding=UTF-8
sonar.scm.provider=git
sonar.pullrequest.github.summary_comment=true
sonar.scm.provider=git
1 change: 0 additions & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ sonar.go.coverage.reportPaths=coverage.out,*profile.out
sonar.python.version=3
sonar.sourceEncoding=UTF-8
sonar.scm.provider=git
sonar.pullrequest.github.summary_comment=true

# Exclude C/C++/Objective-C files from analysis
sonar.c.file.suffixes=-
Expand Down
3 changes: 1 addition & 2 deletions tools/confix/sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ sonar.test.inclusions=**/*_test.go
sonar.go.coverage.reportPaths=coverage.out

sonar.sourceEncoding=UTF-8
sonar.scm.provider=git
sonar.pullrequest.github.summary_comment=true
sonar.scm.provider=git
3 changes: 1 addition & 2 deletions tools/cosmovisor/sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ sonar.test.inclusions=**/*_test.go
sonar.go.coverage.reportPaths=coverage.out

sonar.sourceEncoding=UTF-8
sonar.scm.provider=git
sonar.pullrequest.github.summary_comment=true
sonar.scm.provider=git
3 changes: 1 addition & 2 deletions tools/rosetta/sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ sonar.test.inclusions=**/*_test.go
sonar.go.coverage.reportPaths=coverage.out

sonar.sourceEncoding=UTF-8
sonar.scm.provider=git
sonar.pullrequest.github.summary_comment=true
sonar.scm.provider=git
3 changes: 1 addition & 2 deletions tx/sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ sonar.test.inclusions=**/*_test.go
sonar.go.coverage.reportPaths=coverage.out

sonar.sourceEncoding=UTF-8
sonar.scm.provider=git
sonar.pullrequest.github.summary_comment=true
sonar.scm.provider=git
3 changes: 1 addition & 2 deletions x/nft/sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ sonar.test.inclusions=**/*_test.go
sonar.go.coverage.reportPaths=coverage.out

sonar.sourceEncoding=UTF-8
sonar.scm.provider=git
sonar.pullrequest.github.summary_comment=true
sonar.scm.provider=git

0 comments on commit 538f7ce

Please sign in to comment.