Skip to content

ci: add docs build as parallel CI job [PYSDK-110]#600

Merged
helmut-hoffer-von-ankershoffen merged 3 commits into
mainfrom
chore/PYSDK-110-add-docs-ci-job
Apr 26, 2026
Merged

ci: add docs build as parallel CI job [PYSDK-110]#600
helmut-hoffer-von-ankershoffen merged 3 commits into
mainfrom
chore/PYSDK-110-add-docs-ci-job

Conversation

@helmut-hoffer-von-ankershoffen
Copy link
Copy Markdown
Contributor

@helmut-hoffer-von-ankershoffen helmut-hoffer-von-ankershoffen commented Apr 26, 2026

🛡️ Implements PYSDK-110 following CC-SOP-01 Change Control, part of our ISO 13485-certified QMS | Ketryx Project

Summary

  • Adds .github/workflows/_docs.yml — reusable workflow that runs make docs on ubuntu-latest (no secrets needed), mirroring the pattern of _lint.yml
  • Wires the new docs job into ci-cd.yml in parallel with lint, audit, test, codeql, and sonarcloud — all fanning out from get-commit-message
  • Adds docs to the needs list of ketryx_report_and_check so the gate waits for the docs build
  • Previously make docs was only called in the package-publish workflow; broken docs could silently reach main and only surface at release time

Test plan

  • CI passes on this PR (docs job appears green in the workflow run)
  • ketryx_report_and_check job waits for the docs job before running

🤖 Generated with Claude Code

Add _docs.yml reusable workflow running `make docs` on ubuntu-latest and
wire it into ci-cd.yml in parallel with lint/audit/test so the documentation
build is verified on every PR, not only at publish time.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@helmut-hoffer-von-ankershoffen helmut-hoffer-von-ankershoffen added github_actions Pull requests that update GitHub Actions skip:test:long_running Skip long-running tests (≥5min) labels Apr 26, 2026
Copilot AI review requested due to automatic review settings April 26, 2026 09:43
@helmut-hoffer-von-ankershoffen helmut-hoffer-von-ankershoffen added sop:cc-sop-01 CC-SOP-01 Change Control (feature / planned change) type:ci CI/CD change scope:dev-only Affects only our dev/CI env; consumers unaffected github_actions Pull requests that update GitHub Actions skip:test:long_running Skip long-running tests (≥5min) labels Apr 26, 2026
@helmut-hoffer-von-ankershoffen helmut-hoffer-von-ankershoffen added type:ci CI/CD change scope:dev-only Affects only our dev/CI env; consumers unaffected labels Apr 26, 2026
@helmut-hoffer-von-ankershoffen helmut-hoffer-von-ankershoffen marked this pull request as ready for review April 26, 2026 09:44
@helmut-hoffer-von-ankershoffen helmut-hoffer-von-ankershoffen requested a review from a team as a code owner April 26, 2026 09:44
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a dedicated docs build to the main CI fan-out so documentation breakages are caught on every PR/commit rather than only during release/publish. It aligns the docs build with the existing reusable-workflow pattern already used for lint/audit/test.

Changes:

  • Added a reusable workflow (_docs.yml) that runs make docs on ubuntu-latest using the same uv/dev-tools setup pattern as _lint.yml.
  • Wired a new docs job into ci-cd.yml to run in parallel with the other CI jobs (behind the same skip conditions).
  • Updated the ketryx_report_and_check gate to wait for the new docs job.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
.github/workflows/ci-cd.yml Adds docs job to the CI fan-out and includes it in the Ketryx gating job’s needs.
.github/workflows/_docs.yml New reusable workflow that checks out the repo, installs deps via uv, and runs make docs.

@claude
Copy link
Copy Markdown

claude Bot commented Apr 26, 2026

PR Review Complete ✅

I've thoroughly reviewed the CI/CD workflow changes for PYSDK-110. This is a well-crafted addition that follows established patterns perfectly.


Summary

This PR adds a dedicated documentation build job to the main CI/CD pipeline, ensuring documentation breakages are caught on every PR/commit rather than only during package publishing. The implementation is clean, consistent, and production-ready.

Files Changed:

  • .github/workflows/_docs.yml (new reusable workflow)
  • .github/workflows/ci-cd.yml (integration)

Critical Checks ✅ ALL PASS

1. Workflow Syntax & Structure ✅

  • YAML syntax is valid
  • Perfectly mirrors the pattern established by _lint.yml and _audit.yml
  • All required workflow elements present (name, on, jobs, permissions)

2. Pattern Consistency ✅

Compared _docs.yml with _lint.yml - 100% structural alignment:

# Identical patterns:
✅ workflow_call trigger (no secrets needed)
✅ ubuntu-latest runner
✅ Same permissions (contents: read, id-token: write, packages: read)
✅ Same setup steps (checkout → uv → dev-tools → sync)
✅ Pinned action versions with SHA hashes (security best practice)
✅ fetch-depth: 0 for full git history

3. CI/CD Integration ✅

Parallel Fan-Out: docs job properly integrated into ci-cd.yml:

lint ──┐
docs ──┤
audit ─┼──→ ketryx_report_and_check ──→ package_publish (tags only)
test ──┤
codeql─┘
sonar─┘

Skip Conditions: Correctly respects skip:ci and build:native:only

if: |
  (!contains(needs.get-commit-message.outputs.commit_message, 'skip:ci')) &&
  (!contains(needs.get-commit-message.outputs.commit_message, 'build:native:only')) &&
  (!contains(github.event.pull_request.labels.*.name, 'skip:ci')) &&
  (!contains(github.event.pull_request.labels.*.name, 'build:native:only'))

4. Ketryx Gating ✅

CRITICAL: docs correctly added to ketryx_report_and_check dependencies:

- needs: [get-commit-message, lint, audit, test, codeql, sonarcloud]
+ needs: [get-commit-message, lint, audit, test, codeql, sonarcloud, docs]

This ensures the compliance gate waits for docs build completion ✅

5. Security Review ✅

  • No secrets exposed (correctly marked "No secrets needed")
  • Minimal permissions (read-only except id-token for OIDC)
  • Pinned actions with SHA hashes (prevents supply chain attacks)
  • No sensitive data handling
  • Uses frozen lockfile (--frozen flag prevents dependency tampering)

6. Conventional Commits ✅

Commit message follows standard: ci: add docs build as parallel CI job [PYSDK-110]

7. Functional Verification ✅

Confirmed via gh pr checks 600:

docs / docs: SUCCESS ✅

The workflow is running and passing in CI.

8. No Breaking Changes ✅

This is an additive-only change:

  • ✅ No modifications to existing workflows
  • ✅ No changes to API, CLI, or user-facing functionality
  • ✅ No impact on existing CI behavior (only adds a new gate)

Suggestions (Non-Blocking)

Documentation Update Recommended

The .github/CLAUDE.md file should be updated to document the new _docs.yml workflow:

Location 1: Reusable Workflows table (around line 90)

| **_lint.yml** | Code quality (ruff, pyright, mypy) | ~5 min | Formatted code, type safety |
+ | **_docs.yml** | Documentation build (Sphinx) | ~3 min | HTML docs, validation |
| **_audit.yml** | Security + license compliance | ~3 min | SBOM (CycloneDX, SPDX), vulnerabilities, licenses |

Location 2: Workflow Files Summary table (around line 1088)

| `_lint.yml` | Reusable | Code quality checks | ~5 min |
+ | `_docs.yml` | Reusable | Documentation build | ~3 min |
| `_audit.yml` | Reusable | Security & license | ~3 min |

Why this matters: Medical device QMS requires comprehensive documentation. Keeping .github/CLAUDE.md up-to-date ensures future maintainers and AI assistants understand the complete CI/CD architecture.

Fix link (optional): Update .github/CLAUDE.md documentation →


Architectural Excellence 🌟

This PR exemplifies best practices for CI/CD changes:

  1. Reusable Workflow Pattern: Follows DRY principle, making the system maintainable
  2. Parallel Execution: Doesn't increase CI time (docs runs concurrently with other jobs)
  3. Fail-Fast Detection: Catches documentation build failures at PR time, not release time
  4. Zero Secrets: No credentials required, minimizing attack surface
  5. Consistent Structure: Future engineers can easily add similar jobs by copying the pattern
  6. Medical Device Compliance: Properly integrated into Ketryx gate for ISO 13485 requirements

Test Plan Verification ✅

From PR description:

  • ✅ CI passes on this PR (docs job appears green in the workflow run)
  • ketryx_report_and_check job waits for the docs job before running

Both test plan items confirmed passing.


Recommendation

APPROVE and MERGE

This is a low-risk, high-value change that:

  • ✅ Improves CI/CD robustness
  • ✅ Follows all repository standards
  • ✅ Has zero security concerns
  • ✅ Is already working in CI
  • ✅ Includes no breaking changes

Optional follow-up: Update .github/CLAUDE.md documentation (can be done in a subsequent PR or this one - not blocking).


Verdict: ✅ claude:review:passed

View job run

@claude claude Bot added the claude:review:passed Automated Claude PR review found no blocking issues on the current head commit label Apr 26, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

❌ Your project status has failed because the head coverage (63.79%) is below the target coverage (70.00%). You can increase the head coverage or adjust the target coverage.
see 20 files with indirect coverage changes

Copilot AI review requested due to automatic review settings April 26, 2026 10:16
@helmut-hoffer-von-ankershoffen helmut-hoffer-von-ankershoffen merged commit 3c9fe08 into main Apr 26, 2026
8 checks passed
@helmut-hoffer-von-ankershoffen helmut-hoffer-von-ankershoffen deleted the chore/PYSDK-110-add-docs-ci-job branch April 26, 2026 10:16
@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

Comment on lines +90 to +91
id-token: write
packages: read
Copy link

Copilot AI Apr 26, 2026

Choose a reason for hiding this comment

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

The docs job requests id-token: write and packages: read, but the job only checks out the repo, installs dependencies with uv, and runs make docs. Unless docs dependencies are pulled from GitHub Packages or the job uses OIDC, these extra permissions are unnecessary and broaden the token’s scope; consider reducing to just contents: read (matching least-privilege).

Suggested change
id-token: write
packages: read

Copilot uses AI. Check for mistakes.
Comment on lines +12 to +13
id-token: write
packages: read
Copy link

Copilot AI Apr 26, 2026

Choose a reason for hiding this comment

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

This reusable workflow grants id-token: write and packages: read, but the steps only perform checkout, uv sync, and make docs. If you’re not accessing GitHub Packages or using OIDC in the docs build, drop these permissions and keep only contents: read to follow least-privilege.

Suggested change
id-token: write
packages: read

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

claude:review:passed Automated Claude PR review found no blocking issues on the current head commit github_actions Pull requests that update GitHub Actions scope:dev-only Affects only our dev/CI env; consumers unaffected skip:test:long_running Skip long-running tests (≥5min) sop:cc-sop-01 CC-SOP-01 Change Control (feature / planned change) type:ci CI/CD change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants