You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Feature/372 create converter for pip audit vulnerabilities (#387)
* Add JSON output for pip-audit for security pipeline
- The current implementation chain parses a CVE from the title.
While we could initially send non-CVEs, the difficulty would
lie in updating the subsequent code to accomodate that.
- For more information, see #387 (comment)
* Add documentation for GitHub security-issues action
* Run changelog:updated check when on a branch != main
* Fix typo in dependencies & remove unused import
* Fix formatting missed in previous work
* Remove redundant variable usage
* Remove dependency:audit from CI pipelines as unnecessary and reduce options
#. Provide library code, scripts and commands for common developer tasks within a python project.
27
-
#. Provide and maintain commonly required functionality for python project
27
+
#. Provide and maintain commonly required functionality for a python project
28
28
* Common Projects Tasks
29
29
- apply code formatters
30
30
- lint project
@@ -33,6 +33,7 @@ This project mainly serves three main purposes:
33
33
- run integration tests
34
34
- determine code coverage
35
35
- build-, open-, clean- documentation
36
+
- creates GitHub Issues for vulnerabilities
36
37
* CI (verify PR's and merges)
37
38
* CI/CD (verify and publish releases)
38
39
* Build & Publish Documentation (verify and publish documentation)
@@ -45,16 +46,16 @@ Design
45
46
46
47
Design Principles
47
48
+++++++++++++++++
48
-
* This project needs to be thought of as development dependency only!
49
-
- Library code should not imported/used in nondevelopment code of the projects
49
+
* This project needs to be thought of as a development dependency only!
50
+
- Library code should not imported/used in non-development code of the projects
50
51
* Convention over configuration
51
52
- Being able to assume conventions reduces the code base/paths significantly
52
53
- First thought always should be: Can it be done easily by using/applying convention(s)
53
54
- Use configuration if it's more practical or if it simplifies transitioning projects
54
-
* Provide extension points (hooks) where for project specific behaviour
55
+
* Provide extension points (hooks) for project specific behaviour
55
56
- If it can't be a convention or configuration setting
56
57
- If having something as a convention or configuration significantly complicates the implementation
57
-
- If you have a obvious use case within at least one project
58
+
- If you have an obvious use case within at least one project
58
59
* KISS (Keep It Stupid Simple)
59
60
- This project shall simplify the work of the developer, not add a burden on top
60
61
- Try to automate as much as possible
@@ -64,7 +65,7 @@ Design Principles
64
65
.. note::
65
66
66
67
It is clear that not everything can and will be automated right from the beginning,
67
-
but there should be continues effort to improve the work of the developers.
68
+
but there should be continuous effort to improve the work of the developers.
68
69
69
70
e.g.:
70
71
@@ -114,18 +115,18 @@ Design Principles
114
115
115
116
Design Decisions
116
117
++++++++++++++++
117
-
* Whenever possible tools provided or required by the toolbox should get their configuration from the projects *pyproject.toml* file.
118
-
* Whenever a more dynamic configuration is needed it should be made part of the config object in the projects *noxconfig.py* file.
119
-
* The required standard tooling used within the toolbox will obey what have been agreed upon in the exasol `python-styleguide <https://exasol.github.io/python-styleguide/guides/tooling.html>`_.
120
-
* As Task runner the toolbox will be using nox
118
+
* Whenever possible, tools provided or required by the toolbox should get their configuration from the projects *pyproject.toml* file.
119
+
* Whenever a more dynamic configuration is needed, it should be made part of the config object in the projects *noxconfig.py* file.
120
+
* The required standard tooling used within the toolbox will obey what has been agreed upon in the Exasol `python-styleguide <https://exasol.github.io/python-styleguide/guides/tooling.html>`_.
121
+
* For a task runner, the toolbox will be using nox
121
122
.. warning:: Known Issue(s)
122
123
123
124
Nox tasks should not call (notify) other nox tasks. This can lead to unexpected behaviour
124
125
due to the fact that the job/task queue will `execute a task only once <https://nox.thea.codes/en/stable/config.html#nox.sessions.Session.notify>`_.
125
126
126
-
Therefore all functionality which need to be reused or called multiple times within or by different nox tasks,
127
-
should be provided by python code (e.g. functions) which is receiving a nox session as argument
128
-
but isn't annotated as a nox session/task (`@nox.session <https://nox.thea.codes/en/stable/config.html#defining-sessions>`_).
127
+
Therefore, all functionality, which needs to be re-used, called multiple times calls, or is used by different nox tasks,
128
+
should be provided by python code (e.g. functions) which receives a nox session as an argument, but the code itself
129
+
shall not be annotated as a nox session/task (`@nox.session <https://nox.thea.codes/en/stable/config.html#defining-sessions>`_).
129
130
130
131
.. note::
131
132
@@ -136,11 +137,11 @@ Design Decisions
136
137
* It is already used by a couple of our projects, so the team is familiar with it
137
138
* The author of the toolbox is very familiar with it
138
139
139
-
That said, no indepth evaluation of other tools haven been done.
140
+
That said, no in-depth evaluation of other tools has been done.
140
141
141
142
142
-
* Workflows (CI/CD & Co.) will be github actions based
143
-
- This is the standard tool within the exasol integration team
143
+
* Workflows (CI/CD & Co.) will be GitHub Actions-based
144
+
- This is the standard tool within the Exasol Integration Team
144
145
* Workflows only shall provide an execution environment and orchestrate the execution itself
The `security-issues/action.yml` assumes that eventually every known vulnerability will
264
+
be associated with a singular CVE.
265
+
266
+
* This can be problematic as vulnerabilities may be initially reported to different
267
+
services and not receive a CVE until a few days later or, in some cases, never. This
268
+
could mean that some vulnerabilities are initially missed or, in some cases,
269
+
never propagated by our action.
270
+
* Additionally, reporting tools like `pip-audit` must link a vulnerability with the
271
+
different vulnerability IDs from different reporting services. Typically, this is done
272
+
by selecting 1 of the vulnerability IDs as the unique identifier of the vulnerability.
273
+
This, as is the case for `pip-audit`, may not be the CVE, so it is possible if the
274
+
linked vulnerability IDs were to change (i.e. wrongly linked CVE) that we could end
275
+
up with multiple GitHub Issues for the same underlying vulnerability.
212
276
213
277
214
278
Known Issues
@@ -222,7 +286,7 @@ Passing files as individual arguments on the CLI
222
286
223
287
**Description:**
224
288
225
-
As of today selection of python files for linting, formatting etc. is done by passing all relevant python files as individual argument(s)
289
+
As of today selection of Python files for linting, formatting etc. is done by passing all relevant python files as individual argument(s)
226
290
to the tools used/invoked by the python toolbox.
227
291
228
292
**Downsides:**
@@ -312,7 +376,7 @@ While Nox isn't a perfect fit, it still meets most of our requirements for a tas
312
376
313
377
**Rationale/History:**
314
378
315
-
Why Nox was choosen:
379
+
Why Nox was chosen:
316
380
317
381
- No additional language(s) required: There was no need to introduce extra programming languages or binaries, simplifying the development process.
318
382
- Python-based: Being Python-based, Nox can be extended and understood by Python developers.
@@ -341,8 +405,8 @@ Poetry for Project Management
341
405
+++++++++++++++++++++++++++++
342
406
343
407
While poetry was and is a good choice for Exasol project, dependency, build tool etc. "most recently"
344
-
`uv <https://docs.astral.sh/uv/>`_ has surfaced and made big advanced. Looking at uv it addresses additional itches with
345
-
our projects and therefore in the long run it may be a good idea to migrate our project setups to it.
408
+
`uv <https://docs.astral.sh/uv/>`_ has surfaced and made big advancements. Looking at uv it addresses additional itches with
409
+
our projects, and, therefore, in the long run, it may be a good idea to migrate our project setups to it.
346
410
Use poetry for project, build and dependency management.
347
411
348
412
@@ -351,7 +415,7 @@ Code Formatting
351
415
352
416
**Description:**
353
417
354
-
Currently we use Black and Isort for code formatting, though running them on a larger code base as pre-commit hooks or such can take quite a bit of time.
418
+
Currently, we use Black and Isort for code formatting, though running them on a larger code base as pre-commit hooks or such can take quite a bit of time.
355
419
356
420
**Downsides:**
357
421
@@ -367,7 +431,7 @@ Currently we use Black and Isort for code formatting, though running them on a l
367
431
368
432
**Ideas/Solutions:**
369
433
370
-
As `Ruff <https://docs.astral.sh/ruff/>`_ is fairly stable and also tested and used by many Python projects
434
+
As `Ruff <https://docs.astral.sh/ruff/>`_ is fairly stable and also tested and used by many Python projects,
371
435
we should consider transitioning to it.
372
436
373
437
Advantages:
@@ -393,20 +457,20 @@ We are currently using Pylint instead of Ruff.
393
457
394
458
**Rationale/History:**
395
459
396
-
- Wellknown
460
+
- Well-known
397
461
- Pylint provides built-in project score/rating
398
462
- Project score is good for improving legacy code bases which haven't been linted previously
399
463
- Plugin support
400
464
401
465
**Ideas/Possible Solutions:**
402
466
403
-
Replacing Pylint with Ruff for linting would provide significant performance improvement. Additionally, Ruff offers an LSP and IDE integrations and is widely used these days. Additionaly there would be an additional synergy if we adopt ruff for formatting the code base.
467
+
Replacing Pylint with Ruff for linting would provide significant performance improvement. Additionally, Ruff offers an LSP and IDE integrations and is widely used these days. Additionally, there would be an additional synergy if we adopt ruff for formatting the code base.
404
468
405
469
Transitioning to Ruff requires us to adjust the migration and improvement strategies for our projects:
406
470
407
471
- Currently, our codebase improvements are guided by scores. However, with Ruff, a new approach is necessary. For example, we could incrementally introduce specific linting rules, fix the related issues, and then enforce these rules.
408
472
409
-
- The project rating and scoring system will also need modification. One possiblity would be to run Ruff and Pylint in parallel, utilizing Pylint solely for rating and issue resolution while Ruff is incorporated for linting tasks.
473
+
- The project rating and scoring system will also need modification. One possibility would be to run Ruff and Pylint in parallel, utilizing Pylint solely for rating and issue resolution while Ruff is incorporated for linting tasks.
0 commit comments