Skip to content

ADD: CI for the client suites and security scans - #44

Closed
Jules-GP wants to merge 4 commits into
DCBIA-OrthoLab:mainfrom
Jules-GP:ci/tests-and-security
Closed

Jules-GP wants to merge 4 commits into
DCBIA-OrthoLab:mainfrom
Jules-GP:ci/tests-and-security

Conversation

@Jules-GP

Copy link
Copy Markdown
Collaborator

The repository had no CI. This adds three workflows and Dependabot for the actions they use.

Workflows

tests.yml: every module's Testing/Python suite on Ubuntu, Windows and macOS, with Python 3.12 (the Python Slicer Stable and Preview both ship). The suites stub Slicer, Qt and the server and need only requests. Folders are found from the checkout, so a new module is tested without editing the workflow. Windows is in the matrix because the os.pwrite failure fixed in #43 would have been caught there.

security.yml:

  • gitleaks over the full git history (the image pinned by digest; gitleaks-action needs a paid licence on an organisation repository). The history is clean today.
  • bandit, medium severity and above, tests excluded. Run on 3.12 so the two MRI2CBCT files using 3.12 f-string syntax are parsed rather than skipped.
  • zizmor, auditing the workflows themselves (injection, over-broad permissions, credential persistence).
  • Also weekly, so new rules reach code nobody has touched.

codeql.yml: CodeQL security-extended for Python and for the Actions workflows. Findings go to the Security tab.

All workflows run with contents: read (CodeQL adds security-events: write), every action is pinned to a commit SHA, and checkouts do not persist credentials.

Changes needed to make them pass

  • Three tests failed on main: two still imported AutoCrop3D / FlexReg from before the *Remote rename (Suffix every module and library that shares a name with AutomatedDentalTools #38), and the cohort batch tests gave the panel no client since the batch policy call was added. Fixed.
  • Bandit's medium findings, one by one:
    • design.py: the MD5 naming cached icons is marked usedforsecurity=False.
    • slicer_io.py: 0.0.0.0 is compared against, never bound.
    • Fixed https download URLs in CNE, VFACE and MRI2CBCT: # nosec B310, with the reason above each.
    • The anonymizer parsing the clinician's own XML file with the stdlib parser (no external entities): # nosec B314.

Suggested repository settings (not changed here)

  • Enable secret scanning and push protection (free on public repositories; currently disabled), so a token is refused at push time rather than found afterwards.
  • Enable Dependabot security updates.
  • Once these checks have run a few times, make tests and security required on main.

Copilot AI balanced review requested due to automatic review settings October 22, 2026 19:49

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@Jules-GP

Copy link
Copy Markdown
Collaborator Author

Superseded by #45, the same commits from a branch of this repository: workflows added from a fork never started here.

@Jules-GP Jules-GP closed this Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants