WIP: sphinx-needs filtering, Markdown & TRLC export rules (demo playground)#615
Open
antonkri wants to merge 3 commits into
Open
WIP: sphinx-needs filtering, Markdown & TRLC export rules (demo playground)#615antonkri wants to merge 3 commits into
antonkri wants to merge 3 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 = parser.parse_args() | ||
|
|
||
| with open(args.input) as f: |
| ) | ||
|
|
||
| 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: |
| ) | ||
| logger.info( | ||
| "Documented '%s' -> '%s' (%d needs)", | ||
| args.input, |
| logger.info( | ||
| "Documented '%s' -> '%s' (%d needs)", | ||
| args.input, | ||
| args.output, |
| converted = len(_collect_requirement_needs(data)) | ||
| logger.info( | ||
| "Converted '%s' -> '%s' (%d requirements, package '%s')", | ||
| args.input, |
| logger.info( | ||
| "Converted '%s' -> '%s' (%d requirements, package '%s')", | ||
| args.input, | ||
| args.output, |
| args.input, | ||
| args.output, | ||
| converted, | ||
| package, |
|
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: |
| ) | ||
| return 1 | ||
|
|
||
| logger.info("Checklist '%s' is up to date (sha256=%s).", args.checklist_id, actual) |
| "last reviewed. Re-review the checklist and update its 'sha256' " | ||
| "attribute to '%s'.", | ||
| args.checklist_id, | ||
| expected, |
| "The validated target output has changed since the checklist was " | ||
| "last reviewed. Re-review the checklist and update its 'sha256' " | ||
| "attribute to '%s'.", | ||
| args.checklist_id, |
| "checklist's 'sha256' attribute to:\n" | ||
| "\n" | ||
| " %s\n", | ||
| args.checklist_id, |
| logger.error( | ||
| "Checklist need '%s' not found in '%s'.", | ||
| args.checklist_id, | ||
| args.needs_json, |
| if need is None: | ||
| logger.error( | ||
| "Checklist need '%s' not found in '%s'.", | ||
| args.checklist_id, |
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
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.