Skip to content

Feat/needs json wrappers#664

Open
antonkri wants to merge 2 commits into
mainfrom
feat/needs-json-wrappers
Open

Feat/needs json wrappers#664
antonkri wants to merge 2 commits into
mainfrom
feat/needs-json-wrappers

Conversation

@antonkri

Copy link
Copy Markdown
Contributor

📌 Description

🚨 Impact Analysis

  • This change does not violate any tool requirements and is covered by existing tool requirements
  • This change does not violate any design decisions
  • Otherwise I have created a ticket for new tool qualification

✅ Checklist

  • Added/updated documentation for new or changed features
  • Added/updated tests to cover the changes
  • Followed project coding standards and guidelines

antonkri added 2 commits July 24, 2026 10:07
…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.
@github-actions

Copy link
Copy Markdown

License Check Results

🚀 The license check job ran with the Bazel command:

bazel run --lockfile_mode=error //src:license-check

Status: ⚠️ Needs Review

Click to expand output
[License Check Output]
Extracting Bazel installation...
Starting local Bazel server (8.6.0) and connecting to it...
INFO: Invocation ID: c8cd5382-4890-4a6d-b15b-946e98b4bb0b
Computing main repo mapping: 
Computing main repo mapping: 
Loading: 
Loading: 0 packages loaded
Loading: 0 packages loaded
DEBUG: /home/runner/.bazel/external/rules_python+/python/private/repo_utils.bzl:101:16: 
rules_python:coverage_dep WARNING: rules_python's bundled coverage tool has no wheel for python_version=3.12.13, platform=ppc64le-unknown-linux-gnu. `bazel coverage` will produce empty lcov for py_test targets in this configuration. Either pin python_version to a version in the bundled set (see python/private/coverage_deps.bzl), or configure coverage manually via py_runtime.coverage_tool. See docs/coverage.md.
DEBUG: /home/runner/.bazel/external/rules_python+/python/private/repo_utils.bzl:101:16: 
rules_python:coverage_dep WARNING: rules_python's bundled coverage tool has no wheel for python_version=3.12.13, platform=riscv64-unknown-linux-gnu. `bazel coverage` will produce empty lcov for py_test targets in this configuration. Either pin python_version to a version in the bundled set (see python/private/coverage_deps.bzl), or configure coverage manually via py_runtime.coverage_tool. See docs/coverage.md.
DEBUG: /home/runner/.bazel/external/rules_python+/python/private/repo_utils.bzl:101:16: 
rules_python:coverage_dep WARNING: rules_python's bundled coverage tool has no wheel for python_version=3.12.13, platform=s390x-unknown-linux-gnu. `bazel coverage` will produce empty lcov for py_test targets in this configuration. Either pin python_version to a version in the bundled set (see python/private/coverage_deps.bzl), or configure coverage manually via py_runtime.coverage_tool. See docs/coverage.md.
DEBUG: /home/runner/.bazel/external/rules_python+/python/private/repo_utils.bzl:101:16: 
rules_python:coverage_dep WARNING: rules_python's bundled coverage tool has no wheel for python_version=3.12.13, platform=x86_64-unknown-linux-musl. `bazel coverage` will produce empty lcov for py_test targets in this configuration. Either pin python_version to a version in the bundled set (see python/private/coverage_deps.bzl), or configure coverage manually via py_runtime.coverage_tool. See docs/coverage.md.
Loading: 0 packages loaded
    currently loading: src
Loading: 0 packages loaded
    currently loading: src
WARNING: Target pattern parsing failed.
ERROR: Skipping '//src:license-check': no such target '//src:license-check': target 'license-check' not declared in package 'src' defined by /home/runner/work/docs-as-code/docs-as-code/src/BUILD
ERROR: no such target '//src:license-check': target 'license-check' not declared in package 'src' defined by /home/runner/work/docs-as-code/docs-as-code/src/BUILD
INFO: Elapsed time: 7.630s
INFO: 0 processes.
ERROR: Build did NOT complete successfully
ERROR: Build failed. Not running target


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:
@github-actions

Copy link
Copy Markdown

The created documentation from the pull request is available at: docu-html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants