@@ -201,67 +201,13 @@ We also need to configure settings for github-pages environment:
2012015. In the 'Deployment branches and tags', click 'Add deployment branch or tag rule'
2022026. Select 'Ref type' to be 'Tag' and set the 'Name pattern' to `[0-9]*.[0-9]*.[0-9]* ` (or whatever matches that repo's tags)
203203
204- 8. Set up for Sonar
204+ 8. Set up Sonar
205205+++++++++++++++++++
206- PTB supports using SonarQube Cloud to analyze, visualize, & track linting, security, &
207- coverage. All of our Python projects are evaluated against the
208- `Exasol Way <https://sonarcloud.io/organizations/exasol/quality_gates/show/AXxvLH-3BdtLlpiYmZhh >`__
209- and subscribe to the
210- `Clean as You Code <https://docs.sonarsource.com/sonarqube-server/9.8/user-guide/clean-as-you-code/ >`__
211- methodology, which means that SonarQube analysis will fail and, if its included in the branch protections, block a PR
212- if code modified in that PR does not meet the standards of the Exasol Way.
213-
214- In order to set up Sonar, you will need to perform the following instructions.
215-
216- For a **public ** project
217- ^^^^^^^^^^^^^^^^^^^^^^^^
218- 1. Specify in the `noxconfig.py ` the relative path to the project's source code in `Config.source `
219- .. code-block :: python
220-
221- source: Path = Path(" exasol/<project-source-folder>" )
222- 2. Add the 'SONAR_TOKEN' to the 'Organization secrets' in GitHub (this requires a person being a GitHub organization owner)
223- 3. Activate the `SonarQubeCloud App <https://github.com/apps/sonarqubecloud >`_
224- 4. Create a project on SonarCloud
225- 5. Add the following information to the project's file `pyproject.toml `
226- .. code-block :: toml
227-
228- [tool.sonar]
229- projectKey = "com.exasol:<project-key>"
230- hostUrl = "https://sonarcloud.io"
231- organization = "exasol"
232- exclusions = "<source-directory>/version.py,<source_directory>/<directory-to-ignore>/*"
233- 6. Post-merge, update the branch protections to include SonarQube analysis
234-
235- * This should only be done when tests exist for the project, & that the project is
236- at a state in which enforced code coverage would not be a burden. For new projects,
237- we recommend creating an issue to add the SonarQube analysis to the branch protections
238- at a later point. In such scenarios, SonarQube analysis will still report its analysis
239- results to the PR, but it will not prevent the PR from being merged.
240-
241- For a **private ** project
242- ^^^^^^^^^^^^^^^^^^^^^^^^^
243- 1. Specify in the `noxconfig.py ` the relative path to the project's source code in `Config.source `
244- .. code-block :: python
245-
246- source: Path = Path(" exasol/<project-source-folder>" )
247- 2. Add the 'PRIVATE_SONAR_TOKEN' to the 'Organization secrets' in GitHub (this requires a person being a GitHub organization owner)
248- 3. Activate the `exasonarqubeprchecks App <https://github.com/apps/exasonarqubeprchecks >`_
249- 4. Create a project on https://sonar.exasol.com
250- 5. Add the following information to the project's file `pyproject.toml `
251- .. code-block :: toml
252-
253- [tool.sonar]
254- projectKey = "com.exasol:<project-key>"
255- hostUrl = "https://sonar.exasol.com"
256- organization = "exasol"
257- exclusions = "<source-directory>/version.py,<source_directory>/<directory-to-ignore>/*"
258- 6. Post-merge, update the branch protections to include SonarQube analysis from exasonarqubeprchecks
259-
260- * This should only be done when tests exist for the project, & that the project is
261- at a state in which enforced code coverage would not be a burden. For new projects,
262- we recommend creating an issue to add the SonarQube analysis to the branch protections
263- at a later point. In such scenarios, SonarQube analysis will still report its analysis
264- results to the PR, but it will not prevent the PR from being merged.
206+
207+ Look at the configuration of Sonar for a:
208+
209+ * :ref: `configure_sonar_public_project `
210+ * :ref: `configure_sonar_private_project `
265211
2662129. Go 🥜
267213+++++++++++++
0 commit comments