-
Notifications
You must be signed in to change notification settings - Fork 1
Add sonar to project for quality checks #452
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
Merged
Merged
Changes from all commits
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
abf1447
Add sonar to project for quality checks
ArBridgeman ae27485
Move pysonar to direct dependencies
ArBridgeman 53fb0a7
Add changelog entry
ArBridgeman d8f9a6f
Switch to nox task
ArBridgeman 619f1ec
Merge branch 'main' into feature/451_add_pysonar
ArBridgeman 741118d
Continue nox task, add to templates, & update documentation
ArBridgeman e975873
Fix template .gitignore & inherit secrets for report
ArBridgeman 71a5ff4
Add new nox tasks to main tasks.py
ArBridgeman 80e0736
Fix to relative path from . for coverage.xml & session
ArBridgeman cb43c0e
Add organization as required for pysonar
ArBridgeman fca58bb
Add statement to docs about adding to branch protections
ArBridgeman 8395c69
Rename variable to avoid code smell, as built-in
ArBridgeman aeb6925
Remove f from non-f-string
ArBridgeman 153adcb
Fix typo in documentation
ArBridgeman 373c631
Move and rename to correct test folder
ArBridgeman d04be09
fixup! Rename variable to avoid code smell, as built-in
ArBridgeman dd250b6
Fix class name to fit convention
ArBridgeman c8ebdbc
Group copy_artifact tests together
ArBridgeman 3f85359
Use variables to ensure names consistent throughout usually subsequen…
ArBridgeman 3bb7f69
Simplify test and move into correct file
ArBridgeman cfc64e7
Remove file check as already done before validating them
ArBridgeman 083c8ae
Switch validations to booleans and simplify to all or fail
ArBridgeman 6d7d94f
Move over and simplify test for is_valid_lint_txt
ArBridgeman 140875d
Move over and simplify test for is_valid_lint_json and mirror to is_v…
ArBridgeman 64fa5d2
Move over and simplify test for is_valid_security_json
ArBridgeman 48c8cee
Convert to handle validation error
ArBridgeman d66e5f0
Move over and simplify test for is_valid_coverage
ArBridgeman 71f4070
Switch to simple assert
ArBridgeman 02d7c4f
Add test for check_artifacts and switch prints to all bey stderr
ArBridgeman 2fd5bf4
Fix warnings in sonar upload output
ArBridgeman 0afc3fb
Remove code smells where non-f-strings
ArBridgeman 7401da3
Switch python_files to be Iterable[str] as only used that way & restr…
ArBridgeman 85ac99d
Add type ignore for unpacked list into session
ArBridgeman 369705b
Project fix
ArBridgeman 389c1e5
Fix comment
ArBridgeman ec5bf33
Add inherit secrets for sonar to pr-merge.ymls
ArBridgeman e19abd6
Merge branch 'main' into feature/451_add_pysonar
ArBridgeman 5a35f66
Reduce scope of pylint to that of package
ArBridgeman 254f905
Update documentation with summary and make clearer private vs public …
ArBridgeman e7fae9b
Re-lock dependencies
ArBridgeman 95e97b8
Modify documentation per review
ArBridgeman 12dca74
Rename to sonar:check
ArBridgeman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,26 +1,21 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| push: | ||
| branches-ignore: | ||
| - "github-pages/*" | ||
| - "gh-pages/*" | ||
| - "main" | ||
| - "master" | ||
| pull_request: | ||
| types: [opened, synchronize, reopened] | ||
| schedule: | ||
| # “At 00:00 on every 7th day-of-month from 1 through 31.” (https://crontab.guru) | ||
| # At 00:00 on every 7th day-of-month from 1 through 31. (https://crontab.guru) | ||
| - cron: "0 0 1/7 * *" | ||
|
|
||
| jobs: | ||
|
|
||
| CI: | ||
| uses: ./.github/workflows/merge-gate.yml | ||
| secrets: inherit | ||
| permissions: | ||
| contents: read | ||
|
|
||
| Metrics: | ||
| needs: [ CI ] | ||
| uses: ./.github/workflows/report.yml | ||
| secrets: inherit | ||
| permissions: | ||
| contents: read | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,6 +7,7 @@ odbcconfig/odbcinst.ini | |
| .html-documentation | ||
|
|
||
| .coverage | ||
| .sonar | ||
|
|
||
| _build/ | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,29 @@ | ||
| # Unreleased | ||
|
|
||
| ## Summary | ||
| This version of the PTB adds nox task `sonar:check`, see #451. This allows us to | ||
| use SonarQube Cloud to analyze, visualize, & track linting, security, & coverage. In | ||
| order to properly set it up, you'll need to do the following instruction for each **public** project. | ||
| At this time, PTB currently does not support setting up SonarQube for a **private** project. | ||
|
|
||
| 1. Specify in the `noxconfig.py` the relative path to the project's source code in `Config.source` | ||
| ```python | ||
| source: Path = Path("exasol/toolbox") | ||
| ``` | ||
| 2. Add the 'SONAR_TOKEN' to the 'Organization secrets' in GitHub (this requires a person being a GitHub organization owner). | ||
| 3. Activate the SonarQubeCloud App | ||
| 4. Create a project on SonarCloud | ||
| 5. Add the following information to the project's file `pyproject.toml` | ||
| ```toml | ||
| [tool.sonar] | ||
| projectKey = "com.exasol:<project-key>" | ||
| hostUrl = "https://sonarcloud.io" | ||
| organization = "exasol" | ||
| ``` | ||
| 6. Post-merge, update the branch protections to include SonarQube analysis | ||
|
|
||
| ## ✨ Features | ||
| * #451: Added nox task to execute pysonar & added Sonar to the CI | ||
|
|
||
| ## ⚒️ Refactorings | ||
| * #451: Reduced scope of nox tasks `lint:code` (pylint) and `lint:security` (bandit) to analyze only the package code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.