Skip to content
Merged
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
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.11.13-alpine3.22
FROM python:3.11.15-alpine3.23

# Create a non-root user
RUN addgroup -g 1001 -S appgroup && \
Expand All @@ -9,10 +9,10 @@

# Copy requirements and install dependencies as root (needed for pip install)
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

Check warning on line 12 in Dockerfile

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Using dependencies without locking resolved versions is security-sensitive.

See more on https://sonarcloud.io/project/issues?id=Health-RI_XNAT-Maintenance-Monitoring-scripts&issues=AZ3eaSw80DUmP5uD-mfW&open=AZ3eaSw80DUmP5uD-mfW&pullRequest=4

Check warning on line 12 in Dockerfile

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Omitting "--only-binary :all:" can lead to the execution of setup scripts. Make sure it is safe here.

See more on https://sonarcloud.io/project/issues?id=Health-RI_XNAT-Maintenance-Monitoring-scripts&issues=AZ3eaSw80DUmP5uD-mfV&open=AZ3eaSw80DUmP5uD-mfV&pullRequest=4

# Copy application files
COPY scripts/ ./scripts/
COPY src/xnat_maintenance_monitoring_scripts/ ./scripts/
COPY entrypoint.py ./

# Change ownership of the app directory to the non-root user
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ You can also run the scripts directly with Python if you have the dependencies i

Run in the terminal with:
```bash
python scripts/users_per_project.py --xnat_url https://xnat.health-ri.nl
python src/xnat_maintenance_monitoring_scripts/users_per_project.py --xnat_url https://xnat.health-ri.nl
```
to query the whole XNAT.
Run the following to query only 'sandbox'
```bash
python scripts/users_per_project.py --xnat_url https://xnat.health-ri.nl --project sandbox
python src/xnat_maintenance_monitoring_scripts/users_per_project.py --xnat_url https://xnat.health-ri.nl --project sandbox
```

You need to have 'Owner' or 'Site admin' priviliges to run this script on a project.
Expand All @@ -75,7 +75,7 @@ This script returns a CSV file "./{today}_XNAT_users_per_project.csv", with the

Run in the terminal with:
```bash
python scripts/disk_usages.py --xnat_url https://xnat.health-ri.nl --report_path ./input_disk_usage_report.txt --study_overview ./studyoverview.csv
python src/xnat_maintenance_monitoring_scripts/disk_usages.py --xnat_url https://xnat.health-ri.nl --report_path ./input_disk_usage_report.txt --study_overview ./studyoverview.csv
```
to query the whole XNAT.

Expand Down
7 changes: 3 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Repository = "https://github.com/Health-RI/XNAT-Maintenance-Monitoring-scripts.g
Issues = "https://github.com/Health-RI/XNAT-Maintenance-Monitoring-scripts/issues"

[tool.hatch.build.targets.wheel]
packages = ["scripts"]
packages = ["src/xnat_maintenance_monitoring_scripts"]

[tool.hatch.version]
source = "vcs"
Expand All @@ -53,16 +53,15 @@ python = ["3.9", "3.10", "3.11", "3.12"]
[tool.hatch.envs.test.scripts]
test = "pytest {args:tests}"
test-cov = "coverage run -m pytest {args:tests}"
cov-report = ["- coverage combine", "coverage report", "coverage xml"]
cov-report = ["- coverage combine", "- coverage report", "- coverage xml"]
cov = ["test-cov", "cov-report"]

[tool.coverage.run]
source_pkgs = ["scripts", "tests"]
source_pkgs = ["xnat_maintenance_monitoring_scripts"]
branch = true
parallel = true

[tool.coverage.paths]
sempyro = ["scripts"]
tests = ["tests"]

[tool.coverage.report]
Expand Down
File renamed without changes.
3 changes: 3 additions & 0 deletions tests/test_stub.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
import xnat_maintenance_monitoring_scripts.disk_usages
import xnat_maintenance_monitoring_scripts.users_per_project

def test_pass():
assert True

Check warning on line 5 in tests/test_stub.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace this expression; its boolean value is constant.

See more on https://sonarcloud.io/project/issues?id=Health-RI_XNAT-Maintenance-Monitoring-scripts&issues=AZ3eaSwz0DUmP5uD-mfU&open=AZ3eaSwz0DUmP5uD-mfU&pullRequest=4
Loading