Skip to content

da_build: check PDF templates for PDF/UA-1 accessibility - #95

Open
nonprofittechy wants to merge 6 commits into
mainfrom
da-build-check-pdf-templates
Open

da_build: check PDF templates for PDF/UA-1 accessibility#95
nonprofittechy wants to merge 6 commits into
mainfrom
da-build-check-pdf-templates

Conversation

@nonprofittechy

Copy link
Copy Markdown
Member

Runs veraPDF over the PDF templates users receive and reports failures as GitHub annotations plus a job summary, with per-rule severity classification so metadata-only findings do not read like real blockers.

Input, matching the DOCX one exactly

pdf-validation-mode: off | warning | error   # default: warning
pdf-strict:          true | false            # default: false

pdf-strict keeps tab-order and form-annotation rules off by default, since AL forms are usually flattened before users see them.

Naming the format rather than the tool (pdf- not verapdf-) keeps the input stable if veraPDF is ever swapped out, and makes it read the same as docx-validation-mode in #94.

Scoped to templates

Only docassemble/*/data/templates is scanned. An earlier rglob over the whole repository swept in PDFs that are not output documents — reference material in data/static, ALKiln fixtures in data/sources, and other packages' templates from a local .venv — and reported them as this repo's failures. Over the local AL checkouts that narrows the scanned set from 272 PDFs to 96.

Note on history

This supersedes add-pac-to-build, which was 24 commits behind and predated the uv migration — merging it would have reverted uv and the env-var input handling that fixed the command-injection issue. Rebuilt on current main.

Runs veraPDF over the PDF templates users receive and reports failures as
GitHub annotations plus a job summary, with per-rule severity classification
so metadata-only findings do not read like real blockers.

pdf-validation-mode: off|warning|error mirrors docx-validation-mode exactly.
It defaults to warning, so adopting the check annotates a build rather than
breaking it. pdf-strict keeps tab-order and form-annotation rules off by
default, since AL forms are usually flattened before users see them.

Only docassemble/*/data/templates is scanned. An earlier rglob over the whole
repository swept in PDFs that are not output documents -- reference material
in data/static, ALKiln fixtures in data/sources, and other packages'
templates from a local .venv -- and reported them as this repo's failures.
Over the local AL checkouts that narrows the scanned set from 272 to 96.

Rebased onto main so it keeps the uv migration and the env-var input
handling rather than reverting to the old pip-based steps.

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.

🟡 Changes recommended

The new checker has a reliability bug (unhandled veraPDF timeout) and a user-facing configuration mismatch in the job summary text.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds a new PDF accessibility validation step to the da_build composite action by running veraPDF (PDF/UA-1) against Assembly Line PDF templates and reporting results via GitHub annotations and the job summary, with severity bucketing and an optional strict mode for form/tab-order rules.

Changes:

  • Introduces check_pdf_accessibility.py to locate template PDFs, run veraPDF, parse XML output, classify rule severities, and emit annotations + a Markdown job summary.
  • Extends da_build/action.yml with pdf-validation-mode and pdf-strict inputs, installs veraPDF when enabled, and runs the new checker.
File summaries
File Description
da_build/check_pdf_accessibility.py Implements PDF discovery, veraPDF execution, XML parsing, severity classification, annotations, and job summary rendering.
da_build/action.yml Adds inputs and workflow steps to install veraPDF and run the PDF accessibility checker (with opt-out).
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread da_build/check_pdf_accessibility.py
Comment thread da_build/check_pdf_accessibility.py
@nonprofittechy

Copy link
Copy Markdown
Member Author

Working on resolving conflicts; will mark ready soon

@nonprofittechy
nonprofittechy marked this pull request as ready for review September 1, 2026 15:49
@nonprofittechy
nonprofittechy requested a lite review from Copilot September 1, 2026 15: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.

🟡 Changes recommended

There are correctness and security gaps in the veraPDF integration (version enforcement/exit-code handling and unverified installer download) that should be addressed before relying on this in CI.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 3
  • Review effort level: Lite

Comment thread da_build/action.yml Outdated
Comment thread da_build/action.yml
Comment thread da_build/check_pdf_accessibility.py
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