Skip to content

Commit 1bb5bdb

Browse files
Merge branch 'main' into feature/#409-Doc-link-&-checks
2 parents 9c666d6 + a2ad1e2 commit 1bb5bdb

37 files changed

+898
-655
lines changed

.github/actions/security-issues/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ runs:
3939
- name: Install Python Toolbox / Security tool
4040
shell: bash
4141
run: |
42-
pip install exasol-toolbox==1.3.0
42+
pip install exasol-toolbox==1.4.0
4343
4444
- name: Create Security Issue Report
4545
shell: bash

.github/workflows/ci.yml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,21 @@
11
name: CI
22

33
on:
4-
push:
5-
branches-ignore:
6-
- "github-pages/*"
7-
- "gh-pages/*"
8-
- "main"
9-
- "master"
4+
pull_request:
5+
types: [opened, synchronize, reopened]
106
schedule:
11-
# At 00:00 on every 7th day-of-month from 1 through 31. (https://crontab.guru)
7+
# At 00:00 on every 7th day-of-month from 1 through 31. (https://crontab.guru)
128
- cron: "0 0 1/7 * *"
139

1410
jobs:
15-
1611
CI:
1712
uses: ./.github/workflows/merge-gate.yml
1813
secrets: inherit
1914
permissions:
2015
contents: read
21-
2216
Metrics:
2317
needs: [ CI ]
2418
uses: ./.github/workflows/report.yml
19+
secrets: inherit
2520
permissions:
2621
contents: read

.github/workflows/pr-merge.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,6 @@ jobs:
2525
metrics:
2626
needs: [ ci-job ]
2727
uses: ./.github/workflows/report.yml
28+
secrets: inherit
2829
permissions:
2930
contents: read

.github/workflows/report.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ jobs:
3535
- name: Generate Report
3636
run: poetry run -- nox -s project:report -- --format json | tee metrics.json
3737

38+
- name: Upload to sonar
39+
run: poetry run -- nox -s sonar:check -- ${{ secrets.SONAR_TOKEN }}
40+
3841
- name: Upload Artifacts
3942
uses: actions/[email protected]
4043
with:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ odbcconfig/odbcinst.ini
77
.html-documentation
88

99
.coverage
10+
.sonar
1011

1112
_build/
1213

doc/changes/changelog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Changelog
22

33
* [unreleased](unreleased.md)
4+
* [1.4.0](changes_1.4.0.md)
45
* [1.3.0](changes_1.3.0.md)
56
* [1.2.0](changes_1.2.0.md)
67
* [1.1.0](changes_1.1.0.md)
@@ -35,6 +36,7 @@
3536
hidden:
3637
---
3738
unreleased
39+
changes_1.4.0
3840
changes_1.3.0
3941
changes_1.2.0
4042
changes_1.1.0

doc/changes/changes_1.4.0.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# 1.4.0 - 2025-06-06
2+
3+
## Summary
4+
5+
## ✨ Features
6+
7+
* #426: Allowed configuring the python version used for coverage
8+
9+
## Bugfixes
10+
11+
* #463: Fixed dependency:licenses to correctly parse exceptional names

doc/changes/unreleased.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,30 @@
11
# Unreleased
22

33
## Summary
4+
This version of the PTB adds nox task `sonar:check`, see #451. This allows us to
5+
use SonarQube Cloud to analyze, visualize, & track linting, security, & coverage. In
6+
order to properly set it up, you'll need to do the following instruction for each **public** project.
7+
At this time, PTB currently does not support setting up SonarQube for a **private** project.
8+
9+
1. Specify in the `noxconfig.py` the relative path to the project's source code in `Config.source`
10+
```python
11+
source: Path = Path("exasol/toolbox")
12+
```
13+
2. Add the 'SONAR_TOKEN' to the 'Organization secrets' in GitHub (this requires a person being a GitHub organization owner).
14+
3. Activate the SonarQubeCloud App
15+
4. Create a project on SonarCloud
16+
5. Add the following information to the project's file `pyproject.toml`
17+
```toml
18+
[tool.sonar]
19+
projectKey = "com.exasol:<project-key>"
20+
hostUrl = "https://sonarcloud.io"
21+
organization = "exasol"
22+
```
23+
6. Post-merge, update the branch protections to include SonarQube analysis
424

525
## ✨ Features
26+
* #451: Added nox task to execute pysonar & added Sonar to the CI
27+
* #409: Doc link & checks
628

7-
* #426: Allowed configuring the python version used for coverage
8-
* [#409](https://github.com/exasol/python-toolbox/issues/409): Doc link & checks
29+
## ⚒️ Refactorings
30+
* #451: Reduced scope of nox tasks `lint:code` (pylint) and `lint:security` (bandit) to analyze only the package code

doc/user_guide/getting_started.rst

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,8 @@ forward, and you just can use the example *noxfile.py* below.
181181
182182
.. _toolbox tasks:
183183

184-
7. Setup for deploying documentation (optional)
185-
+++++++++++++++++++++++++++++++++++++++++++++++
184+
7. Set up for deploying documentation (optional)
185+
++++++++++++++++++++++++++++++++++++++++++++++++
186186
Within the `gh-pages.yml`, we use the GitHub `upload-pages-artifact` and `deploy-pages`
187187
actions. In order to properly deploy your pages, you'll need to reconfigure the GitHub
188188
Pages settings for the repo:
@@ -201,8 +201,32 @@ We also need to configure settings for github-pages environment:
201201
5. In the 'Deployment branches and tags', click 'Add deployment branch or tag rule'
202202
6. 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
205+
+++++++++++++++++++
206+
PTB supports using SonarQube Cloud to analyze, visualize, & track linting, security, &
207+
coverage. In order to properly set it up, you'll need to do the following instructions
208+
for each **public** project. At this time, PTB currently does not support setting up
209+
SonarQube for a **private** project.
204210

205-
8. Go 🥜
211+
1. Specify in the `noxconfig.py` the relative path to the project's source code in `Config.source`
212+
.. code-block:: python
213+
214+
source: Path = Path("exasol/toolbox")
215+
2. Add the 'SONAR_TOKEN' to the 'Organization secrets' in GitHub (this requires a person being a GitHub organization owner).
216+
3. Activate the SonarQubeCloud App
217+
4. Create a project on SonarCloud
218+
5. Add the following information to the project's file `pyproject.toml`
219+
.. code-block:: toml
220+
221+
[tool.sonar]
222+
projectKey = "com.exasol:<project-key>"
223+
hostUrl = "https://sonarcloud.io"
224+
organization = "exasol"
225+
6. Post-merge, update the branch protections to include SonarQube analysis
226+
227+
228+
229+
9. Go 🥜
206230
+++++++++++++
207231
You are ready to use the toolbox. With *nox -l* you can list all available tasks.
208232

0 commit comments

Comments
 (0)