feat: add CI sanity check for cross-reference validation#48
feat: add CI sanity check for cross-reference validation#48jinsonvarghese merged 4 commits intoOWASP:mainfrom
Conversation
|
Hi @rashim27us, good idea; automated cross-reference validation would catch real bugs. A few things to address before this is ready. Scope is too narrow Follow existing script conventions (not a blocker, but nice to have)
|
|
Thanks @jinsonvarghese for the review. I have implemented the changes suggested by you. kindly review the changes and let me know if we need something else before merging. |
|
Thank you @rashim27us. The updated script addresses the earlier feedback well; it now follows the existing code conventions, scans all lines instead of just "See also" blocks, and ruff passes clean. One thing to address:
A simpler fix:
|
|
Thanks @jinsonvarghese for your suggestions, I have resolved hardcoded IDs in the latest commit. Kindly review the changes, and let me know if something else needed. |
|
@rashim27us Thank you. The script addresses all the earlier feedback. Placeholder IDs are removed from _ci_utils.py, and validation scope is now limited to standard/ files, which naturally avoids the false positives in CONTRIBUTING.md, README.md, and index.md. Ran it locally against the current main and it passes clean. One small note for a future pass: the script validates references inside fenced code blocks (YAML/JSON examples in the appendix templates). All 17 of those are valid IDs today so it causes no issues, but if someone adds a hypothetical example with a made-up ID in a code block, it would flag. _ci_utils.py already has strip_fenced_code() that could handle this, but that is a nice-to-have, not a blocker. Good to merge. |
Summary
This PR adds automated CI validation for > See also: cross-references across the APTS documentation.
Problem
The APTS documentation uses APTS-XX-NNN IDs inside > See also: blocks to link related requirements across domains.
However, there was no automated check to verify that these referenced IDs actually exist. That means broken, stale, or mistyped requirement references could silently remain in the documentation.
Solution
This PR introduces a standalone validation script and wires it into CI so invalid cross-references are caught automatically during pull requests and main branch pushes.
Changes
Impact