WIP: sphinx-needs filtering, Markdown & TRLC export rules (demo playground)#615
Open
antonkri wants to merge 4 commits into
Open
WIP: sphinx-needs filtering, Markdown & TRLC export rules (demo playground)#615antonkri wants to merge 4 commits into
antonkri wants to merge 4 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.
Contributor
Author
|
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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.