WIP: sphinx-needs filtering, Markdown & TRLC export rules (demo playground) - #615
WIP: sphinx-needs filtering, Markdown & TRLC export rules (demo playground)#615antonkri wants to merge 16 commits into
Conversation
…round) Add Bazel macros and Python tools to post-process needs.json: - filter_needs_json / component_requirements / feature_requirements / assumptions_of_use: extract a subset of sphinx-needs elements - sphinx_needs_to_md: render needs as a Markdown document - sphinx_needs_to_trlc: convert S-CORE requirements to TRLC WIP / demonstration only.
License Check Results🚀 The license check job ran with the Bazel command: bazel run --lockfile_mode=error //src:license-checkStatus: Click to expand output |
| ) | ||
|
|
||
| args.output.parent.mkdir(parents=True, exist_ok=True) | ||
| with open(args.output, "w") as f: |
|
|
||
| args = parser.parse_args() | ||
|
|
||
| with open(args.input) as f: |
| document = render_document(data, title=args.title) | ||
|
|
||
| args.output.parent.mkdir(parents=True, exist_ok=True) | ||
| with open(args.output, "w") as f: |
| if not package or not (package[0].isalpha() or package[0] == "_"): | ||
| package = "Needs" | ||
|
|
||
| with open(args.input) as f: |
|
The created documentation from the pull request is available at: docu-html |
Adds a 'req_chklst' sphinx-needs type that pins the reviewed state of build outputs via a SHA256 hash, plus a 'requirements_checklist' Bazel rule and 'validate_checklist.py' tool that recompute the hash over the validated target outputs and fail the build when it drifts.
|
Added a separate commit: Requirement Checklist need type + validation rule (still WIP / demo only). What this adds
Workflow
A demonstration of the consuming side (need element + |
|
|
||
| args = parser.parse_args() | ||
|
|
||
| with open(args.needs_json) as f: |
e7c195e to
b02108f
Compare
- Add feature_architecture / component_architecture macros (no static/dynamic split) - Add architecture_checklist macro and arch_chklst need type - Report computed SHA256 on empty sha256 attribute in validate_checklist - Make req_chklst/arch_chklst sha256 optional so empty values build - Document new macros and need type
b02108f to
7c10704
Compare
…ture checklists requirements_checklist and architecture_checklist now follow the sphinx-needs link graph recursively from the elements in deps and hash the whole closure, so a checklist goes out of date when an upstream dependency (e.g. a linked stakeholder requirement) changes, not only when a root element changes. - validate_checklist.py: add transitive mode via repeatable --link-field; follow links recursively, normalize version-constrained link targets (id[version==1] -> id), hash canonical serialization of the closure. - docs.bzl: add link_fields arg to both macros (defaults cover the requirement / architecture link chains); pass --link-field through. link_fields = [] restores the previous flat hashing. - metamodel.yaml + README_needs_rules.md: document the recursive behavior.
32e06cd to
adf58f4
Compare
|
|
||
| args = parser.parse_args() | ||
|
|
||
| with open(args.input) as f: |
| # whole closure (roots + all reachable dependencies). | ||
| root_needs: dict[str, dict[str, Any]] = {} | ||
| for path in args.inputs: | ||
| with open(path) as f: |
| # are invisible to the checklist. | ||
| all_needs: dict[str, dict[str, Any]] = {} | ||
| for extra_path in args.extra_needs_json: | ||
| with open(extra_path) as f: |
…p_saf_fmea extraction
3f7e549 to
c28a0b8
Compare
…s rule - score_module: replace comp_reqs with feat_arch sub-target - score_component: add comp_reqs and comp_arch sub-targets - Add trlc_to_sphinx_needs py_binary and script
|
|
||
| args = parser.parse_args() | ||
|
|
||
| with open(args.input) as f: |
| document = render_document(data, title=args.title) | ||
|
|
||
| args.output.parent.mkdir(parents=True, exist_ok=True) | ||
| with open(args.output, "w") as f: |
|
|
||
| texts: list[str] = [] | ||
| for path in args.inputs: | ||
| with open(path) as f: |
| data = convert(texts, project=args.project) | ||
|
|
||
| args.output.parent.mkdir(parents=True, exist_ok=True) | ||
| with open(args.output, "w") as f: |
|
Thanks for the pull request. This thread has been quiet for 30 days, so we are marking it as stale for now. Please take a quick look and let us know whether it is still up to date, still relevant, needs review, or is ready to merge. Any new activity will remove the stale label automatically. If nothing changes in the next 10 days, we will close it to keep the backlog current. |
What
Adds experimental Bazel rules and helper scripts around sphinx-needs to:
needs.jsonoutputWhy
To demonstrate how requirements/needs data can be transformed into other formats (Markdown, TRLC) as part of the docs-as-code pipeline, for discussion and evaluation.
How to use
See the newly added
READMEfor details on the rules and scripts and example invocations.Status
This is work in progress for demo only — APIs, naming, and structure are subject to change.