Skip to content

Commit c689dda

Browse files
authored
Merge branch 'main' into tl-add-security-md
2 parents 7d971f6 + 58773f8 commit c689dda

File tree

22 files changed

+618
-225
lines changed

22 files changed

+618
-225
lines changed

.github/workflows/checks.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,25 @@ jobs:
117117
path: .security.json
118118
include-hidden-files: true
119119

120+
Vulnerabilities:
121+
name: Check Vulnerabilities (Python-${{ matrix.python-version }})
122+
needs: [ Version-Check, build-matrix ]
123+
runs-on: ubuntu-latest
124+
strategy:
125+
matrix: ${{ fromJson(needs.build-matrix.outputs.matrix) }}
126+
127+
steps:
128+
- name: SCM Checkout
129+
uses: actions/checkout@v4
130+
131+
- name: Setup Python & Poetry Environment
132+
uses: ./.github/actions/python-environment
133+
with:
134+
python-version: ${{ matrix.python-version }}
135+
136+
- name: Run Package vulnerabilities Check
137+
run: poetry run nox -s dependency:audit
138+
120139
Format:
121140
name: Format Check
122141
runs-on: ubuntu-latest

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+
* [0.21.0](changes_0.21.0.md)
45
* [0.20.0](changes_0.20.0.md)
56
* [0.19.0](changes_0.19.0.md)
67
* [0.18.0](changes_0.18.0.md)
@@ -29,6 +30,7 @@
2930
hidden:
3031
---
3132
unreleased
33+
changes_0.21.0
3234
changes_0.20.0
3335
changes_0.19.0
3436
changes_0.18.0

doc/changes/changes_0.21.0.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# 0.21.0 - 2025-02-25
2+
3+
## ✨ Features
4+
5+
* Added tbx task for markdown formating of .lint.json
6+
* Added a Nox task for dependencies packages and their licenses with Markdown output
7+
* [#293](https://github.com/exasol/python-toolbox/issues/293): Added `py.typed` file
8+
9+
## 🐞 Fixed
10+
* Fixed an issue in the CI workflow that caused it to be executed twice on the initial push of a PR if the PR branch was on the repo itself.
11+
12+
🚨 Attention: Due to these changes, the workflows will no longer be executed if the PR comes from a branch not located in this repository.
13+
As third-party contributions from outside forks are rare to nearly non-existent, this downside was considered a reasonable trade-off at this time.
14+
15+
## 📚 Documentation
16+
* Updated design doc (Added known Issues)
17+
* Updated migration progress table
18+
* Updated the FAQ with an entry about the ``isort`` compatibility issue
19+
* [#351](https://github.com/exasol/python-toolbox/issues/351), [#352](https://github.com/exasol/python-toolbox/issues/352): updated user guide
20+
21+
## 🔧 Changed
22+
* Updated `actions/upload-artifacts` version to `4.6.0`
23+
24+
## 🔩 Internal
25+
* Relocked dependencies
26+
* Update referenced github actions
27+
28+
## ⚒️ Refactorings
29+
* [#339](https://github.com/exasol/python-toolbox/issues/339): Secret ALTERNATIVE_GITHUB_TOKEN removed from GitHub workflows

doc/changes/unreleased.md

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,4 @@
22

33
## ✨ Added
44

5-
* added tbx task for markdown formating of .lint.json
6-
* Added a Nox task for dependencies packages and their licenses with Markdown output
7-
8-
## 🐞 Fixed
9-
* Fixed an issue in the CI workflow that caused it to be executed twice on the initial push of a PR if the PR branch was on the repo itself.
10-
11-
🚨 Attention: Due to these changes, the workflows will no longer be executed if the PR comes from a branch not located in this repository.
12-
As third-party contributions from outside forks are rare to nearly non-existent, this downside was considered a reasonable trade-off at this time.
13-
14-
## 📚 Documentation
15-
* Updated design doc (Added known Issues)
16-
* Updated migration progress table
17-
* Updated the FAQ with an entry about the ``isort`` compatibility issue
18-
* [#351](https://github.com/exasol/python-toolbox/issues/351), [#352](https://github.com/exasol/python-toolbox/issues/352): updated user guide
19-
20-
## 🔧 Changed
21-
* Updated `actions/upload-artifacts` version to `4.6.0`
22-
23-
## 🔩 Internal
24-
* Relocked dependencies
25-
* Update referenced github actions
26-
27-
## ⚒️ Refactorings
28-
* [#339](https://github.com/exasol/python-toolbox/issues/339): Secret ALTERNATIVE_GITHUB_TOKEN removed from GitHub workflows
5+
* [#73](https://github.com/exasol/python-toolbox/issues/73): Added nox target for auditing work spaces in regard to known vulnerabilities

doc/developer_guide/developer_guide.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
:maxdepth: 2
99

1010
../design
11-
development
1211
plugins
1312
modules/modules
13+
../user_guide/how_to_release

doc/developer_guide/development.rst

Lines changed: 0 additions & 77 deletions
This file was deleted.

doc/user_guide/how_to_release.rst

Lines changed: 76 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,79 @@
11
How to Release?
22
===============
33

4-
#. Use :code:`nox -s release:prepare` to prepare the project for a new release.
5-
#. Merge your **Pull Request** to the **default branch**
6-
#. Use :code:`git remote show origin | sed -n '/HEAD branch/s/.*: //p'` to output the **default branch**
7-
#. Use :code:`git checkout <default branch>` Switch to the **default branch**
8-
#. Use :code:`git pull` to update branch
9-
#. Use :code:`TAG=<name>` to set a variable named **"TAG"**
10-
#. Use :code:`git tag "${TAG}"` to create a new tag in your repo
11-
#. Use :code:`git push origin "${TAG}"` to push it to remote
12-
#. GitHub workflow **CD** reacts on this tag and starts the release process
4+
Creating a Release
5+
++++++++++++++++++
6+
7+
1. Set a variable named **TAG** with the appropriate version numbers:
8+
9+
.. code-block:: shell
10+
11+
TAG="<major>.<minor>.<patch>"
12+
13+
#. Prepare the project for a new release:
14+
15+
.. code-block:: shell
16+
17+
nox -s release:prepare -- "${TAG}"
18+
19+
#. Merge your **Pull Request** to the **default branch**
20+
#. Switch to the **default branch**:
21+
22+
.. code-block:: shell
23+
24+
git checkout $(git remote show origin | sed -n '/HEAD branch/s/.*: //p')
25+
26+
#. Update branch:
27+
28+
.. code-block:: shell
29+
30+
git pull
31+
32+
#. Create a new tag in your local repo:
33+
34+
.. code-block:: shell
35+
36+
git tag "${TAG}"
37+
38+
#. Push the repo to remote:
39+
40+
.. code-block:: shell
41+
42+
git push origin "${TAG}"
43+
44+
.. hint::
45+
46+
GitHub workflow **.github/workflows/cd.yml** reacts on this tag and starts the release process
47+
48+
What to do if the release failed?
49+
+++++++++++++++++++++++++++++++++
50+
51+
The release failed during pre-release checks
52+
--------------------------------------------
53+
54+
#. Delete the local tag
55+
56+
.. code-block:: shell
57+
58+
git tag -d "${TAG}"
59+
60+
#. Delete the remote tag
61+
62+
.. code-block:: shell
63+
64+
git push --delete origin "${TAG}"
65+
66+
#. Fix the issue(s) which lead to the failing checks
67+
#. Start the release process from the beginning
68+
69+
70+
One of the release steps failed (Partial Release)
71+
-------------------------------------------------
72+
#. Check the Github action/workflow to see which steps failed
73+
#. Finish or redo the failed release steps manually
74+
75+
.. note:: Example
76+
77+
**Scenario**: Publishing of the release on Github was successfully but during the PyPi release, the upload step got interrupted.
78+
79+
**Solution**: Manually push the package to PyPi

exasol/toolbox/nox/_dependencies.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,10 +212,20 @@ def _normalize_package_name(name: str) -> str:
212212
return template.format(heading=heading(), rows=rows)
213213

214214

215+
def _audit(session: Session) -> None:
216+
session.run("poetry", "run", "pip-audit")
217+
218+
215219
@nox.session(name="dependency:licenses", python=False)
216220
def dependency_licenses(session: Session) -> None:
217221
"""returns the packages and their licenses"""
218222
toml = Path("pyproject.toml")
219223
dependencies = _dependencies(toml.read_text())
220224
package_infos = _licenses()
221225
print(_packages_to_markdown(dependencies=dependencies, packages=package_infos))
226+
227+
228+
@nox.session(name="dependency:audit", python=False)
229+
def audit(session: Session) -> None:
230+
"""Check for known vulnerabilities"""
231+
_audit(session)

exasol/toolbox/nox/tasks.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ def check(session: Session) -> None:
8181

8282
from exasol.toolbox.nox._dependencies import (
8383
dependency_licenses,
84+
audit
8485
)
8586

8687
# isort: on

exasol/toolbox/py.typed

Whitespace-only changes.

0 commit comments

Comments
 (0)