build(ci): scope docs validators to changed files and harden file-list handling - #2504
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The updated CLI flag handling will break existing CI (validate:frontmatter:changed -- --base/--head), and the docs workflow can still include vendor-managed paths in colour-contrast validation due to incomplete vendor filtering.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR updates the documentation validation pipeline to run Mermaid and frontmatter checks against changed files only, aiming to prevent PR failures caused by unrelated repository-wide documentation debt.
Changes:
- Scoped Mermaid syntax/accessibility validators to
--changed-files/--changed-files-listinputs (with vendor-path exclusions). - Hardened docs-validation workflow changed-file propagation by switching heredoc interpolation to
env+printf. - Added frontmatter validator support for explicit target files, plus unit tests for target resolution and unknown-flag handling.
File summaries
| File | Description |
|---|---|
.github/workflows/docs-validation.yml |
Writes changed Markdown file lists to $RUNNER_TEMP and passes them into Mermaid validators. |
scripts/validation/validate-mermaid-syntax.js |
Adds changed-file scoping and filters target files to Markdown while excluding vendor-managed paths. |
scripts/validation/validate-mermaid-accessibility.js |
Adds changed-file scoping and filters target files to Markdown while excluding vendor-managed paths. |
scripts/validation/validate-frontmatter.js |
Introduces CLI target-file support and rejects unknown flags (but currently breaks an existing workflow invocation). |
scripts/validation/__tests__/validate-frontmatter-target-files.test.js |
Adds unit coverage for CLI target-file resolution behaviour (dedupe / missing-file guards / cleanup). |
Review details
- Files reviewed: 5/5 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.
🔍 Reviewer Summary for PR #2504CI Status: ❌ Recommendations
|
1 similar comment
🔍 Reviewer Summary for PR #2504CI Status: ❌ Recommendations
|
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Ash Shaw <ashley@lightspeedwp.agency>
|
🚫 This PR description is missing required template content. Missing required section(s): Global DoD checklist Please update the PR body using one of the repository PR templates:
Empty placeholders, unchecked checklist boxes, and stub issue references do not count. |
Co-authored-by: ashleyshaw <1805352+ashleyshaw@users.noreply.github.com>
Head branch was pushed to by a user without write access
🔍 Reviewer Summary for PR #2504CI Status: ❌ Recommendations
|
|
This PR's branch name Standard pattern: Based on linked issue type: Correct template should be: No action required — this is informational. Future PRs should use the correct branch name. See Branching Strategy for more info. |
|
Thanks for the check! The |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Ash Shaw <ashley@lightspeedwp.agency>
Co-authored-by: ashleyshaw <1805352+ashleyshaw@users.noreply.github.com>
Added missing scripts to package.json: - validate:branch-name - validate:issue-fields - validate:retired-doc-links - validate:workflow-npm-scripts These scripts were being called in CI workflows but were missing from the scripts configuration, causing validation job failures. Fixes validation errors in .github/workflows/checks.yml Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
- Update package-lock.json to resolve babel peer dependency conflicts - Fix metrics-collection-orchestrator module execution guard to prevent test import failures - Remove redundant __filename/__dirname declarations from CommonJS agent files - Add fetch to ESLint globals configuration for Node.js 18+ compatibility - Fix unused variable parameter naming in milestone distribution script - Add global fetch directive for distribute-unallocated-milestones.js
3d97a12 to
64d2c40
Compare
❌ Branch Name Validation FailedThe branch name Required Format
Allowed Branch Types
Valid Examples
Invalid Examples
SolutionRename your branch to follow the pattern and update the PR. For more information, see docs/BRANCHING_STRATEGY.md. |
…ttps://github.com/lightspeedwp/.github into ci/fix-mermaid-accessibility-readme-validation
🔍 Reviewer Summary for PR #2504CI Status: ❌ Recommendations
|
|
✅ PR checklists finalised after merge. |
This PR fixes multiple validation failures in PR #2114 that addresses Mermaid diagram accessibility and README frontmatter validation issues. The changes update Documentation Validation so PR outcomes reflect changed files only, instead of failing on unrelated repository-wide Mermaid/README/frontmatter debt. It also hardens changed-file propagation and validator CLI parsing to remove fragile paths in CI execution.
Linked issues
Closes #2226 — PR #2114: Fix Mermaid Accessibility & README Validation Failures
Build/CI change
Added missing npm scripts
validate:branch-name— validates branch naming conventionsvalidate:issue-fields— validates GitHub issue field compliancevalidate:retired-doc-links— validates that retired doc links are not referencedvalidate:workflow-npm-scripts— validates that all workflow steps use valid npm scriptsValidation scope correction
docs-validation.ymlnow passes the changed Markdown file list into Mermaid syntax/accessibility checks.Workflow input hardening
printfwhen writing changed-file lists in workflow steps.Validator robustness
--changed-files/--changed-files-list.Focused test coverage
Baseline & Target
Changelog
Added
Changed
Fixed
Removed
Checklist (Global DoD / PR)
Fixes #2226