ci: add docs build as parallel CI job [PYSDK-110]#600
Conversation
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>
There was a problem hiding this comment.
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 runsmake docsonubuntu-latestusing the sameuv/dev-tools setup pattern as_lint.yml. - Wired a new
docsjob intoci-cd.ymlto run in parallel with the other CI jobs (behind the same skip conditions). - Updated the
ketryx_report_and_checkgate to wait for the newdocsjob.
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. |
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. SummaryThis 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:
Critical Checks ✅ ALL PASS1. Workflow Syntax & Structure ✅
2. Pattern Consistency ✅Compared # 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 history3. CI/CD Integration ✅Parallel Fan-Out: lint ──┐
docs ──┤
audit ─┼──→ ketryx_report_and_check ──→ package_publish (tags only)
test ──┤
codeql─┘
sonar─┘Skip Conditions: Correctly respects 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: - 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 ✅
6. Conventional Commits ✅Commit message follows standard: 7. Functional Verification ✅Confirmed via The workflow is running and passing in CI. 8. No Breaking Changes ✅This is an additive-only change:
Suggestions (Non-Blocking)Documentation Update RecommendedThe 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 Fix link (optional): Update .github/CLAUDE.md documentation → Architectural Excellence 🌟This PR exemplifies best practices for CI/CD changes:
Test Plan Verification ✅From PR description:
Both test plan items confirmed passing. RecommendationAPPROVE and MERGE ✅ This is a low-risk, high-value change that:
Optional follow-up: Update Verdict: ✅ claude:review:passed |
Codecov Report✅ All modified and coverable lines are covered by tests. ❌ 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. |
…PYSDK-110] Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
| id-token: write | ||
| packages: read |
There was a problem hiding this comment.
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).
| id-token: write | |
| packages: read |
| id-token: write | ||
| packages: read |
There was a problem hiding this comment.
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.
| id-token: write | |
| packages: read |



🛡️ Implements PYSDK-110 following CC-SOP-01 Change Control, part of our ISO 13485-certified QMS | Ketryx Project
Summary
.github/workflows/_docs.yml— reusable workflow that runsmake docsonubuntu-latest(no secrets needed), mirroring the pattern of_lint.ymldocsjob intoci-cd.ymlin parallel withlint,audit,test,codeql, andsonarcloud— all fanning out fromget-commit-messagedocsto theneedslist ofketryx_report_and_checkso the gate waits for the docs buildmake docswas only called in the package-publish workflow; broken docs could silently reach main and only surface at release timeTest plan
ketryx_report_and_checkjob waits for the docs job before running🤖 Generated with Claude Code