Feat/needs json wrappers#664
Open
antonkri wants to merge 2 commits into
Open
Conversation
…ecklists Add to docs.bzl: - filtered_needs_json and the convenience wrappers component_requirements, feature_requirements, assumptions_of_use, feature_architecture, component_architecture (extract a typed/named subset of a needs.json). - requirements_checklist and architecture_checklist (SHA256 inspection-record validation over the transitive sphinx-needs link graph). The filter wrappers support: - strict: fail the build (no output) on any dangling link reference. - extra_needs: additional needs.json inputs that count as resolvable link targets (e.g. upstream repositories). - link_fields: restrict which link fields are checked (default: all, auto-detected via the sphinx-needs '<field>_back' convention). Add supporting py_binary tools scripts_bazel/filter_needs_json.py and scripts_bazel/validate_checklist.py.
Match the filter --name against the title of the feat/comp element a need links to, instead of parsing the need ID: - feat_req/comp_req resolve the owning feature/component via satisfied_by (with a legacy belongs_to fallback). - feat_arc_*/comp_arc_* resolve it via belongs_to. Link targets are looked up in the input needs.json plus any --extra-needs-json inputs. Other element types fall back to the second '__' ID segment.
antonkri
requested review from
AlexanderLanin,
MaximilianSoerenPollak,
dcalavrezo-qorix and
nradakovic
as code owners
July 24, 2026 10:44
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: |
| source_needs = collect_needs(data) | ||
| extra_needs: dict[str, dict[str, Any]] = {} | ||
| for extra in args.extra_needs_json: | ||
| with open(_resolve_needs_json(extra)) 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.needs_json) 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: |
|
The created documentation from the pull request is available at: docu-html |
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.
📌 Description
🚨 Impact Analysis
✅ Checklist