Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Changes here will be overwritten by Copier
_commit: v7.3.0-24-g169e035
_commit: v8.5.0-3-g60fcc85
_src_path: gh:eccenca/cmem-plugin-template
author_mail: cmempy-developer@eccenca.com
author_name: eccenca GmbH
Expand Down
19 changes: 13 additions & 6 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ jobs:
- name: Check out repository
uses: actions/checkout@v5

- name: Cache Trivy DB
id: cache-trivydb
uses: actions/cache@v4
with:
path: .trivycache
key: ${{ runner.os }}-trivydb

- name: Install Task
uses: arduino/setup-task@v2

Expand All @@ -38,10 +45,6 @@ jobs:
virtualenvs-in-project: true
installer-parallel: true

- name: Install dynamic versioning plugin
run: |
poetry self add "poetry-dynamic-versioning[plugin]"

- name: mypy
run: |
task check:mypy
Expand All @@ -61,9 +64,13 @@ jobs:
run: |
task check:deptry

- name: safety
- name: trivy
env:
TRIVY_NO_PROGRESS: "true"
TRIVY_CACHE_DIR: ".trivycache/"
TRIVY_DISABLE_VEX_NOTICE: "true"
run: |
task check:safety
task check:trivy

- name: Publish Test Report in Action
uses: mikepenz/action-junit-report@v4
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ jobs:
virtualenvs-in-project: true
installer-parallel: true

- name: Install dynamic versioning plugin
run: |
poetry self add "poetry-dynamic-versioning[plugin]"

- name: Publish Package
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ dmypy.json
# Cython debug symbols
cython_debug/

# Claude code specifics
.claude/settings.local.json

# project build plan specific ignores
version.py
co
Expand Down
15 changes: 11 additions & 4 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
default:
image: docker-registry.eccenca.com/eccenca-python:v3.13.8
image: docker-registry.eccenca.com/eccenca-python:v3.13.13
# all jobs can be interrupted in case a new commit is pushed
interruptible: true
before_script:
Expand Down Expand Up @@ -60,17 +60,24 @@ deptry:
script:
- task check:deptry

safety:
trivy:
stage: test
variables:
TRIVY_NO_PROGRESS: "true"
TRIVY_CACHE_DIR: ".trivycache/"
TRIVY_DISABLE_VEX_NOTICE: "true"
script:
- task check:safety
- task check:trivy
cache:
paths:
- .trivycache/

build:
stage: build
needs:
- mypy
- pytest
- safety
- trivy
- deptry
script:
- task build
Expand Down
4 changes: 1 addition & 3 deletions .idea/cmem-plugin-validation.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
---
default_language_version:
python: python3.13

repos:
- repo: local
hooks:
Expand Down Expand Up @@ -36,3 +39,9 @@ repos:
stages: [post-checkout, post-merge]
always_run: true

- id: trivy
name: check:trivy
description: run trivy to scan for vulnerabilities
entry: task check:trivy
language: python
pass_filenames: false
4 changes: 4 additions & 0 deletions .trivyignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# .trivyignore

# ignore 51358 safety - dev dependency only
CVE-2022-39280
44 changes: 11 additions & 33 deletions Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,36 +44,9 @@ tasks:
cmds:
- mkdir -p {{.DIST_DIR}}/coverage

poetry:check:
internal: true
platforms: [darwin, linux]
summary: |
Check poetry versioning plugin. Currently not under Windows
run: once
preconditions:
- sh: '[ -d .git ]'
msg: >
Your newly created project directory needs to be initialized
as a git repository.
- sh: '[[ {{.PDV_VERSION}} > {{.PDV_VERSION_MIN}} ]]'
msg: >
This project needs the poetry-dynamic-versioning
plugin > v{{.PDV_VERSION_MIN}}.

You can install it with the following command:
poetry self add "poetry-dynamic-versioning[plugin]"
vars:
PDV_VERSION_MIN: 0.20
PDV_VERSION:
sh: >
poetry self show --addons poetry-dynamic-versioning --tree
| head -1 | cut -d " " -f 2 | cut -d "." -f 1-2

poetry:install:
desc: Install dependencies managed by Poetry
run: once
deps:
- poetry:check
cmds:
- poetry install

Expand Down Expand Up @@ -112,7 +85,7 @@ tasks:
- task: check:ruff
- task: check:mypy
- task: check:deptry
- task: check:safety
- task: check:trivy

check:pytest:
desc: Run unit and integration tests
Expand Down Expand Up @@ -154,12 +127,17 @@ tasks:
vars:
JUNIT_FILE: ./{{.DIST_DIR}}/junit-mypy.xml

check:safety:
desc: Complain about vulnerabilities in dependencies
check:trivy:
desc: Scan for vulnerabilities using Trivy
<<: *preparation
cmds:
# ignore 51358 safety - dev dependency only
- poetry run safety check -i 51358
- >
poetry run trivy fs
--include-dev-deps
--scanners vuln
--skip-files .poetry/plugins/poetry.lock
--exit-code 1
.

check:deptry:
desc: Complain about unused or missing dependencies
Expand All @@ -185,7 +163,7 @@ tasks:
<<: *preparation
deps:
- clean
- poetry:check
cmds:
- poetry build
- poetry export --without=dev -f requirements.txt >dist/requirements.txt

2 changes: 1 addition & 1 deletion cmem_plugin_validation/validate_entities/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ def _get_json_dataset_content(context: ExecutionContext, dataset: str) -> dict |

def _convert_entities_to_json(
self, inputs: Sequence[Entities], path_to_entities: dict[str, Entities], path: str = ""
) -> Generator[dict[str, Any], None, None]:
) -> Generator[dict[str, Any]]:
"""Convert a sequence of Entities into JSON-like dictionaries using recursive traversal."""
for entities in inputs:
# Initialize path-to-entities map for the root level
Expand Down
2 changes: 1 addition & 1 deletion cmem_plugin_validation/validate_graph/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def execute(
process_id = validation.start(
context_graph=self.context_graph,
shape_graph=self.shape_graph,
result_graph=self.result_graph if self.result_graph else None,
result_graph=self.result_graph or None,
query=query,
)
except HTTPError as error:
Expand Down
Loading
Loading