@@ -25,28 +25,41 @@ Configuration
2525
2626**Public ** GitHub repository
2727^^^^^^^^^^^^^^^^^^^^^^^^^^^^
28- 1. Specify in the ``noxconfig.py `` the relative path to the project's source code in ``Config.source ``
28+ In GitHub
29+ """""""""
30+ A GitHub Admin will need to:
31+
32+ #. Inherit organization secret 'SONAR_TOKEN'
33+ #. Activate the `SonarQubeCloud App <https://github.com/apps/sonarqubecloud >`__
34+ #. **Post-merge **: update the branch protections to include SonarQube analysis.
35+
36+ * This should only be done when tests exist for the project, & that the project is
37+ at a state in which enforced code coverage would not be a burden. For new projects,
38+ we recommend creating an issue to add the SonarQube analysis to the branch protections
39+ at a later point. In such scenarios, SonarQube analysis will still report its analysis
40+ results to the PR, but it will not prevent the PR from being merged.
41+
42+ In Sonar
43+ """"""""
44+ #. Create a project on `SonarCloud <https://sonarcloud.io >`__
45+
46+ * Project key should follow this pattern, e.g. ``com.exasol:python-toolbox ``
47+ * To alter the project further, you will need the help of a SonarQube Admin.
48+
49+ In the code
50+ """""""""""
51+ #. Specify in the ``noxconfig.py `` the relative path to the project's source code in ``Config.source ``
2952 .. code-block :: python
3053
31- source: Path = Path(" exasol/<project-source-folder>" )
32- 2. Add the 'SONAR_TOKEN' to the 'Organization secrets' in GitHub
33- 3. Activate the `SonarQubeCloud App <https://github.com/apps/sonarqubecloud >`__
34- 4. Create a project on `SonarCloud <https://sonarcloud.io >`__
35- 5. Add the following information to the project's file ``pyproject.toml ``
54+ source: Path = Path(" exasol/<source-directory>" )
55+ #. Add the following to the project's file ``pyproject.toml ``
3656 .. code-block :: toml
3757
3858 [tool.sonar]
39- projectKey = "com.exasol:< project-key>"
59+ projectKey = "<sonar- project-key>"
4060 hostUrl = "https://sonarcloud.io"
4161 organization = "exasol"
4262 exclusions = "<source-directory>/version.py,<source_directory>/<directory-to-ignore>/*"
43- 6. Post-merge, update the branch protections to include SonarQube analysis
44-
45- * This should only be done when tests exist for the project, & that the project is
46- at a state in which enforced code coverage would not be a burden. For new projects,
47- we recommend creating an issue to add the SonarQube analysis to the branch protections
48- at a later point. In such scenarios, SonarQube analysis will still report its analysis
49- results to the PR, but it will not prevent the PR from being merged.
5063
5164 .. _configure_sonar_private_project :
5265
@@ -56,27 +69,43 @@ Configuration
5669 As of 2025-07-29, we do not currently have a private project configured. Thus,
5770 these instructions should be scrutinized and refined upon the configuration of one.
5871
59- 1. Specify in the ``noxconfig.py `` the relative path to the project's source code in ``Config.source ``
72+ In GitHub
73+ """""""""
74+ A GitHub Admin will need to:
75+
76+ #. Add the individual 'PRIVATE_SONAR_TOKEN' to the 'Organization secrets'
77+ #. Activate the `exasonarqubeprchecks App <https://github.com/apps/exasonarqubeprchecks >`__
78+ #. **Post-merge **: update the branch protections to include SonarQube analysis.
79+
80+ * This should only be done when tests exist for the project, & that the project is
81+ at a state in which enforced code coverage would not be a burden. For new projects,
82+ we recommend creating an issue to add the SonarQube analysis to the branch protections
83+ at a later point. In such scenarios, SonarQube analysis will still report its analysis
84+ results to the PR, but it will not prevent the PR from being merged.
85+
86+ In Sonar
87+ """"""""
88+ An IT Admin will need to:
89+
90+ #. Create a project on https://sonar.exasol.com
91+
92+ * Project key should follow this pattern, e.g. ``com.exasol:python-toolbox ``
93+
94+
95+ In the code
96+ """""""""""
97+ #. Specify in the ``noxconfig.py `` the relative path to the project's source code in ``Config.source ``
6098 .. code-block :: python
6199
62- source: Path = Path(" exasol/<project-source-folder>" )
63- 2. Add the individual 'PRIVATE_SONAR_TOKEN' to the 'Organization secrets' in GitHub
64- 3. Activate the `exasonarqubeprchecks App <https://github.com/apps/exasonarqubeprchecks >`__
65- 4. Create a project on https://sonar.exasol.com
66- 5. Add the following information to the project's file `pyproject.toml `
100+ source: Path = Path(" exasol/<source-directory>" )
101+
102+ #. Add the following to the project's file ``pyproject.toml ``
67103 .. code-block :: toml
68104
69105 [tool.sonar]
70106 projectKey = "com.exasol:<project-key>"
71107 hostUrl = "https://sonar.exasol.com"
72108 organization = "exasol"
73109 exclusions = "<source-directory>/version.py,<source_directory>/<directory-to-ignore>/*"
74- 6. Post-merge, update the branch protections to include SonarQube analysis from exasonarqubeprchecks
75-
76- * This should only be done when tests exist for the project, & that the project is
77- at a state in which enforced code coverage would not be a burden. For new projects,
78- we recommend creating an issue to add the SonarQube analysis to the branch protections
79- at a later point. In such scenarios, SonarQube analysis will still report its analysis
80- results to the PR, but it will not prevent the PR from being merged.
81110
82111 .. _Exasol Way : https://sonarcloud.io/organizations/exasol/quality_gates/show/AXxvLH-3BdtLlpiYmZhh
0 commit comments