Skip to content

da_build: check DOCX templates for accessibility, as warnings by default - #94

Merged
nonprofittechy merged 5 commits into
mainfrom
da-build-check-template-documents
Sep 1, 2026
Merged

da_build: check DOCX templates for accessibility, as warnings by default#94
nonprofittechy merged 5 commits into
mainfrom
da-build-check-template-documents

Conversation

@nonprofittechy

Copy link
Copy Markdown
Member

Depends on SuffolkLITLab/DAYamlChecker#82 (needs dayamlchecker 1.5.0 published).

The YAML checker step only ever fed *.yml under questions/ to dayamlchecker, so its DOCX accessibility checks never saw a file. This expands the same find to pick up *.docx under data/templates.

Still matching specific files rather than passing a directory: not every YAML file is a docassemble interview (workflows, ALKiln fixtures), and only documents under the package's own data/templates are the ones users receive, so widening to whole directories would add a new class of false positives.

New input

docx-validation-mode: off | warning | error   # default: warning

Defaults to warning, which annotates the job without failing it — most templates have findings today and authors need room to work through them.

Also fixes a pre-existing duplication bug

uv build copies the whole package into build/lib before the checker runs, so -path "*/questions/*" matched every question file twice. A real CI run showed the consequence: all 20 error and warning annotations pointed at build/lib copies, so none attached to a file in the PR diff and the real source files lost the race for GitHub's 10-annotations-per-level cap. Pruning build/, dist/ and .venv took that run from 188 findings to 108.

Verified in real CI

LemmaLegalConsulting/docassemble-MOHUDEvictionProject#669 — 14 templates, 35 findings (19 warnings, 16 notices, 0 errors), annotations attached to the right paths, and the build's failure came entirely from pre-existing YAML issues.

nonprofittechy and others added 3 commits August 31, 2026 13:01
The YAML checker step only ever fed *.yml under questions/ to dayamlchecker,
so its DOCX accessibility checks never saw a file. Expand the same find to
pick up *.docx under data/templates.

Deliberately still matching specific files rather than passing a directory:
not every YAML file in these repos is a docassemble interview (workflows,
ALKiln fixtures), and only documents under data/templates are the ones users
actually receive, so widening to whole directories would add a new class of
false positives.

Findings are reported at warning severity by default, which annotates the
job without failing it -- most templates have findings today and authors
need room to work through them. Repos opt into failing with
docx-validation-mode: error, mirroring verapdf-validation-mode.
skip-docx-check turns the checks off entirely.

Requires dayamlchecker 1.5.0 for --docx-accessibility-severity.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E4YaH5h8wS9Kb5uveGQhyd
One input instead of two, with 'off' as a third mode alongside 'warning' and
'error'. Also anchors the docx glob at ./docassemble/*/data/templates so a
local .venv full of other packages' templates is never picked up, and passes
--format github so findings annotate the PR instead of only reaching the log.
The `uv build` step copies the whole package into build/lib before the
checker runs, so `-path "*/questions/*"` matched every question file twice.
A real CI run showed the consequence: all 20 error and warning annotations
pointed at build/lib copies, so none of them attached to a file in the PR
diff, and the source-file duplicates lost the race for the slots.

Prune build/, dist/ and .venv, and anchor both patterns at ./docassemble/*.

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 find ... | xargs ... python -m dayamlchecker pipeline can invoke dayamlchecker with zero input files, which will fail the action in repos/branches without matching YAML/DOCX files.

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

Pull request overview

This PR updates the da_build composite GitHub Action to run DAYamlChecker against both interview YAML files and DOCX templates, enabling DOCX accessibility findings to be surfaced as GitHub annotations (warnings by default) while also avoiding duplicate findings from build artifacts.

Changes:

  • Adds a new docx-validation-mode input (default warning) and wires it to DAYamlChecker DOCX accessibility flags.
  • Expands the file discovery to include *.docx under docassemble/*/data/templates/*, and sets output formatting to GitHub annotations.
  • Prunes build/, dist/, and .venv from the checker’s find to prevent duplicate reporting from uv build copies.
File summaries
File Description
da_build/action.yml Adds configurable DOCX accessibility checking and improves file selection to avoid duplicate annotations from build artifacts.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • 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/action.yml Outdated

@BryceStevenWilley BryceStevenWilley left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, comments on some cruft that doesn't really do anything but good either way.

Comment thread da_build/action.yml Outdated
Comment thread da_build/action.yml Outdated
@nonprofittechy
nonprofittechy merged commit ca56303 into main Sep 1, 2026
1 check passed
@nonprofittechy
nonprofittechy deleted the da-build-check-template-documents branch September 1, 2026 15:21
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.

3 participants