diff --git a/.github/workflows/_test.yml b/.github/workflows/_test.yml index e403ac7f9..8055f1699 100644 --- a/.github/workflows/_test.yml +++ b/.github/workflows/_test.yml @@ -47,8 +47,11 @@ jobs: - name: Prepare test report directory run: mkdir -p tests-report - - name: Run public docs.bzl integration tests - run: .venv_docs/bin/python -m pytest -vv src/tests/docs_bzl --junitxml=tests-report/docs_bzl.xml + - name: Run cacheable public docs.bzl tests + run: .venv_docs/bin/python -m pytest -vv -m bazel_cached src/tests/docs_bzl --junitxml=tests-report/docs_bzl_cached.xml + + - name: Run slow public docs.bzl tests + run: .venv_docs/bin/python -m pytest -vv -m bazel_slow src/tests/docs_bzl --junitxml=tests-report/docs_bzl_slow.xml - name: Run bazel test targets run: bazel test --lockfile_mode=error //... --build_tests_only diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c84d3fb2f..36b4dff7b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -18,8 +18,12 @@ repos: - id: check-toml - id: check-json exclude: ^\.vscode/ # those are actually jsonc files + # Golden HTML is compared byte-for-byte, so preserve the exact generated + # whitespace and EOF instead of normalizing these fixture files. - id: end-of-file-fixer + exclude: ^src/tests/docs_bzl/scenarios/.*/_expected/.*\.html$ - id: trailing-whitespace + exclude: ^src/tests/docs_bzl/scenarios/.*/_expected/.*\.html$ - id: check-merge-conflict - id: check-case-conflict - id: mixed-line-ending diff --git a/pyproject.toml b/pyproject.toml index 456a79c72..c0285ad49 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -92,6 +92,8 @@ log_file_format = "[%(asctime)s.%(msecs)03d] [%(levelname)-3s] [%(name)s] %(mess log_file_date_format = "%Y-%m-%d %H:%M:%S" markers = [ + "bazel_cached: successful build-only test expected to reuse Bazel actions", + "bazel_slow: runtime execution or an uncached expected Bazel failure", "metadata", "test_properties(dict): Add custom properties to test XML output", ] diff --git a/src/extensions/score_layout/__init__.py b/src/extensions/score_layout/__init__.py index eeb1eb8f6..b51f0c02a 100644 --- a/src/extensions/score_layout/__init__.py +++ b/src/extensions/score_layout/__init__.py @@ -11,8 +11,10 @@ # SPDX-License-Identifier: Apache-2.0 # ******************************************************************************* import logging +import os from pathlib import Path -from typing import Any +from typing import Any, cast +from urllib.parse import quote import html_options import sphinx_options @@ -22,11 +24,33 @@ logger = logging.getLogger(__name__) +# TEMP UNTIL UPSTREAM FIX - BEGIN +# Bug ref: https://github.com/useblocks/sphinx-needs/issues/1913 +# Sphinx-Needs discovers these files with ``Path.glob``. The filesystem +# does not define the order returned by that operation, while Sphinx preserves +# registration order for stylesheets with the same priority. Keep the CSS +# cascade stable across Bazel runfiles, local virtual environments, and CI. +_NEEDS_COMMON_CSS_ORDER = ( + "sphinx-needs/common_css/needstable.css", + "sphinx-needs/common_css/need_core.css", + "sphinx-needs/common_css/need_style.css", + "sphinx-needs/common_css/need_toggle.css", + "sphinx-needs/common_css/need_links.css", +) +_NEEDS_COMMON_CSS_POSITION = { + filename: position for position, filename in enumerate(_NEEDS_COMMON_CSS_ORDER) +} +# TEMP UNTIL UPSTREAM FIX - END + def setup(app: Sphinx) -> dict[str, str | bool]: logger.debug("score_layout setup called") app.connect("config-inited", update_config) + # Run after the PyData theme creates its edit-URL callback so mounted pages + # can replace the callback with a workspace-aware one. + app.connect("html-page-context", configure_mounted_source_controls, priority=800) + app.connect("html-page-context", normalize_needs_css_order) return { "version": "0.1", "parallel_read_safe": True, @@ -68,3 +92,120 @@ def update_config(app: Sphinx, _config: Any): app.add_css_file("css/score.css", priority=500) app.add_css_file("css/score_needs.css", priority=500) app.add_css_file("css/score_design.css", priority=500) + + +# TEMP UNTIL UPSTREAM FIX - BEGIN +# Bug ref: https://github.com/useblocks/sphinx-mounts/issues/47 +def configure_mounted_source_controls( + app: Sphinx, + pagename: str, + _templatename: str, + context: dict[str, Any], + _doctree: Any, +) -> None: + """Configure safe source/edit controls for mounted documents. + + ``sphinx-mounts`` stores the absolute filesystem path of a mounted source + in Sphinx. Sphinx currently derives ``page_source_suffix`` from that path, + which makes themes such as PyData build malformed source and edit URLs. + A real source file inside the current workspace can still be mapped to a + safe repository-relative URL. Generated and external sources have no such + guaranteed URL, so their controls remain hidden until the mount extension + exposes a logical source path and repository mapping. + """ + source_path = Path(app.env.doc2path(pagename, base=False)) + if not source_path.is_absolute(): + return + + source_path = source_path.resolve() + workspace_directory = os.environ.get("BUILD_WORKSPACE_DIRECTORY") + if workspace_directory: + workspace_root = Path(workspace_directory).resolve() + if ( + source_path.is_relative_to(workspace_root) + and not {"bazel-bin", "bazel-out"}.intersection(source_path.parts) + and _configure_workspace_edit_url(context, source_path, workspace_root) + ): + return + + context["page_source_suffix"] = "" + context["sourcename"] = "" + context["secondary_sidebar_items"] = [] + + +def _configure_workspace_edit_url( + context: dict[str, Any], source_path: Path, workspace_root: Path +) -> bool: + """Install a GitHub edit callback for a source file in the workspace.""" + if context.get("edit_page_url_template") is not None: + return False + + github_values = tuple( + context.get(name) for name in ("github_user", "github_repo", "github_version") + ) + if not all( + isinstance(value, str) and value not in {"", "dummy", "None"} + for value in github_values + ): + return False + + github_user, github_repo, github_version = cast(tuple[str, str, str], github_values) + relative_path = quote(source_path.relative_to(workspace_root).as_posix(), safe="/") + github_url = str(context.get("github_url", "https://github.com")).rstrip("/") + edit_url = ( + f"{github_url}/{quote(github_user, safe='')}/{quote(github_repo, safe='')}" + f"/edit/{quote(github_version, safe='')}/{relative_path}" + ) + + def get_edit_provider_and_url() -> tuple[str, str]: + """Return the edit URL for the mounted workspace source.""" + return "GitHub", edit_url + + context["get_edit_provider_and_url"] = get_edit_provider_and_url + return True + + +# TEMP UNTIL UPSTREAM FIX - END + + +# TEMP UNTIL UPSTREAM FIX - BEGIN +# Bug ref: https://github.com/useblocks/sphinx-needs/issues/1913 +def normalize_needs_css_order( + _app: Sphinx, + _pagename: str, + _templatename: str, + context: dict[str, Any], + _doctree: Any, +) -> None: + """Make Sphinx-Needs common stylesheets deterministic before rendering.""" + css_files = context.get("css_files") + if not isinstance(css_files, list): + return + css_files = cast(list[Any], css_files) + + common_css = [ + (index, css_file) + for index, css_file in enumerate(css_files) + if _css_filename(css_file) in _NEEDS_COMMON_CSS_POSITION + ] + if len(common_css) < 2: + return + + positions = [index for index, _ in common_css] + ordered_common_css = sorted( + (css_file for _, css_file in common_css), + key=lambda css_file: _NEEDS_COMMON_CSS_POSITION[_css_filename(css_file)], + ) + normalized_css_files = list(css_files) + for index, css_file in zip(positions, ordered_common_css, strict=True): + normalized_css_files[index] = css_file + context["css_files"] = normalized_css_files + + +def _css_filename(css_file: Any) -> str: + """Return a stylesheet's path in the form used by Sphinx-Needs.""" + filename = str(os.fspath(getattr(css_file, "filename", css_file))) + return Path(filename).as_posix().removeprefix("_static/") + + +# TEMP UNTIL UPSTREAM FIX - END diff --git a/src/tests/docs_bzl/README.md b/src/tests/docs_bzl/README.md index 78a846b18..8457ce5c0 100644 --- a/src/tests/docs_bzl/README.md +++ b/src/tests/docs_bzl/README.md @@ -6,45 +6,42 @@ ******************************************************************************* --> -# Public `docs.bzl` integration tests - -These tests run **outside** Bazel with pytest and drive the public `docs.bzl` -macros through real `bazel run` / `bazel build` commands. They cover exactly -what a consumer invokes: `docs()`, `docs_bundle()`, mounts, cross-module -compatibility reporting, and failure cases. - -```text -docs_bzl/ -├── scenarios/ # one fixture per consumer scenario -│ ├── basic_docs/ -│ ├── reference_integration/ -│ ├── metamodel_violation/ -│ ├── nested_bundles/ -│ ├── subdirectory_bundle/ -│ ├── external_bundle/ -│ ├── local_version_mismatch/ -│ └── invalid_bundle_placements/ -└── test_.py +# Public `docs.bzl` scenario tests + +These pytest tests exercise the public `docs()` and `docs_bundle()` macros +through real Bazel builds and runs. Fixtures live below `scenarios/`; the test +modules are `test_docs_bzl_scenarios.py` and +`test_expected_output_consistency.py`. + +## Run + +```sh +.venv_docs/bin/python -m pytest -vv src/tests/docs_bzl ``` -Each scenario has a fixture folder and a matching pytest file. The names describe -consumer behavior, not the Bazel mechanism used to execute it. Positive rendering -uses `bazel run`; sandbox-only behavior uses `bazel build`; invalid package -definitions are expected build failures. Assertions retain rendered HTML, -manifest order and metadata, source links, toctree attachment, and diagnostics. -The cross-module compatibility test creates its consumer in a temporary -workspace, so this repository's production ``MODULE.bazel`` stays free of test -dependencies while the test still traverses real Bzlmod module boundaries. +The suite runs Bazel and should be run sequentially. CI splits it into: + +```sh +.venv_docs/bin/python -m pytest -vv -m bazel_cached src/tests/docs_bzl +.venv_docs/bin/python -m pytest -vv -m bazel_slow src/tests/docs_bzl +``` + +Build-only expected outputs are marked `bazel_cached`; outputs that execute +Sphinx through `bazel run`, as well as expected-failure tests, are marked +`bazel_slow`. + +## Expected outputs -Note that these tests run `bazel` commands, so they are slow. They need to be executed -sequentially. Use sparingly. They do not call `bazel clean`, so the persistent -Bazel server and its action, repository, and disk caches are reused between -cases. There is still a small analysis/startup cost per command; keep scenarios -coarse-grained and use `bazel run` only where runtime behavior matters. +Positive scenarios may check in files below a fixture's `_expected/` directory: -Run via: +- `_expected//...` checks selected files below a directory output. +- `_expected/.` checks one file output. - .venv_docs/bin/python -m pytest -vv src/tests/docs_bzl +Only files already present below `_expected/` are part of the contract. JSON is +compared as sorted, formatted data; other files, including HTML, are compared +byte-for-byte. -The suite is deliberately separate from `bazel test //...`, since pytest is its -driver. CI stores its JUnit XML together with the Bazel test reports. +Each expected output is its own pytest case. When generated content changes, +the case updates the checked-in file, prints the unified diff through pytest, +and fails with exit code 1. Review the change and run pytest again; an +unchanged output passes. Files are never added or removed automatically. diff --git a/src/tests/docs_bzl/expected_outputs.py b/src/tests/docs_bzl/expected_outputs.py new file mode 100644 index 000000000..6f7092520 --- /dev/null +++ b/src/tests/docs_bzl/expected_outputs.py @@ -0,0 +1,358 @@ +# ******************************************************************************* +# Copyright (c) 2026 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 +# +# SPDX-License-Identifier: Apache-2.0 +# ******************************************************************************* +"""Golden-output verification for public ``docs.bzl`` scenarios. + +Expected output names are discovered below the scenario's ``_expected`` +directory. The target catalog below is the only place that maps a short +expected-output name to the Bazel target and to the output location used by the +harness. +""" + +from __future__ import annotations + +import contextlib +import difflib +import json +import os +import stat +import tempfile +from dataclasses import dataclass +from pathlib import Path + +from src.tests.docs_bzl.helpers import ( + TEST_ROOT, + TEST_ROOT_BAZEL, + built_output, + run_bazel, + run_package, +) + +# GitHub Actions exposes this variable to the documentation build. Supplying +# the same repository identity locally makes generated GitHub links and the +# Sphinx theme configuration match the HTML produced in CI. +EXPECTED_GITHUB_REPOSITORY = "eclipse-score/docs-as-code" +EXPECTED_GITHUB_ENV = {"GITHUB_REPOSITORY": EXPECTED_GITHUB_REPOSITORY} +EXPECTED_GITHUB_ACTION_ENV = ( + f"--action_env=GITHUB_REPOSITORY={EXPECTED_GITHUB_REPOSITORY}" +) + + +@dataclass(frozen=True) +class ExpectedTarget: + """Describe one target that can have a checked-in expected output.""" + + label: str + command: str + output_kind: str + output_path: str + + +# Keep this mapping centralized. Scenario directories only use the short names +# in ``_expected/`` and do not repeat Bazel labels or output path knowledge in +# their Python tests. +TARGETS: dict[str, ExpectedTarget] = { + "docs": ExpectedTarget( + label=":docs", + command="run", + output_kind="directory", + output_path="_build", + ), + "needs_json": ExpectedTarget( + label=":needs_json", + command="build", + output_kind="directory", + output_path="needs_json/_build/needs", + ), + "needs_local": ExpectedTarget( + label=":docs_bundle.__internal__.needs_local", + command="build", + output_kind="file", + output_path="docs_bundle.__internal__.needs_local/_build/needs/needs.json", + ), + "data_bundle_needs": ExpectedTarget( + label=":data_bundle.__internal__.needs_local", + command="build", + output_kind="directory", + output_path="data_bundle.__internal__.needs_local/_build/needs", + ), + "isolated_source_bundle_needs": ExpectedTarget( + label=":isolated_source_bundle.__internal__.needs_local", + command="build", + output_kind="directory", + output_path="isolated_source_bundle.__internal__.needs_local/_build/needs", + ), + "sourcelinks_json": ExpectedTarget( + label=":sourcelinks_json", + command="build", + output_kind="file", + output_path="sourcelinks_json.json", + ), + "metrics_json": ExpectedTarget( + label=":metrics_json", + command="build", + output_kind="file", + output_path="metrics.json", + ), + "generated_config": ExpectedTarget( + label=":_docs_generated_config", + command="build", + output_kind="file", + output_path="docs/conf.py", + ), + "mounts_manifest": ExpectedTarget( + label=":_mounts_manifest", + command="build", + output_kind="file", + output_path="_mounts_manifest.json", + ), + "ordered_aggregate_manifest": ExpectedTarget( + label=":ordered_aggregate_manifest", + command="build", + output_kind="file", + output_path="ordered_aggregate_manifest.json", + ), +} + + +@dataclass(frozen=True) +class ExpectedOutput: + """Connect one discovered expected path to its central target definition.""" + + short_name: str + target: ExpectedTarget + expected_path: Path + + +def _scenario_dir(scenario: str) -> Path: + path = TEST_ROOT / "scenarios" / scenario + if not path.is_dir(): + raise ValueError(f"docs.bzl scenario does not exist: {scenario}") + return path + + +def discover_expected_scenarios() -> list[str]: + """Find scenario packages that opt into golden-output verification.""" + scenarios_root = TEST_ROOT / "scenarios" + return sorted( + str(expected_root.parent.relative_to(scenarios_root)) + for expected_root in scenarios_root.rglob("_expected") + if expected_root.is_dir() + ) + + +def discover_expected_outputs(scenario: str) -> list[ExpectedOutput]: + """Discover expected target files and directories in one scenario.""" + scenario_dir = _scenario_dir(scenario) + expected_root = scenario_dir / "_expected" + if not expected_root.is_dir(): + raise ValueError(f"scenario {scenario!r} has no _expected directory") + + discovered: list[ExpectedOutput] = [] + + for path in sorted(expected_root.iterdir()): + matches = [ + short_name + for short_name in TARGETS + if path.name == short_name or path.name.startswith(f"{short_name}.") + ] + if not matches: + known = ", ".join(sorted(TARGETS)) + raise ValueError( + f"unknown expected output {path.name!r} in {expected_root}; " + f"known target names: {known}" + ) + if len(matches) != 1: + raise ValueError( + f"expected output name {path.name!r} is ambiguous; matches {matches}" + ) + + short_name = matches[0] + target = TARGETS[short_name] + if target.output_kind == "directory" and not path.is_dir(): + raise ValueError( + f"expected output {path} must be a directory for target {target.label}" + ) + if target.output_kind == "file" and not path.is_file(): + raise ValueError( + f"expected output {path} must be a file for target {target.label}" + ) + + discovered.append( + ExpectedOutput( + short_name=short_name, + target=target, + expected_path=path, + ) + ) + + if not discovered: + raise ValueError(f"scenario {scenario!r} has no expected outputs") + return discovered + + +def _full_label(scenario: str, target: ExpectedTarget) -> str: + return f"{TEST_ROOT_BAZEL}/scenarios/{scenario}{target.label}" + + +def _actual_path(scenario: str, target: ExpectedTarget) -> Path: + package = f"scenarios/{scenario}" + if target.command == "run": + return _scenario_dir(scenario) / target.output_path + return built_output(package, target.output_path) + + +def _text_diff(expected: bytes, actual: bytes, path: Path) -> str: + try: + expected_text = expected.decode("utf-8").splitlines(keepends=True) + actual_text = actual.decode("utf-8").splitlines(keepends=True) + except UnicodeDecodeError: + return ( + f"{path}: byte content differs " + f"(expected {len(expected)} bytes, actual {len(actual)} bytes)" + ) + + diff = "".join( + difflib.unified_diff( + expected_text, + actual_text, + fromfile=f"expected/{path.name}", + tofile=f"actual/{path.name}", + ) + ) + return f"{path}: byte content differs\n{diff}" + + +def _comparison_bytes(path: Path) -> bytes: + """Return the representation used for comparing one expected file. + + JSON output is formatted for humans before comparison. This keeps checked-in + expected files readable while still checking the complete parsed document; + object-key order is intentionally normalized, but array order and all JSON + values remain significant. Other file types retain strict byte comparison. + """ + raw = path.read_bytes() + if path.suffix != ".json": + return raw + + try: + value = json.loads(raw) + except json.JSONDecodeError as exc: + raise AssertionError(f"{path}: invalid JSON: {exc}") from exc + return ( + json.dumps(value, ensure_ascii=False, indent=2, sort_keys=True) + "\n" + ).encode("utf-8") + + +def _expected_file_diff(expected_path: Path, actual_path: Path) -> str | None: + """Return a diff for one expected file, or ``None`` when it matches.""" + if not actual_path.is_file(): + raise AssertionError(f"expected file is missing: {actual_path}") + + expected = _comparison_bytes(expected_path) + actual = _comparison_bytes(actual_path) + if expected == actual: + return None + return _text_diff(expected, actual, expected_path) + + +def _expected_file_pairs( + expected: ExpectedOutput, scenario: str +) -> list[tuple[Path, Path]]: + """Return checked-in files and their corresponding actual output files.""" + actual_root = _actual_path(scenario, expected.target) + if expected.expected_path.is_file(): + return [(expected.expected_path, actual_root)] + + if not actual_root.is_dir(): + raise AssertionError(f"expected output directory is missing: {actual_root}") + + return [ + ( + expected_file, + actual_root / expected_file.relative_to(expected.expected_path), + ) + for expected_file in sorted( + file for file in expected.expected_path.rglob("*") if file.is_file() + ) + ] + + +def _write_expected_file(path: Path, content: bytes) -> None: + """Replace an expected file atomically while preserving its file mode.""" + mode = stat.S_IMODE(path.stat().st_mode) + descriptor, temporary_name = tempfile.mkstemp( + dir=path.parent, prefix=f".{path.name}." + ) + try: + with os.fdopen(descriptor, "wb") as temporary_file: + descriptor = -1 + temporary_file.write(content) + os.chmod(temporary_name, mode) + os.replace(temporary_name, path) + except BaseException: + if descriptor != -1: + os.close(descriptor) + with contextlib.suppress(FileNotFoundError): + os.unlink(temporary_name) + raise + + +def _run_expected_target(scenario: str, expected: ExpectedOutput) -> None: + """Build or run one target whose output is checked by a test case.""" + full_label = _full_label(scenario, expected.target) + if expected.target.command == "build": + run_bazel( + ["build", EXPECTED_GITHUB_ACTION_ENV, full_label], + env=EXPECTED_GITHUB_ENV, + ) + elif expected.target.command == "run": + run_package( + "run", + f"scenarios/{scenario}", + expected.target.label, + env=EXPECTED_GITHUB_ENV, + ) + else: + raise ValueError(f"unknown expected target command: {expected.target.command}") + + +def update_expected_output(scenario: str, expected_output: ExpectedOutput) -> None: + """Update changed expected files and fail when the scenario changed. + + The checked-in files below this target define the update scope. This + deliberately does not copy every file from an output directory, because + generated docs directories often contain additional files or unstable + artifacts that are not part of the scenario contract. The failure after an + update makes this function suitable for a pre-commit-style pytest check: + the changed files can be reviewed and committed, then the test passes on + the next run. + """ + _run_expected_target(scenario, expected_output) + + changes: list[tuple[Path, bytes, str]] = [] + for expected_path, actual_path in _expected_file_pairs(expected_output, scenario): + if not actual_path.is_file(): + raise AssertionError(f"expected file is missing: {actual_path}") + actual_bytes = _comparison_bytes(actual_path) + diff = _expected_file_diff(expected_path, actual_path) + if diff is not None: + changes.append((expected_path, actual_bytes, diff)) + + for expected_path, actual_bytes, _ in changes: + _write_expected_file(expected_path, actual_bytes) + + if changes: + diff = "\n\n".join(change_diff for _, _, change_diff in changes) + raise AssertionError( + f"expected outputs changed; review and commit the updated files:\n{diff}" + ) diff --git a/src/tests/docs_bzl/helpers.py b/src/tests/docs_bzl/helpers.py index 93a61aab7..0951ea15e 100644 --- a/src/tests/docs_bzl/helpers.py +++ b/src/tests/docs_bzl/helpers.py @@ -13,9 +13,11 @@ """Helpers for public docs.bzl integration tests driven through Bazel.""" import json +import os import shutil import subprocess import time +from collections.abc import Mapping from dataclasses import dataclass from pathlib import Path from typing import cast @@ -34,7 +36,12 @@ def repo_root() -> Path: return root -def run_bazel(args: list[str], expect_error: bool = False): +def run_bazel( + args: list[str], + expect_error: bool = False, + env: Mapping[str, str] | None = None, +): + """Run Bazel, optionally overriding the environment of the subprocess.""" start_time = time.time() cmd = ["bazel", *args] cmd_str = " ".join(cmd) @@ -44,6 +51,7 @@ def run_bazel(args: list[str], expect_error: bool = False): cwd=repo_root(), capture_output=True, text=True, + env=None if env is None else {**os.environ, **env}, ) end_time = time.time() print(f"Running 'bazel {' '.join(args)}' took {end_time - start_time:.4f} seconds") @@ -78,8 +86,9 @@ def run_package( package: str, target: str, expect_error: bool = False, + env: Mapping[str, str] | None = None, ) -> RunResult: - """Run Bazel against one small public-API test package.""" + """Run Bazel against one package, with optional target environment overrides.""" assert bazel_cmd in ("build", "run"), "only build and run are supported" assert target.startswith(":"), "target must be relative to package" @@ -100,7 +109,7 @@ def run_package( runfiles_venv = built_output(package, f"{target[1:]}.runfiles/.docs.venv") shutil.rmtree(runfiles_venv, ignore_errors=True) - p1 = run_bazel([bazel_cmd, full_target], expect_error=expect_error) + p1 = run_bazel([bazel_cmd, full_target], expect_error=expect_error, env=env) if bazel_cmd == "build" and target == ":needs_json": # Generic solution needs to use cquery. diff --git a/src/tests/docs_bzl/scenarios/basic_docs/_expected/docs/compatibility-findings.html b/src/tests/docs_bzl/scenarios/basic_docs/_expected/docs/compatibility-findings.html new file mode 100644 index 000000000..50f3c8b4c --- /dev/null +++ b/src/tests/docs_bzl/scenarios/basic_docs/_expected/docs/compatibility-findings.html @@ -0,0 +1 @@ +Compatibility findings

Compatibility findings

No compatibility findings.

diff --git a/src/tests/docs_bzl/scenarios/basic_docs/_expected/docs/index.html b/src/tests/docs_bzl/scenarios/basic_docs/_expected/docs/index.html new file mode 100644 index 000000000..fcd37bd87 --- /dev/null +++ b/src/tests/docs_bzl/scenarios/basic_docs/_expected/docs/index.html @@ -0,0 +1,460 @@ + + + + + + + + + + + Basic Test — Basic Test documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
+ +
+ + + + + +
+
+ + + + + + +
+ + + + + + + + + +
+ +
+ + +
+
+ +
+ + + + + +
+ +
+

Basic Test#

+
The root bundle owns this supporting file.
+
+
+
+ + +
+ + + + + +
+ +
+
+
+ +
+ + + + + + + +
+
+ +
+ +
+
+
+ + + + + +
+ + +
+ + \ No newline at end of file diff --git a/src/tests/docs_bzl/scenarios/basic_docs/_expected/generated_config.py b/src/tests/docs_bzl/scenarios/basic_docs/_expected/generated_config.py new file mode 100644 index 000000000..51d70798e --- /dev/null +++ b/src/tests/docs_bzl/scenarios/basic_docs/_expected/generated_config.py @@ -0,0 +1,28 @@ +# ******************************************************************************* +# Copyright (c) 2026 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 +# +# SPDX-License-Identifier: Apache-2.0 +# ******************************************************************************* +# Default Sphinx configuration emitted by the ``docs()`` macro and by +# standalone bundle-local Needs exports. SCORE Docs-as-Code owns these +# baseline settings. Project builds and the root bundle may provide their own +# conf.py; standalone bundle-local exports use this baseline. + +project = "Basic Test" +project_url = "https://github.com/eclipse-score/docs-as-code" +version = "0.0.0" + +# Allow feature IDs that use the Bazel module name without its first +# underscore-separated prefix (for example, ``score_docs_as_code`` becomes +# ``docs_as_code``). A user-provided conf.py remains authoritative for the +# normal project build. +required_in_id = ["docs_as_code"] + +extensions = ["score_sphinx_bundle"] diff --git a/src/tests/docs_bzl/scenarios/basic_docs/_expected/needs_json/compatibility-findings.json b/src/tests/docs_bzl/scenarios/basic_docs/_expected/needs_json/compatibility-findings.json new file mode 100644 index 000000000..08fd492f5 --- /dev/null +++ b/src/tests/docs_bzl/scenarios/basic_docs/_expected/needs_json/compatibility-findings.json @@ -0,0 +1,7 @@ +{ + "findings": [], + "summary": { + "count": 0, + "modules": 0 + } +} diff --git a/src/tests/docs_bzl/scenarios/basic_docs/_expected/needs_json/needs.json b/src/tests/docs_bzl/scenarios/basic_docs/_expected/needs_json/needs.json new file mode 100644 index 000000000..346aeed66 --- /dev/null +++ b/src/tests/docs_bzl/scenarios/basic_docs/_expected/needs_json/needs.json @@ -0,0 +1,1403 @@ +{ + "current_version": "0.0.0", + "project": "Basic Test", + "project_url": "https://github.com/eclipse-score/docs-as-code", + "versions": { + "0.0.0": { + "creator": { + "program": "sphinx_needs", + "version": "8.3.1" + }, + "needs": {}, + "needs_amount": 0, + "needs_defaults_removed": true, + "needs_schema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "affects": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "affects_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "applies_to_module_version": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "approved_by": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "approved_by_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "approver": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "approvers": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "arch": { + "additionalProperties": { + "type": "string" + }, + "default": {}, + "description": "Mapping of uml key to uml content.", + "field_type": "core", + "type": "object" + }, + "author": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "avatar": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "belongs_to": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "belongs_to_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "branch_coverage_percent": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "closed_at": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "completion": { + "default": null, + "description": "Added for needgantt functionality", + "field_type": "extra", + "type": [ + "integer", + "null" + ] + }, + "complies": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "complies_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "consequences": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "consists_of": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "consists_of_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "constraints": { + "default": [], + "description": "List of constraint names, which are defined for this need.", + "field_type": "core", + "items": { + "type": "string" + }, + "type": "array" + }, + "constraints_error": { + "default": null, + "description": "An error message set if any constraint failed, and `error_message` field is set in config.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "constraints_passed": { + "default": true, + "description": "True if all constraints passed, False if any failed, None if not yet checked.", + "field_type": "core", + "type": [ + "boolean", + "null" + ] + }, + "constraints_results": { + "additionalProperties": { + "type": "object" + }, + "default": {}, + "description": "Mapping of constraint name, to check name, to result, None if not yet checked.", + "field_type": "core", + "type": [ + "object", + "null" + ] + }, + "contains": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "contains_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "content": { + "default": "", + "description": "The main content of the need.", + "field_type": "core", + "type": "string" + }, + "context": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "covers": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "covers_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "created_at": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "decision": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "derivation_technique": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "derived_from": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "derived_from_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "docname": { + "default": null, + "description": "Name of the document where the need is defined (None if external).", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "doctype": { + "default": ".rst", + "description": "The markup type of the content, denoted by the suffix of the source file, e.g. '.rst'.", + "field_type": "core", + "type": "string" + }, + "duration": { + "default": null, + "description": "Added for needgantt functionality", + "field_type": "extra", + "type": [ + "integer", + "null" + ] + }, + "evidence": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "evidence_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "external_css": { + "default": "", + "description": "CSS class name, added to the external reference.", + "field_type": "core", + "type": "string" + }, + "external_url": { + "default": null, + "description": "URL of the need, if it is an external need.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "failure_effect": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "failure_id": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "fault_id": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "file": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "fulfils": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "fulfils_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "fully_verifies": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "fully_verifies_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "has": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "has_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "has_dead_links": { + "default": false, + "description": "True if any links reference need ids that are not found in the need list.", + "field_type": "core", + "type": "boolean" + }, + "has_forbidden_dead_links": { + "default": false, + "description": "True if any links reference need ids that are not found in the need list, and the link type does not allow dead links.", + "field_type": "core", + "type": "boolean" + }, + "hash": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "id": { + "description": "ID of the data.", + "field_type": "core", + "type": "string" + }, + "id_prefix": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "implemented": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "implements": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "implements_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "included_by": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "included_by_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "includes": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "includes_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "input": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "input_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "is_external": { + "default": false, + "description": "If true, no node is created and need is referencing external url.", + "field_type": "core", + "type": "boolean" + }, + "is_import": { + "default": false, + "description": "If true, the need was derived from an import.", + "field_type": "core", + "type": "boolean" + }, + "is_modified": { + "default": false, + "description": "Whether the need was modified by needextend.", + "field_type": "core", + "type": "boolean" + }, + "jinja_content": { + "default": false, + "description": "Whether the content was pre-processed by jinja.", + "field_type": "core", + "type": "boolean" + }, + "language": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "layout": { + "default": null, + "description": "Key of the layout, which is used to render the need.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "line": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "line_coverage_percent": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "lineno": { + "default": null, + "description": "Line number where the need is defined (None if external).", + "field_type": "core", + "type": [ + "integer", + "null" + ] + }, + "links": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "links_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "max_amount": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "max_content_lines": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "mitigated_by": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "mitigated_by_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "mitigation_issue": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "modifications": { + "default": 0, + "description": "Number of modifications by needextend.", + "field_type": "core", + "type": "integer" + }, + "name": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "output": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "output_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "parent_covered": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "parent_has_problem": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "parent_need": { + "default": null, + "description": "Simply the first parent id.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "parent_needs": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "parent_needs_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "partially_verifies": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "partially_verifies_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "parts": { + "additionalProperties": { + "type": "object" + }, + "default": {}, + "description": "Mapping of parts, a.k.a. sub-needs, IDs to data that overrides the need's data", + "field_type": "core", + "type": "object" + }, + "post_content": { + "default": null, + "description": "Additional content after the need.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "post_template": { + "default": null, + "description": "The template key, if the post_content was created from a jinja template.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "pre_content": { + "default": null, + "description": "Additional content before the need.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "pre_template": { + "default": null, + "description": "The template key, if the pre_content was created from a jinja template.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "provides": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "provides_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "query": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "rationale": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "realizes": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "realizes_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "reqtype": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "requirements_tests_completely_passed_percent": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "responsible": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "responsible_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "result": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "result_text": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "reviewer": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "reviewers": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "root_cause": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "safety": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "safety_affected": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "safety_relevant": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "satisfied_by": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "satisfied_by_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "satisfies": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "satisfies_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "section_name": { + "default": null, + "description": "Simply the first section.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "sections": { + "default": [], + "description": "Sections of the need.", + "field_type": "core", + "items": { + "type": "string" + }, + "type": "array" + }, + "security": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "security_affected": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "service": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "signature": { + "default": null, + "description": "Derived from a docutils desc_name node.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "source_code_link": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "specific": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "status": { + "default": null, + "description": "Status of the need.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "style": { + "default": null, + "description": "Comma-separated list of CSS classes (all appended by `needs_style_`).", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "sufficient": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "supported_by": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "supported_by_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "tags": { + "default": [], + "description": "List of tags.", + "field_type": "core", + "items": { + "type": "string" + }, + "type": "array" + }, + "tcl": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "template": { + "default": null, + "description": "The template key, if the content was created from a jinja template.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "test_type": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "testcovered": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "testlink": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "threat_effect": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "threat_id": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "threat_scenario_id": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "title": { + "description": "Title of the need.", + "field_type": "core", + "type": "string" + }, + "tool_version": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "tracking": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "type": { + "default": "", + "description": "Type of the need.", + "field_type": "core", + "type": "string" + }, + "type_name": { + "default": "", + "description": "Name of the type.", + "field_type": "core", + "type": "string" + }, + "updated_at": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "url": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "user": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "uses": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "uses_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "valid_from": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "valid_until": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "verification_method": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "version": { + "default": 0, + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "integer", + "null" + ] + }, + "violates": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "violates_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + } + } + } +} diff --git a/src/tests/docs_bzl/scenarios/data_files_runfiles/BUILD b/src/tests/docs_bzl/scenarios/data_files_runfiles/BUILD index f796ba5e1..e9e5d12f4 100644 --- a/src/tests/docs_bzl/scenarios/data_files_runfiles/BUILD +++ b/src/tests/docs_bzl/scenarios/data_files_runfiles/BUILD @@ -65,6 +65,11 @@ docs_bundle( docs( source_dir = "docs", + # Keep this fixture's test-source scope local. The default imports every + # test report in the repository, including unrelated external-link + # warnings that would make this focused runtime scenario fail as an + # accidental side effect of the global test corpus. + test_sources = ["src/tests/docs_bzl/scenarios/data_files_runfiles"], bundles = [{ "bundle": ":data_bundle", "mount_at": "data_test", diff --git a/src/tests/docs_bzl/scenarios/data_files_runfiles/_expected/data_bundle_needs/needs.json b/src/tests/docs_bzl/scenarios/data_files_runfiles/_expected/data_bundle_needs/needs.json new file mode 100644 index 000000000..d5da28295 --- /dev/null +++ b/src/tests/docs_bzl/scenarios/data_files_runfiles/_expected/data_bundle_needs/needs.json @@ -0,0 +1,1403 @@ +{ + "current_version": "0.0.0", + "project": "data_bundle", + "project_url": "", + "versions": { + "0.0.0": { + "creator": { + "program": "sphinx_needs", + "version": "8.3.1" + }, + "needs": {}, + "needs_amount": 0, + "needs_defaults_removed": true, + "needs_schema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "affects": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "affects_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "applies_to_module_version": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "approved_by": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "approved_by_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "approver": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "approvers": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "arch": { + "additionalProperties": { + "type": "string" + }, + "default": {}, + "description": "Mapping of uml key to uml content.", + "field_type": "core", + "type": "object" + }, + "author": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "avatar": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "belongs_to": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "belongs_to_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "branch_coverage_percent": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "closed_at": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "completion": { + "default": null, + "description": "Added for needgantt functionality", + "field_type": "extra", + "type": [ + "integer", + "null" + ] + }, + "complies": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "complies_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "consequences": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "consists_of": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "consists_of_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "constraints": { + "default": [], + "description": "List of constraint names, which are defined for this need.", + "field_type": "core", + "items": { + "type": "string" + }, + "type": "array" + }, + "constraints_error": { + "default": null, + "description": "An error message set if any constraint failed, and `error_message` field is set in config.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "constraints_passed": { + "default": true, + "description": "True if all constraints passed, False if any failed, None if not yet checked.", + "field_type": "core", + "type": [ + "boolean", + "null" + ] + }, + "constraints_results": { + "additionalProperties": { + "type": "object" + }, + "default": {}, + "description": "Mapping of constraint name, to check name, to result, None if not yet checked.", + "field_type": "core", + "type": [ + "object", + "null" + ] + }, + "contains": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "contains_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "content": { + "default": "", + "description": "The main content of the need.", + "field_type": "core", + "type": "string" + }, + "context": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "covers": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "covers_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "created_at": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "decision": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "derivation_technique": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "derived_from": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "derived_from_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "docname": { + "default": null, + "description": "Name of the document where the need is defined (None if external).", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "doctype": { + "default": ".rst", + "description": "The markup type of the content, denoted by the suffix of the source file, e.g. '.rst'.", + "field_type": "core", + "type": "string" + }, + "duration": { + "default": null, + "description": "Added for needgantt functionality", + "field_type": "extra", + "type": [ + "integer", + "null" + ] + }, + "evidence": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "evidence_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "external_css": { + "default": "", + "description": "CSS class name, added to the external reference.", + "field_type": "core", + "type": "string" + }, + "external_url": { + "default": null, + "description": "URL of the need, if it is an external need.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "failure_effect": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "failure_id": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "fault_id": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "file": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "fulfils": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "fulfils_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "fully_verifies": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "fully_verifies_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "has": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "has_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "has_dead_links": { + "default": false, + "description": "True if any links reference need ids that are not found in the need list.", + "field_type": "core", + "type": "boolean" + }, + "has_forbidden_dead_links": { + "default": false, + "description": "True if any links reference need ids that are not found in the need list, and the link type does not allow dead links.", + "field_type": "core", + "type": "boolean" + }, + "hash": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "id": { + "description": "ID of the data.", + "field_type": "core", + "type": "string" + }, + "id_prefix": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "implemented": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "implements": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "implements_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "included_by": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "included_by_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "includes": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "includes_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "input": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "input_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "is_external": { + "default": false, + "description": "If true, no node is created and need is referencing external url.", + "field_type": "core", + "type": "boolean" + }, + "is_import": { + "default": false, + "description": "If true, the need was derived from an import.", + "field_type": "core", + "type": "boolean" + }, + "is_modified": { + "default": false, + "description": "Whether the need was modified by needextend.", + "field_type": "core", + "type": "boolean" + }, + "jinja_content": { + "default": false, + "description": "Whether the content was pre-processed by jinja.", + "field_type": "core", + "type": "boolean" + }, + "language": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "layout": { + "default": null, + "description": "Key of the layout, which is used to render the need.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "line": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "line_coverage_percent": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "lineno": { + "default": null, + "description": "Line number where the need is defined (None if external).", + "field_type": "core", + "type": [ + "integer", + "null" + ] + }, + "links": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "links_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "max_amount": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "max_content_lines": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "mitigated_by": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "mitigated_by_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "mitigation_issue": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "modifications": { + "default": 0, + "description": "Number of modifications by needextend.", + "field_type": "core", + "type": "integer" + }, + "name": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "output": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "output_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "parent_covered": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "parent_has_problem": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "parent_need": { + "default": null, + "description": "Simply the first parent id.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "parent_needs": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "parent_needs_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "partially_verifies": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "partially_verifies_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "parts": { + "additionalProperties": { + "type": "object" + }, + "default": {}, + "description": "Mapping of parts, a.k.a. sub-needs, IDs to data that overrides the need's data", + "field_type": "core", + "type": "object" + }, + "post_content": { + "default": null, + "description": "Additional content after the need.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "post_template": { + "default": null, + "description": "The template key, if the post_content was created from a jinja template.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "pre_content": { + "default": null, + "description": "Additional content before the need.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "pre_template": { + "default": null, + "description": "The template key, if the pre_content was created from a jinja template.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "provides": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "provides_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "query": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "rationale": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "realizes": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "realizes_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "reqtype": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "requirements_tests_completely_passed_percent": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "responsible": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "responsible_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "result": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "result_text": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "reviewer": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "reviewers": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "root_cause": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "safety": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "safety_affected": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "safety_relevant": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "satisfied_by": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "satisfied_by_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "satisfies": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "satisfies_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "section_name": { + "default": null, + "description": "Simply the first section.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "sections": { + "default": [], + "description": "Sections of the need.", + "field_type": "core", + "items": { + "type": "string" + }, + "type": "array" + }, + "security": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "security_affected": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "service": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "signature": { + "default": null, + "description": "Derived from a docutils desc_name node.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "source_code_link": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "specific": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "status": { + "default": null, + "description": "Status of the need.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "style": { + "default": null, + "description": "Comma-separated list of CSS classes (all appended by `needs_style_`).", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "sufficient": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "supported_by": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "supported_by_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "tags": { + "default": [], + "description": "List of tags.", + "field_type": "core", + "items": { + "type": "string" + }, + "type": "array" + }, + "tcl": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "template": { + "default": null, + "description": "The template key, if the content was created from a jinja template.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "test_type": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "testcovered": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "testlink": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "threat_effect": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "threat_id": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "threat_scenario_id": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "title": { + "description": "Title of the need.", + "field_type": "core", + "type": "string" + }, + "tool_version": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "tracking": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "type": { + "default": "", + "description": "Type of the need.", + "field_type": "core", + "type": "string" + }, + "type_name": { + "default": "", + "description": "Name of the type.", + "field_type": "core", + "type": "string" + }, + "updated_at": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "url": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "user": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "uses": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "uses_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "valid_from": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "valid_until": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "verification_method": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "version": { + "default": 0, + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "integer", + "null" + ] + }, + "violates": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "violates_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + } + } + } +} diff --git a/src/tests/docs_bzl/scenarios/data_files_runfiles/_expected/docs/data_test/index.html b/src/tests/docs_bzl/scenarios/data_files_runfiles/_expected/docs/data_test/index.html new file mode 100644 index 000000000..b551a3006 --- /dev/null +++ b/src/tests/docs_bzl/scenarios/data_files_runfiles/_expected/docs/data_test/index.html @@ -0,0 +1,895 @@ + + + + + + + + + + + Generated Data Page — Data Files Runfiles Test documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
+ +
+ + + + + +
+
+ + + + +
+ + + + + + + + + + + +
+ +
+ + +
+
+ +
+
+ +
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ +
+

Generated Data Page#

+
+        classDiagram
+  class GeneratedData
+
+    
+ + +
+ + + + + + + +
+ + + + +
+
+ +
+ +
+
+
+ + + + + +
+ + +
+ + \ No newline at end of file diff --git a/src/tests/docs_bzl/scenarios/data_files_runfiles/_expected/docs/index.html b/src/tests/docs_bzl/scenarios/data_files_runfiles/_expected/docs/index.html new file mode 100644 index 000000000..8e6197cbc --- /dev/null +++ b/src/tests/docs_bzl/scenarios/data_files_runfiles/_expected/docs/index.html @@ -0,0 +1,515 @@ + + + + + + + + + + + Host page with generated bundle data — Data Files Runfiles Test documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
+ +
+ + + + + +
+
+ + + + + + +
+ + + + + + + + + +
+ +
+ + +
+
+ +
+ + + + + +
+ +
+

Host page with generated bundle data#

+

The host project can mount a pure-data bundle and include its generated page +in the documentation navigation.

+

The explicitly declared source bundle also mounts only its declared page.

+ +
+ + +
+ + + + + + + +
+ + + + + + + +
+
+ +
+ +
+
+
+ + + + + +
+ + +
+ + \ No newline at end of file diff --git a/src/tests/docs_bzl/scenarios/data_files_runfiles/_expected/docs/isolated_test/index.html b/src/tests/docs_bzl/scenarios/data_files_runfiles/_expected/docs/isolated_test/index.html new file mode 100644 index 000000000..78d82e795 --- /dev/null +++ b/src/tests/docs_bzl/scenarios/data_files_runfiles/_expected/docs/isolated_test/index.html @@ -0,0 +1,557 @@ + + + + + + + + + + + Isolated Declared Page — Data Files Runfiles Test documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
+ +
+ + + + + +
+
+ + + + +
+ + + + + + + + + + + +
+ +
+ + +
+
+ +
+
+ +
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ +
+

Isolated Declared Page#

+

This page is explicitly declared in the bundle.

+
+ + +
+ + + + + + + +
+ + + + + + + +
+
+ +
+ +
+
+
+ + + + + +
+ + +
+ + \ No newline at end of file diff --git a/src/tests/docs_bzl/scenarios/data_files_runfiles/_expected/docs/legacy_data_test/index.html b/src/tests/docs_bzl/scenarios/data_files_runfiles/_expected/docs/legacy_data_test/index.html new file mode 100644 index 000000000..3f9941e6b --- /dev/null +++ b/src/tests/docs_bzl/scenarios/data_files_runfiles/_expected/docs/legacy_data_test/index.html @@ -0,0 +1,520 @@ + + + + + + + + + + + Legacy Data Page — Data Files Runfiles Test documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
+ +
+ + + + + +
+
+ + + + +
+ + + + + + + + + + + +
+ +
+ + +
+
+ +
+
+ +
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ +
+

Legacy Data Page#

+
+ + +
+ + + + + + + +
+ + + + +
+
+ +
+ +
+
+
+ + + + + +
+ + +
+ + \ No newline at end of file diff --git a/src/tests/docs_bzl/scenarios/data_files_runfiles/_expected/isolated_source_bundle_needs/needs.json b/src/tests/docs_bzl/scenarios/data_files_runfiles/_expected/isolated_source_bundle_needs/needs.json new file mode 100644 index 000000000..eece8f468 --- /dev/null +++ b/src/tests/docs_bzl/scenarios/data_files_runfiles/_expected/isolated_source_bundle_needs/needs.json @@ -0,0 +1,1403 @@ +{ + "current_version": "0.0.0", + "project": "isolated_source_bundle", + "project_url": "", + "versions": { + "0.0.0": { + "creator": { + "program": "sphinx_needs", + "version": "8.3.1" + }, + "needs": {}, + "needs_amount": 0, + "needs_defaults_removed": true, + "needs_schema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "affects": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "affects_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "applies_to_module_version": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "approved_by": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "approved_by_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "approver": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "approvers": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "arch": { + "additionalProperties": { + "type": "string" + }, + "default": {}, + "description": "Mapping of uml key to uml content.", + "field_type": "core", + "type": "object" + }, + "author": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "avatar": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "belongs_to": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "belongs_to_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "branch_coverage_percent": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "closed_at": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "completion": { + "default": null, + "description": "Added for needgantt functionality", + "field_type": "extra", + "type": [ + "integer", + "null" + ] + }, + "complies": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "complies_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "consequences": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "consists_of": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "consists_of_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "constraints": { + "default": [], + "description": "List of constraint names, which are defined for this need.", + "field_type": "core", + "items": { + "type": "string" + }, + "type": "array" + }, + "constraints_error": { + "default": null, + "description": "An error message set if any constraint failed, and `error_message` field is set in config.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "constraints_passed": { + "default": true, + "description": "True if all constraints passed, False if any failed, None if not yet checked.", + "field_type": "core", + "type": [ + "boolean", + "null" + ] + }, + "constraints_results": { + "additionalProperties": { + "type": "object" + }, + "default": {}, + "description": "Mapping of constraint name, to check name, to result, None if not yet checked.", + "field_type": "core", + "type": [ + "object", + "null" + ] + }, + "contains": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "contains_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "content": { + "default": "", + "description": "The main content of the need.", + "field_type": "core", + "type": "string" + }, + "context": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "covers": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "covers_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "created_at": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "decision": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "derivation_technique": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "derived_from": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "derived_from_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "docname": { + "default": null, + "description": "Name of the document where the need is defined (None if external).", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "doctype": { + "default": ".rst", + "description": "The markup type of the content, denoted by the suffix of the source file, e.g. '.rst'.", + "field_type": "core", + "type": "string" + }, + "duration": { + "default": null, + "description": "Added for needgantt functionality", + "field_type": "extra", + "type": [ + "integer", + "null" + ] + }, + "evidence": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "evidence_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "external_css": { + "default": "", + "description": "CSS class name, added to the external reference.", + "field_type": "core", + "type": "string" + }, + "external_url": { + "default": null, + "description": "URL of the need, if it is an external need.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "failure_effect": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "failure_id": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "fault_id": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "file": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "fulfils": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "fulfils_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "fully_verifies": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "fully_verifies_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "has": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "has_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "has_dead_links": { + "default": false, + "description": "True if any links reference need ids that are not found in the need list.", + "field_type": "core", + "type": "boolean" + }, + "has_forbidden_dead_links": { + "default": false, + "description": "True if any links reference need ids that are not found in the need list, and the link type does not allow dead links.", + "field_type": "core", + "type": "boolean" + }, + "hash": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "id": { + "description": "ID of the data.", + "field_type": "core", + "type": "string" + }, + "id_prefix": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "implemented": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "implements": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "implements_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "included_by": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "included_by_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "includes": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "includes_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "input": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "input_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "is_external": { + "default": false, + "description": "If true, no node is created and need is referencing external url.", + "field_type": "core", + "type": "boolean" + }, + "is_import": { + "default": false, + "description": "If true, the need was derived from an import.", + "field_type": "core", + "type": "boolean" + }, + "is_modified": { + "default": false, + "description": "Whether the need was modified by needextend.", + "field_type": "core", + "type": "boolean" + }, + "jinja_content": { + "default": false, + "description": "Whether the content was pre-processed by jinja.", + "field_type": "core", + "type": "boolean" + }, + "language": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "layout": { + "default": null, + "description": "Key of the layout, which is used to render the need.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "line": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "line_coverage_percent": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "lineno": { + "default": null, + "description": "Line number where the need is defined (None if external).", + "field_type": "core", + "type": [ + "integer", + "null" + ] + }, + "links": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "links_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "max_amount": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "max_content_lines": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "mitigated_by": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "mitigated_by_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "mitigation_issue": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "modifications": { + "default": 0, + "description": "Number of modifications by needextend.", + "field_type": "core", + "type": "integer" + }, + "name": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "output": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "output_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "parent_covered": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "parent_has_problem": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "parent_need": { + "default": null, + "description": "Simply the first parent id.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "parent_needs": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "parent_needs_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "partially_verifies": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "partially_verifies_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "parts": { + "additionalProperties": { + "type": "object" + }, + "default": {}, + "description": "Mapping of parts, a.k.a. sub-needs, IDs to data that overrides the need's data", + "field_type": "core", + "type": "object" + }, + "post_content": { + "default": null, + "description": "Additional content after the need.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "post_template": { + "default": null, + "description": "The template key, if the post_content was created from a jinja template.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "pre_content": { + "default": null, + "description": "Additional content before the need.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "pre_template": { + "default": null, + "description": "The template key, if the pre_content was created from a jinja template.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "provides": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "provides_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "query": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "rationale": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "realizes": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "realizes_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "reqtype": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "requirements_tests_completely_passed_percent": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "responsible": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "responsible_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "result": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "result_text": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "reviewer": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "reviewers": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "root_cause": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "safety": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "safety_affected": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "safety_relevant": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "satisfied_by": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "satisfied_by_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "satisfies": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "satisfies_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "section_name": { + "default": null, + "description": "Simply the first section.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "sections": { + "default": [], + "description": "Sections of the need.", + "field_type": "core", + "items": { + "type": "string" + }, + "type": "array" + }, + "security": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "security_affected": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "service": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "signature": { + "default": null, + "description": "Derived from a docutils desc_name node.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "source_code_link": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "specific": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "status": { + "default": null, + "description": "Status of the need.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "style": { + "default": null, + "description": "Comma-separated list of CSS classes (all appended by `needs_style_`).", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "sufficient": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "supported_by": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "supported_by_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "tags": { + "default": [], + "description": "List of tags.", + "field_type": "core", + "items": { + "type": "string" + }, + "type": "array" + }, + "tcl": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "template": { + "default": null, + "description": "The template key, if the content was created from a jinja template.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "test_type": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "testcovered": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "testlink": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "threat_effect": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "threat_id": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "threat_scenario_id": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "title": { + "description": "Title of the need.", + "field_type": "core", + "type": "string" + }, + "tool_version": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "tracking": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "type": { + "default": "", + "description": "Type of the need.", + "field_type": "core", + "type": "string" + }, + "type_name": { + "default": "", + "description": "Name of the type.", + "field_type": "core", + "type": "string" + }, + "updated_at": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "url": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "user": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "uses": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "uses_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "valid_from": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "valid_until": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "verification_method": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "version": { + "default": 0, + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "integer", + "null" + ] + }, + "violates": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "violates_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + } + } + } +} diff --git a/src/tests/docs_bzl/scenarios/data_files_runfiles/_expected/needs_json/needs.json b/src/tests/docs_bzl/scenarios/data_files_runfiles/_expected/needs_json/needs.json new file mode 100644 index 000000000..fb6acfd31 --- /dev/null +++ b/src/tests/docs_bzl/scenarios/data_files_runfiles/_expected/needs_json/needs.json @@ -0,0 +1,1403 @@ +{ + "current_version": "", + "project": "Data Files Runfiles Test", + "project_url": "https://github.com/eclipse-score/docs-as-code", + "versions": { + "": { + "creator": { + "program": "sphinx_needs", + "version": "8.3.1" + }, + "needs": {}, + "needs_amount": 0, + "needs_defaults_removed": true, + "needs_schema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "affects": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "affects_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "applies_to_module_version": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "approved_by": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "approved_by_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "approver": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "approvers": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "arch": { + "additionalProperties": { + "type": "string" + }, + "default": {}, + "description": "Mapping of uml key to uml content.", + "field_type": "core", + "type": "object" + }, + "author": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "avatar": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "belongs_to": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "belongs_to_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "branch_coverage_percent": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "closed_at": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "completion": { + "default": null, + "description": "Added for needgantt functionality", + "field_type": "extra", + "type": [ + "integer", + "null" + ] + }, + "complies": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "complies_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "consequences": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "consists_of": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "consists_of_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "constraints": { + "default": [], + "description": "List of constraint names, which are defined for this need.", + "field_type": "core", + "items": { + "type": "string" + }, + "type": "array" + }, + "constraints_error": { + "default": null, + "description": "An error message set if any constraint failed, and `error_message` field is set in config.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "constraints_passed": { + "default": true, + "description": "True if all constraints passed, False if any failed, None if not yet checked.", + "field_type": "core", + "type": [ + "boolean", + "null" + ] + }, + "constraints_results": { + "additionalProperties": { + "type": "object" + }, + "default": {}, + "description": "Mapping of constraint name, to check name, to result, None if not yet checked.", + "field_type": "core", + "type": [ + "object", + "null" + ] + }, + "contains": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "contains_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "content": { + "default": "", + "description": "The main content of the need.", + "field_type": "core", + "type": "string" + }, + "context": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "covers": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "covers_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "created_at": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "decision": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "derivation_technique": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "derived_from": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "derived_from_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "docname": { + "default": null, + "description": "Name of the document where the need is defined (None if external).", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "doctype": { + "default": ".rst", + "description": "The markup type of the content, denoted by the suffix of the source file, e.g. '.rst'.", + "field_type": "core", + "type": "string" + }, + "duration": { + "default": null, + "description": "Added for needgantt functionality", + "field_type": "extra", + "type": [ + "integer", + "null" + ] + }, + "evidence": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "evidence_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "external_css": { + "default": "", + "description": "CSS class name, added to the external reference.", + "field_type": "core", + "type": "string" + }, + "external_url": { + "default": null, + "description": "URL of the need, if it is an external need.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "failure_effect": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "failure_id": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "fault_id": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "file": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "fulfils": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "fulfils_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "fully_verifies": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "fully_verifies_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "has": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "has_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "has_dead_links": { + "default": false, + "description": "True if any links reference need ids that are not found in the need list.", + "field_type": "core", + "type": "boolean" + }, + "has_forbidden_dead_links": { + "default": false, + "description": "True if any links reference need ids that are not found in the need list, and the link type does not allow dead links.", + "field_type": "core", + "type": "boolean" + }, + "hash": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "id": { + "description": "ID of the data.", + "field_type": "core", + "type": "string" + }, + "id_prefix": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "implemented": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "implements": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "implements_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "included_by": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "included_by_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "includes": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "includes_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "input": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "input_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "is_external": { + "default": false, + "description": "If true, no node is created and need is referencing external url.", + "field_type": "core", + "type": "boolean" + }, + "is_import": { + "default": false, + "description": "If true, the need was derived from an import.", + "field_type": "core", + "type": "boolean" + }, + "is_modified": { + "default": false, + "description": "Whether the need was modified by needextend.", + "field_type": "core", + "type": "boolean" + }, + "jinja_content": { + "default": false, + "description": "Whether the content was pre-processed by jinja.", + "field_type": "core", + "type": "boolean" + }, + "language": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "layout": { + "default": null, + "description": "Key of the layout, which is used to render the need.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "line": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "line_coverage_percent": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "lineno": { + "default": null, + "description": "Line number where the need is defined (None if external).", + "field_type": "core", + "type": [ + "integer", + "null" + ] + }, + "links": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "links_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "max_amount": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "max_content_lines": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "mitigated_by": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "mitigated_by_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "mitigation_issue": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "modifications": { + "default": 0, + "description": "Number of modifications by needextend.", + "field_type": "core", + "type": "integer" + }, + "name": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "output": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "output_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "parent_covered": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "parent_has_problem": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "parent_need": { + "default": null, + "description": "Simply the first parent id.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "parent_needs": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "parent_needs_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "partially_verifies": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "partially_verifies_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "parts": { + "additionalProperties": { + "type": "object" + }, + "default": {}, + "description": "Mapping of parts, a.k.a. sub-needs, IDs to data that overrides the need's data", + "field_type": "core", + "type": "object" + }, + "post_content": { + "default": null, + "description": "Additional content after the need.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "post_template": { + "default": null, + "description": "The template key, if the post_content was created from a jinja template.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "pre_content": { + "default": null, + "description": "Additional content before the need.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "pre_template": { + "default": null, + "description": "The template key, if the pre_content was created from a jinja template.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "provides": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "provides_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "query": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "rationale": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "realizes": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "realizes_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "reqtype": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "requirements_tests_completely_passed_percent": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "responsible": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "responsible_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "result": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "result_text": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "reviewer": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "reviewers": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "root_cause": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "safety": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "safety_affected": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "safety_relevant": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "satisfied_by": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "satisfied_by_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "satisfies": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "satisfies_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "section_name": { + "default": null, + "description": "Simply the first section.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "sections": { + "default": [], + "description": "Sections of the need.", + "field_type": "core", + "items": { + "type": "string" + }, + "type": "array" + }, + "security": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "security_affected": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "service": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "signature": { + "default": null, + "description": "Derived from a docutils desc_name node.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "source_code_link": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "specific": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "status": { + "default": null, + "description": "Status of the need.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "style": { + "default": null, + "description": "Comma-separated list of CSS classes (all appended by `needs_style_`).", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "sufficient": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "supported_by": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "supported_by_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "tags": { + "default": [], + "description": "List of tags.", + "field_type": "core", + "items": { + "type": "string" + }, + "type": "array" + }, + "tcl": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "template": { + "default": null, + "description": "The template key, if the content was created from a jinja template.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "test_type": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "testcovered": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "testlink": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "threat_effect": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "threat_id": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "threat_scenario_id": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "title": { + "description": "Title of the need.", + "field_type": "core", + "type": "string" + }, + "tool_version": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "tracking": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "type": { + "default": "", + "description": "Type of the need.", + "field_type": "core", + "type": "string" + }, + "type_name": { + "default": "", + "description": "Name of the type.", + "field_type": "core", + "type": "string" + }, + "updated_at": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "url": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "user": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "uses": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "uses_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "valid_from": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "valid_until": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "verification_method": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "version": { + "default": 0, + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "integer", + "null" + ] + }, + "violates": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "violates_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + } + } + } +} diff --git a/src/tests/docs_bzl/scenarios/external_bundle/_expected/docs/compatibility-findings.json b/src/tests/docs_bzl/scenarios/external_bundle/_expected/docs/compatibility-findings.json new file mode 100644 index 000000000..08fd492f5 --- /dev/null +++ b/src/tests/docs_bzl/scenarios/external_bundle/_expected/docs/compatibility-findings.json @@ -0,0 +1,7 @@ +{ + "findings": [], + "summary": { + "count": 0, + "modules": 0 + } +} diff --git a/src/tests/docs_bzl/scenarios/external_bundle/_expected/docs/index.html b/src/tests/docs_bzl/scenarios/external_bundle/_expected/docs/index.html new file mode 100644 index 000000000..d9ef9eb9a --- /dev/null +++ b/src/tests/docs_bzl/scenarios/external_bundle/_expected/docs/index.html @@ -0,0 +1,484 @@ + + + + + + + + + + + External bundle — External mount fixture documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
+ +
+ + + + + +
+
+ + + + + + +
+ + + + + + + + + +
+ +
+ + +
+
+ +
+ + + + + + + + + + + + + +
+ + + + + + + +
+
+ +
+ +
+
+
+ + + + + +
+ + +
+ + \ No newline at end of file diff --git a/src/tests/docs_bzl/scenarios/external_bundle/_expected/needs_json/compatibility-findings.json b/src/tests/docs_bzl/scenarios/external_bundle/_expected/needs_json/compatibility-findings.json new file mode 100644 index 000000000..08fd492f5 --- /dev/null +++ b/src/tests/docs_bzl/scenarios/external_bundle/_expected/needs_json/compatibility-findings.json @@ -0,0 +1,7 @@ +{ + "findings": [], + "summary": { + "count": 0, + "modules": 0 + } +} diff --git a/src/tests/docs_bzl/scenarios/nested_bundles/_expected/docs/compatibility-findings.html b/src/tests/docs_bzl/scenarios/nested_bundles/_expected/docs/compatibility-findings.html new file mode 100644 index 000000000..50f3c8b4c --- /dev/null +++ b/src/tests/docs_bzl/scenarios/nested_bundles/_expected/docs/compatibility-findings.html @@ -0,0 +1 @@ +Compatibility findings

Compatibility findings

No compatibility findings.

diff --git a/src/tests/docs_bzl/scenarios/nested_bundles/_expected/docs/compatibility-findings.json b/src/tests/docs_bzl/scenarios/nested_bundles/_expected/docs/compatibility-findings.json new file mode 100644 index 000000000..08fd492f5 --- /dev/null +++ b/src/tests/docs_bzl/scenarios/nested_bundles/_expected/docs/compatibility-findings.json @@ -0,0 +1,7 @@ +{ + "findings": [], + "summary": { + "count": 0, + "modules": 0 + } +} diff --git a/src/tests/docs_bzl/scenarios/nested_bundles/_expected/docs/concepts/example_bundle/child/landing.html b/src/tests/docs_bzl/scenarios/nested_bundles/_expected/docs/concepts/example_bundle/child/landing.html new file mode 100644 index 000000000..267058092 --- /dev/null +++ b/src/tests/docs_bzl/scenarios/nested_bundles/_expected/docs/concepts/example_bundle/child/landing.html @@ -0,0 +1,548 @@ + + + + + + + + + + + Child landing page — Mount contract fixture documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
+ +
+ + + + + +
+
+ + + + +
+ + + + + + + + + + + +
+ +
+ + +
+
+ +
+
+ +
+ +
+ + +
+ +
+ + +
+
+ + + + + + + + + + + + + +
+ + + + + + + +
+
+ +
+ +
+
+
+ + + + + +
+ + +
+ + \ No newline at end of file diff --git a/src/tests/docs_bzl/scenarios/nested_bundles/_expected/docs/index.html b/src/tests/docs_bzl/scenarios/nested_bundles/_expected/docs/index.html new file mode 100644 index 000000000..2b67a11ac --- /dev/null +++ b/src/tests/docs_bzl/scenarios/nested_bundles/_expected/docs/index.html @@ -0,0 +1,484 @@ + + + + + + + + + + + Mount contract fixture — Mount contract fixture documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
+ +
+ + + + + +
+
+ + + + + + +
+ + + + + + + + + +
+ +
+ + +
+
+ +
+ + + + + +
+ +
+

Mount contract fixture#

+
+ +
+
+ + +
+ + + + + + + +
+ + + + + + + +
+
+ +
+ +
+
+
+ + + + + +
+ + +
+ + \ No newline at end of file diff --git a/src/tests/docs_bzl/scenarios/nested_bundles/_expected/mounts_manifest.json b/src/tests/docs_bzl/scenarios/nested_bundles/_expected/mounts_manifest.json new file mode 100644 index 000000000..eac0111a3 --- /dev/null +++ b/src/tests/docs_bzl/scenarios/nested_bundles/_expected/mounts_manifest.json @@ -0,0 +1,28 @@ +{ + "mounts": [ + { + "attach_to": "concepts/index", + "data": [ + "src/tests/docs_bzl/scenarios/nested_bundles/generated/generated_output.txt" + ], + "entry_doc": "index", + "external": false, + "generated": false, + "mount_at": "concepts/example_bundle", + "repository": "", + "runtime_path": "src/tests/docs_bzl/scenarios/nested_bundles/parent", + "src_root": "src/tests/docs_bzl/scenarios/nested_bundles/parent" + }, + { + "attach_to": "concepts/example_bundle/index", + "data": [], + "entry_doc": "landing", + "external": false, + "generated": false, + "mount_at": "concepts/example_bundle/child", + "repository": "", + "runtime_path": "src/tests/docs_bzl/scenarios/nested_bundles/child", + "src_root": "src/tests/docs_bzl/scenarios/nested_bundles/child" + } + ] +} diff --git a/src/tests/docs_bzl/scenarios/nested_bundles/_expected/needs_json/needs.json b/src/tests/docs_bzl/scenarios/nested_bundles/_expected/needs_json/needs.json new file mode 100644 index 000000000..f214d4128 --- /dev/null +++ b/src/tests/docs_bzl/scenarios/nested_bundles/_expected/needs_json/needs.json @@ -0,0 +1,1420 @@ +{ + "current_version": "", + "project": "Mount contract fixture", + "project_url": "https://example.invalid/mount-contract", + "versions": { + "": { + "creator": { + "program": "sphinx_needs", + "version": "8.3.1" + }, + "needs": { + "tool_req__docs_bzl_nested_bundle": { + "content": "The ``parent`` bundle composes the ``child`` bundle and can be mounted into\na host documentation tree together with its generated data.", + "docname": "concepts/example_bundle/index", + "external_css": "external_link", + "id": "tool_req__docs_bzl_nested_bundle", + "lineno": 18, + "section_name": "Parent bundle", + "sections": [ + "Parent bundle" + ], + "source_code_link": "https://github.com/placeholder/placeholder/blob/unknown/src/tests/docs_bzl/scenarios/nested_bundles/child/example.py#L14<>src/tests/docs_bzl/scenarios/nested_bundles/child/example.py:14, https://github.com/placeholder/placeholder/blob/unknown/src/tests/docs_bzl/scenarios/nested_bundles/child/example.cc#L1<>src/tests/docs_bzl/scenarios/nested_bundles/child/example.cc:1, https://github.com/placeholder/placeholder/blob/unknown/src/tests/docs_bzl/scenarios/nested_bundles/child/filegroup_source.py#L14<>src/tests/docs_bzl/scenarios/nested_bundles/child/filegroup_source.py:14", + "title": "A nested bundle can be mounted into a documentation tree", + "type": "tool_req", + "type_name": "Tool Requirement", + "version": 1 + } + }, + "needs_amount": 1, + "needs_defaults_removed": true, + "needs_schema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "affects": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "affects_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "applies_to_module_version": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "approved_by": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "approved_by_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "approver": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "approvers": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "arch": { + "additionalProperties": { + "type": "string" + }, + "default": {}, + "description": "Mapping of uml key to uml content.", + "field_type": "core", + "type": "object" + }, + "author": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "avatar": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "belongs_to": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "belongs_to_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "branch_coverage_percent": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "closed_at": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "completion": { + "default": null, + "description": "Added for needgantt functionality", + "field_type": "extra", + "type": [ + "integer", + "null" + ] + }, + "complies": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "complies_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "consequences": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "consists_of": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "consists_of_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "constraints": { + "default": [], + "description": "List of constraint names, which are defined for this need.", + "field_type": "core", + "items": { + "type": "string" + }, + "type": "array" + }, + "constraints_error": { + "default": null, + "description": "An error message set if any constraint failed, and `error_message` field is set in config.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "constraints_passed": { + "default": true, + "description": "True if all constraints passed, False if any failed, None if not yet checked.", + "field_type": "core", + "type": [ + "boolean", + "null" + ] + }, + "constraints_results": { + "additionalProperties": { + "type": "object" + }, + "default": {}, + "description": "Mapping of constraint name, to check name, to result, None if not yet checked.", + "field_type": "core", + "type": [ + "object", + "null" + ] + }, + "contains": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "contains_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "content": { + "default": "", + "description": "The main content of the need.", + "field_type": "core", + "type": "string" + }, + "context": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "covers": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "covers_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "created_at": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "decision": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "derivation_technique": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "derived_from": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "derived_from_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "docname": { + "default": null, + "description": "Name of the document where the need is defined (None if external).", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "doctype": { + "default": ".rst", + "description": "The markup type of the content, denoted by the suffix of the source file, e.g. '.rst'.", + "field_type": "core", + "type": "string" + }, + "duration": { + "default": null, + "description": "Added for needgantt functionality", + "field_type": "extra", + "type": [ + "integer", + "null" + ] + }, + "evidence": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "evidence_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "external_css": { + "default": "", + "description": "CSS class name, added to the external reference.", + "field_type": "core", + "type": "string" + }, + "external_url": { + "default": null, + "description": "URL of the need, if it is an external need.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "failure_effect": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "failure_id": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "fault_id": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "file": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "fulfils": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "fulfils_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "fully_verifies": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "fully_verifies_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "has": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "has_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "has_dead_links": { + "default": false, + "description": "True if any links reference need ids that are not found in the need list.", + "field_type": "core", + "type": "boolean" + }, + "has_forbidden_dead_links": { + "default": false, + "description": "True if any links reference need ids that are not found in the need list, and the link type does not allow dead links.", + "field_type": "core", + "type": "boolean" + }, + "hash": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "id": { + "description": "ID of the data.", + "field_type": "core", + "type": "string" + }, + "id_prefix": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "implemented": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "implements": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "implements_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "included_by": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "included_by_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "includes": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "includes_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "input": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "input_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "is_external": { + "default": false, + "description": "If true, no node is created and need is referencing external url.", + "field_type": "core", + "type": "boolean" + }, + "is_import": { + "default": false, + "description": "If true, the need was derived from an import.", + "field_type": "core", + "type": "boolean" + }, + "is_modified": { + "default": false, + "description": "Whether the need was modified by needextend.", + "field_type": "core", + "type": "boolean" + }, + "jinja_content": { + "default": false, + "description": "Whether the content was pre-processed by jinja.", + "field_type": "core", + "type": "boolean" + }, + "language": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "layout": { + "default": null, + "description": "Key of the layout, which is used to render the need.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "line": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "line_coverage_percent": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "lineno": { + "default": null, + "description": "Line number where the need is defined (None if external).", + "field_type": "core", + "type": [ + "integer", + "null" + ] + }, + "links": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "links_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "max_amount": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "max_content_lines": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "mitigated_by": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "mitigated_by_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "mitigation_issue": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "modifications": { + "default": 0, + "description": "Number of modifications by needextend.", + "field_type": "core", + "type": "integer" + }, + "name": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "output": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "output_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "parent_covered": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "parent_has_problem": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "parent_need": { + "default": null, + "description": "Simply the first parent id.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "parent_needs": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "parent_needs_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "partially_verifies": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "partially_verifies_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "parts": { + "additionalProperties": { + "type": "object" + }, + "default": {}, + "description": "Mapping of parts, a.k.a. sub-needs, IDs to data that overrides the need's data", + "field_type": "core", + "type": "object" + }, + "post_content": { + "default": null, + "description": "Additional content after the need.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "post_template": { + "default": null, + "description": "The template key, if the post_content was created from a jinja template.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "pre_content": { + "default": null, + "description": "Additional content before the need.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "pre_template": { + "default": null, + "description": "The template key, if the pre_content was created from a jinja template.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "provides": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "provides_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "query": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "rationale": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "realizes": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "realizes_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "reqtype": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "requirements_tests_completely_passed_percent": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "responsible": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "responsible_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "result": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "result_text": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "reviewer": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "reviewers": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "root_cause": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "safety": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "safety_affected": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "safety_relevant": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "satisfied_by": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "satisfied_by_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "satisfies": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "satisfies_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "section_name": { + "default": null, + "description": "Simply the first section.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "sections": { + "default": [], + "description": "Sections of the need.", + "field_type": "core", + "items": { + "type": "string" + }, + "type": "array" + }, + "security": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "security_affected": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "service": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "signature": { + "default": null, + "description": "Derived from a docutils desc_name node.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "source_code_link": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "specific": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "status": { + "default": null, + "description": "Status of the need.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "style": { + "default": null, + "description": "Comma-separated list of CSS classes (all appended by `needs_style_`).", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "sufficient": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "supported_by": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "supported_by_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "tags": { + "default": [], + "description": "List of tags.", + "field_type": "core", + "items": { + "type": "string" + }, + "type": "array" + }, + "tcl": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "template": { + "default": null, + "description": "The template key, if the content was created from a jinja template.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "test_type": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "testcovered": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "testlink": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "threat_effect": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "threat_id": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "threat_scenario_id": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "title": { + "description": "Title of the need.", + "field_type": "core", + "type": "string" + }, + "tool_version": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "tracking": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "type": { + "default": "", + "description": "Type of the need.", + "field_type": "core", + "type": "string" + }, + "type_name": { + "default": "", + "description": "Name of the type.", + "field_type": "core", + "type": "string" + }, + "updated_at": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "url": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "user": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "uses": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "uses_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "valid_from": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "valid_until": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "verification_method": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "version": { + "default": 0, + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "integer", + "null" + ] + }, + "violates": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "violates_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + } + } + } +} diff --git a/src/tests/docs_bzl/scenarios/nested_bundles/_expected/ordered_aggregate_manifest.json b/src/tests/docs_bzl/scenarios/nested_bundles/_expected/ordered_aggregate_manifest.json new file mode 100644 index 000000000..16f46399c --- /dev/null +++ b/src/tests/docs_bzl/scenarios/nested_bundles/_expected/ordered_aggregate_manifest.json @@ -0,0 +1,26 @@ +{ + "mounts": [ + { + "attach_to": "index", + "data": [], + "entry_doc": "index", + "external": false, + "generated": false, + "mount_at": "first", + "repository": "", + "runtime_path": "src/tests/docs_bzl/scenarios/nested_bundles/other", + "src_root": "src/tests/docs_bzl/scenarios/nested_bundles/other" + }, + { + "attach_to": "index", + "data": [], + "entry_doc": "landing", + "external": false, + "generated": false, + "mount_at": "second", + "repository": "", + "runtime_path": "src/tests/docs_bzl/scenarios/nested_bundles/child", + "src_root": "src/tests/docs_bzl/scenarios/nested_bundles/child" + } + ] +} diff --git a/src/tests/docs_bzl/scenarios/nested_bundles/_expected/sourcelinks_json.json b/src/tests/docs_bzl/scenarios/nested_bundles/_expected/sourcelinks_json.json new file mode 100644 index 000000000..ca70bfa65 --- /dev/null +++ b/src/tests/docs_bzl/scenarios/nested_bundles/_expected/sourcelinks_json.json @@ -0,0 +1,32 @@ +[ + { + "file": "src/tests/docs_bzl/scenarios/nested_bundles/child/example.py", + "full_line": "# req-traceability: tool_req__docs_bzl_nested_bundle", + "hash": "", + "line": 14, + "need": "tool_req__docs_bzl_nested_bundle", + "repo_name": "local_repo", + "tag": "# req-traceability:", + "url": "" + }, + { + "file": "src/tests/docs_bzl/scenarios/nested_bundles/child/example.cc", + "full_line": "// req-traceability: tool_req__docs_bzl_nested_bundle", + "hash": "", + "line": 1, + "need": "tool_req__docs_bzl_nested_bundle", + "repo_name": "local_repo", + "tag": "// req-traceability:", + "url": "" + }, + { + "file": "src/tests/docs_bzl/scenarios/nested_bundles/child/filegroup_source.py", + "full_line": "# req-traceability: tool_req__docs_bzl_nested_bundle", + "hash": "", + "line": 14, + "need": "tool_req__docs_bzl_nested_bundle", + "repo_name": "local_repo", + "tag": "# req-traceability:", + "url": "" + } +] diff --git a/src/tests/docs_bzl/scenarios/reference_integration/_expected/needs_local.json b/src/tests/docs_bzl/scenarios/reference_integration/_expected/needs_local.json new file mode 100644 index 000000000..1a3ed00e2 --- /dev/null +++ b/src/tests/docs_bzl/scenarios/reference_integration/_expected/needs_local.json @@ -0,0 +1,1403 @@ +{ + "current_version": "0.0.0", + "project": "S-CORE Reference Integration", + "project_url": "", + "versions": { + "0.0.0": { + "creator": { + "program": "sphinx_needs", + "version": "8.3.1" + }, + "needs": {}, + "needs_amount": 0, + "needs_defaults_removed": true, + "needs_schema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "affects": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "affects_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "applies_to_module_version": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "approved_by": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "approved_by_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "approver": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "approvers": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "arch": { + "additionalProperties": { + "type": "string" + }, + "default": {}, + "description": "Mapping of uml key to uml content.", + "field_type": "core", + "type": "object" + }, + "author": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "avatar": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "belongs_to": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "belongs_to_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "branch_coverage_percent": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "closed_at": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "completion": { + "default": null, + "description": "Added for needgantt functionality", + "field_type": "extra", + "type": [ + "integer", + "null" + ] + }, + "complies": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "complies_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "consequences": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "consists_of": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "consists_of_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "constraints": { + "default": [], + "description": "List of constraint names, which are defined for this need.", + "field_type": "core", + "items": { + "type": "string" + }, + "type": "array" + }, + "constraints_error": { + "default": null, + "description": "An error message set if any constraint failed, and `error_message` field is set in config.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "constraints_passed": { + "default": true, + "description": "True if all constraints passed, False if any failed, None if not yet checked.", + "field_type": "core", + "type": [ + "boolean", + "null" + ] + }, + "constraints_results": { + "additionalProperties": { + "type": "object" + }, + "default": {}, + "description": "Mapping of constraint name, to check name, to result, None if not yet checked.", + "field_type": "core", + "type": [ + "object", + "null" + ] + }, + "contains": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "contains_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "content": { + "default": "", + "description": "The main content of the need.", + "field_type": "core", + "type": "string" + }, + "context": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "covers": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "covers_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "created_at": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "decision": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "derivation_technique": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "derived_from": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "derived_from_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "docname": { + "default": null, + "description": "Name of the document where the need is defined (None if external).", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "doctype": { + "default": ".rst", + "description": "The markup type of the content, denoted by the suffix of the source file, e.g. '.rst'.", + "field_type": "core", + "type": "string" + }, + "duration": { + "default": null, + "description": "Added for needgantt functionality", + "field_type": "extra", + "type": [ + "integer", + "null" + ] + }, + "evidence": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "evidence_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "external_css": { + "default": "", + "description": "CSS class name, added to the external reference.", + "field_type": "core", + "type": "string" + }, + "external_url": { + "default": null, + "description": "URL of the need, if it is an external need.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "failure_effect": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "failure_id": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "fault_id": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "file": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "fulfils": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "fulfils_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "fully_verifies": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "fully_verifies_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "has": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "has_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "has_dead_links": { + "default": false, + "description": "True if any links reference need ids that are not found in the need list.", + "field_type": "core", + "type": "boolean" + }, + "has_forbidden_dead_links": { + "default": false, + "description": "True if any links reference need ids that are not found in the need list, and the link type does not allow dead links.", + "field_type": "core", + "type": "boolean" + }, + "hash": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "id": { + "description": "ID of the data.", + "field_type": "core", + "type": "string" + }, + "id_prefix": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "implemented": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "implements": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "implements_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "included_by": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "included_by_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "includes": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "includes_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "input": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "input_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "is_external": { + "default": false, + "description": "If true, no node is created and need is referencing external url.", + "field_type": "core", + "type": "boolean" + }, + "is_import": { + "default": false, + "description": "If true, the need was derived from an import.", + "field_type": "core", + "type": "boolean" + }, + "is_modified": { + "default": false, + "description": "Whether the need was modified by needextend.", + "field_type": "core", + "type": "boolean" + }, + "jinja_content": { + "default": false, + "description": "Whether the content was pre-processed by jinja.", + "field_type": "core", + "type": "boolean" + }, + "language": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "layout": { + "default": null, + "description": "Key of the layout, which is used to render the need.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "line": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "line_coverage_percent": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "lineno": { + "default": null, + "description": "Line number where the need is defined (None if external).", + "field_type": "core", + "type": [ + "integer", + "null" + ] + }, + "links": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "links_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "max_amount": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "max_content_lines": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "mitigated_by": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "mitigated_by_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "mitigation_issue": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "modifications": { + "default": 0, + "description": "Number of modifications by needextend.", + "field_type": "core", + "type": "integer" + }, + "name": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "output": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "output_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "parent_covered": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "parent_has_problem": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "parent_need": { + "default": null, + "description": "Simply the first parent id.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "parent_needs": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "parent_needs_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "partially_verifies": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "partially_verifies_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "parts": { + "additionalProperties": { + "type": "object" + }, + "default": {}, + "description": "Mapping of parts, a.k.a. sub-needs, IDs to data that overrides the need's data", + "field_type": "core", + "type": "object" + }, + "post_content": { + "default": null, + "description": "Additional content after the need.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "post_template": { + "default": null, + "description": "The template key, if the post_content was created from a jinja template.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "pre_content": { + "default": null, + "description": "Additional content before the need.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "pre_template": { + "default": null, + "description": "The template key, if the pre_content was created from a jinja template.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "provides": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "provides_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "query": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "rationale": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "realizes": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "realizes_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "reqtype": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "requirements_tests_completely_passed_percent": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "responsible": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "responsible_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "result": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "result_text": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "reviewer": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "reviewers": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "root_cause": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "safety": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "safety_affected": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "safety_relevant": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "satisfied_by": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "satisfied_by_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "satisfies": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "satisfies_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "section_name": { + "default": null, + "description": "Simply the first section.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "sections": { + "default": [], + "description": "Sections of the need.", + "field_type": "core", + "items": { + "type": "string" + }, + "type": "array" + }, + "security": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "security_affected": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "service": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "signature": { + "default": null, + "description": "Derived from a docutils desc_name node.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "source_code_link": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "specific": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "status": { + "default": null, + "description": "Status of the need.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "style": { + "default": null, + "description": "Comma-separated list of CSS classes (all appended by `needs_style_`).", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "sufficient": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "supported_by": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "supported_by_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "tags": { + "default": [], + "description": "List of tags.", + "field_type": "core", + "items": { + "type": "string" + }, + "type": "array" + }, + "tcl": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "template": { + "default": null, + "description": "The template key, if the content was created from a jinja template.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "test_type": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "testcovered": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "testlink": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "threat_effect": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "threat_id": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "threat_scenario_id": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "title": { + "description": "Title of the need.", + "field_type": "core", + "type": "string" + }, + "tool_version": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "tracking": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "type": { + "default": "", + "description": "Type of the need.", + "field_type": "core", + "type": "string" + }, + "type_name": { + "default": "", + "description": "Name of the type.", + "field_type": "core", + "type": "string" + }, + "updated_at": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "url": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "user": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "uses": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "uses_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "valid_from": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "valid_until": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "verification_method": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "version": { + "default": 0, + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "integer", + "null" + ] + }, + "violates": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "violates_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + } + } + } +} diff --git a/src/tests/docs_bzl/scenarios/reference_integration/legacy_module/_expected/needs_json/needs.json b/src/tests/docs_bzl/scenarios/reference_integration/legacy_module/_expected/needs_json/needs.json new file mode 100644 index 000000000..3bc37bab0 --- /dev/null +++ b/src/tests/docs_bzl/scenarios/reference_integration/legacy_module/_expected/needs_json/needs.json @@ -0,0 +1,1420 @@ +{ + "current_version": "0.0.0", + "project": "S-CORE Legacy Module", + "project_url": "https://example.invalid/score-legacy-module", + "versions": { + "0.0.0": { + "creator": { + "program": "sphinx_needs", + "version": "8.3.1" + }, + "needs": { + "tool_req__legacy_component": { + "content": "The legacy component implementation is covered by the component source\ncode-link scan. The integration test checks that this link is preserved\nwhen the component is built through its module and by the full site.", + "docname": "components/component/index", + "external_css": "external_link", + "id": "tool_req__legacy_component", + "lineno": 21, + "section_name": "S-CORE Legacy Component", + "sections": [ + "S-CORE Legacy Component" + ], + "source_code_link": "https://github.com/placeholder/placeholder/blob/unknown/src/tests/docs_bzl/scenarios/reference_integration/legacy_module/docs/components/component/implementation.py#L14<>src/tests/docs_bzl/scenarios/reference_integration/legacy_module/docs/components/component/implementation.py:14", + "title": "Legacy component implementation is traceable", + "type": "tool_req", + "type_name": "Tool Requirement", + "version": 1 + } + }, + "needs_amount": 1, + "needs_defaults_removed": true, + "needs_schema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "affects": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "affects_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "applies_to_module_version": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "approved_by": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "approved_by_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "approver": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "approvers": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "arch": { + "additionalProperties": { + "type": "string" + }, + "default": {}, + "description": "Mapping of uml key to uml content.", + "field_type": "core", + "type": "object" + }, + "author": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "avatar": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "belongs_to": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "belongs_to_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "branch_coverage_percent": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "closed_at": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "completion": { + "default": null, + "description": "Added for needgantt functionality", + "field_type": "extra", + "type": [ + "integer", + "null" + ] + }, + "complies": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "complies_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "consequences": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "consists_of": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "consists_of_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "constraints": { + "default": [], + "description": "List of constraint names, which are defined for this need.", + "field_type": "core", + "items": { + "type": "string" + }, + "type": "array" + }, + "constraints_error": { + "default": null, + "description": "An error message set if any constraint failed, and `error_message` field is set in config.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "constraints_passed": { + "default": true, + "description": "True if all constraints passed, False if any failed, None if not yet checked.", + "field_type": "core", + "type": [ + "boolean", + "null" + ] + }, + "constraints_results": { + "additionalProperties": { + "type": "object" + }, + "default": {}, + "description": "Mapping of constraint name, to check name, to result, None if not yet checked.", + "field_type": "core", + "type": [ + "object", + "null" + ] + }, + "contains": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "contains_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "content": { + "default": "", + "description": "The main content of the need.", + "field_type": "core", + "type": "string" + }, + "context": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "covers": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "covers_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "created_at": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "decision": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "derivation_technique": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "derived_from": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "derived_from_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "docname": { + "default": null, + "description": "Name of the document where the need is defined (None if external).", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "doctype": { + "default": ".rst", + "description": "The markup type of the content, denoted by the suffix of the source file, e.g. '.rst'.", + "field_type": "core", + "type": "string" + }, + "duration": { + "default": null, + "description": "Added for needgantt functionality", + "field_type": "extra", + "type": [ + "integer", + "null" + ] + }, + "evidence": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "evidence_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "external_css": { + "default": "", + "description": "CSS class name, added to the external reference.", + "field_type": "core", + "type": "string" + }, + "external_url": { + "default": null, + "description": "URL of the need, if it is an external need.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "failure_effect": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "failure_id": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "fault_id": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "file": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "fulfils": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "fulfils_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "fully_verifies": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "fully_verifies_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "has": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "has_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "has_dead_links": { + "default": false, + "description": "True if any links reference need ids that are not found in the need list.", + "field_type": "core", + "type": "boolean" + }, + "has_forbidden_dead_links": { + "default": false, + "description": "True if any links reference need ids that are not found in the need list, and the link type does not allow dead links.", + "field_type": "core", + "type": "boolean" + }, + "hash": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "id": { + "description": "ID of the data.", + "field_type": "core", + "type": "string" + }, + "id_prefix": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "implemented": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "implements": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "implements_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "included_by": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "included_by_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "includes": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "includes_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "input": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "input_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "is_external": { + "default": false, + "description": "If true, no node is created and need is referencing external url.", + "field_type": "core", + "type": "boolean" + }, + "is_import": { + "default": false, + "description": "If true, the need was derived from an import.", + "field_type": "core", + "type": "boolean" + }, + "is_modified": { + "default": false, + "description": "Whether the need was modified by needextend.", + "field_type": "core", + "type": "boolean" + }, + "jinja_content": { + "default": false, + "description": "Whether the content was pre-processed by jinja.", + "field_type": "core", + "type": "boolean" + }, + "language": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "layout": { + "default": null, + "description": "Key of the layout, which is used to render the need.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "line": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "line_coverage_percent": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "lineno": { + "default": null, + "description": "Line number where the need is defined (None if external).", + "field_type": "core", + "type": [ + "integer", + "null" + ] + }, + "links": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "links_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "max_amount": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "max_content_lines": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "mitigated_by": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "mitigated_by_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "mitigation_issue": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "modifications": { + "default": 0, + "description": "Number of modifications by needextend.", + "field_type": "core", + "type": "integer" + }, + "name": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "output": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "output_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "parent_covered": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "parent_has_problem": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "parent_need": { + "default": null, + "description": "Simply the first parent id.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "parent_needs": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "parent_needs_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "partially_verifies": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "partially_verifies_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "parts": { + "additionalProperties": { + "type": "object" + }, + "default": {}, + "description": "Mapping of parts, a.k.a. sub-needs, IDs to data that overrides the need's data", + "field_type": "core", + "type": "object" + }, + "post_content": { + "default": null, + "description": "Additional content after the need.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "post_template": { + "default": null, + "description": "The template key, if the post_content was created from a jinja template.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "pre_content": { + "default": null, + "description": "Additional content before the need.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "pre_template": { + "default": null, + "description": "The template key, if the pre_content was created from a jinja template.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "provides": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "provides_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "query": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "rationale": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "realizes": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "realizes_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "reqtype": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "requirements_tests_completely_passed_percent": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "responsible": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "responsible_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "result": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "result_text": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "reviewer": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "reviewers": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "root_cause": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "safety": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "safety_affected": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "safety_relevant": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "satisfied_by": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "satisfied_by_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "satisfies": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "satisfies_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "section_name": { + "default": null, + "description": "Simply the first section.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "sections": { + "default": [], + "description": "Sections of the need.", + "field_type": "core", + "items": { + "type": "string" + }, + "type": "array" + }, + "security": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "security_affected": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "service": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "signature": { + "default": null, + "description": "Derived from a docutils desc_name node.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "source_code_link": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "specific": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "status": { + "default": null, + "description": "Status of the need.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "style": { + "default": null, + "description": "Comma-separated list of CSS classes (all appended by `needs_style_`).", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "sufficient": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "supported_by": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "supported_by_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "tags": { + "default": [], + "description": "List of tags.", + "field_type": "core", + "items": { + "type": "string" + }, + "type": "array" + }, + "tcl": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "template": { + "default": null, + "description": "The template key, if the content was created from a jinja template.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "test_type": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "testcovered": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "testlink": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "threat_effect": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "threat_id": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "threat_scenario_id": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "title": { + "description": "Title of the need.", + "field_type": "core", + "type": "string" + }, + "tool_version": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "tracking": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "type": { + "default": "", + "description": "Type of the need.", + "field_type": "core", + "type": "string" + }, + "type_name": { + "default": "", + "description": "Name of the type.", + "field_type": "core", + "type": "string" + }, + "updated_at": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "url": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "user": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "uses": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "uses_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "valid_from": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "valid_until": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "verification_method": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "version": { + "default": 0, + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "integer", + "null" + ] + }, + "violates": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "violates_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + } + } + } +} diff --git a/src/tests/docs_bzl/scenarios/reference_integration/legacy_module/docs/components/component/_expected/needs_local.json b/src/tests/docs_bzl/scenarios/reference_integration/legacy_module/docs/components/component/_expected/needs_local.json new file mode 100644 index 000000000..16ea98a94 --- /dev/null +++ b/src/tests/docs_bzl/scenarios/reference_integration/legacy_module/docs/components/component/_expected/needs_local.json @@ -0,0 +1,1420 @@ +{ + "current_version": "0.0.0", + "project": "docs_bundle", + "project_url": "", + "versions": { + "0.0.0": { + "creator": { + "program": "sphinx_needs", + "version": "8.3.1" + }, + "needs": { + "tool_req__legacy_component": { + "content": "The legacy component implementation is covered by the component source\ncode-link scan. The integration test checks that this link is preserved\nwhen the component is built through its module and by the full site.", + "docname": "index", + "external_css": "external_link", + "id": "tool_req__legacy_component", + "lineno": 21, + "section_name": "S-CORE Legacy Component", + "sections": [ + "S-CORE Legacy Component" + ], + "source_code_link": "https://github.com/placeholder/placeholder/blob/unknown/src/tests/docs_bzl/scenarios/reference_integration/legacy_module/docs/components/component/implementation.py#L14<>src/tests/docs_bzl/scenarios/reference_integration/legacy_module/docs/components/component/implementation.py:14", + "title": "Legacy component implementation is traceable", + "type": "tool_req", + "type_name": "Tool Requirement", + "version": 1 + } + }, + "needs_amount": 1, + "needs_defaults_removed": true, + "needs_schema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "affects": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "affects_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "applies_to_module_version": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "approved_by": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "approved_by_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "approver": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "approvers": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "arch": { + "additionalProperties": { + "type": "string" + }, + "default": {}, + "description": "Mapping of uml key to uml content.", + "field_type": "core", + "type": "object" + }, + "author": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "avatar": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "belongs_to": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "belongs_to_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "branch_coverage_percent": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "closed_at": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "completion": { + "default": null, + "description": "Added for needgantt functionality", + "field_type": "extra", + "type": [ + "integer", + "null" + ] + }, + "complies": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "complies_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "consequences": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "consists_of": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "consists_of_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "constraints": { + "default": [], + "description": "List of constraint names, which are defined for this need.", + "field_type": "core", + "items": { + "type": "string" + }, + "type": "array" + }, + "constraints_error": { + "default": null, + "description": "An error message set if any constraint failed, and `error_message` field is set in config.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "constraints_passed": { + "default": true, + "description": "True if all constraints passed, False if any failed, None if not yet checked.", + "field_type": "core", + "type": [ + "boolean", + "null" + ] + }, + "constraints_results": { + "additionalProperties": { + "type": "object" + }, + "default": {}, + "description": "Mapping of constraint name, to check name, to result, None if not yet checked.", + "field_type": "core", + "type": [ + "object", + "null" + ] + }, + "contains": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "contains_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "content": { + "default": "", + "description": "The main content of the need.", + "field_type": "core", + "type": "string" + }, + "context": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "covers": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "covers_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "created_at": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "decision": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "derivation_technique": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "derived_from": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "derived_from_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "docname": { + "default": null, + "description": "Name of the document where the need is defined (None if external).", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "doctype": { + "default": ".rst", + "description": "The markup type of the content, denoted by the suffix of the source file, e.g. '.rst'.", + "field_type": "core", + "type": "string" + }, + "duration": { + "default": null, + "description": "Added for needgantt functionality", + "field_type": "extra", + "type": [ + "integer", + "null" + ] + }, + "evidence": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "evidence_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "external_css": { + "default": "", + "description": "CSS class name, added to the external reference.", + "field_type": "core", + "type": "string" + }, + "external_url": { + "default": null, + "description": "URL of the need, if it is an external need.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "failure_effect": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "failure_id": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "fault_id": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "file": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "fulfils": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "fulfils_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "fully_verifies": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "fully_verifies_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "has": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "has_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "has_dead_links": { + "default": false, + "description": "True if any links reference need ids that are not found in the need list.", + "field_type": "core", + "type": "boolean" + }, + "has_forbidden_dead_links": { + "default": false, + "description": "True if any links reference need ids that are not found in the need list, and the link type does not allow dead links.", + "field_type": "core", + "type": "boolean" + }, + "hash": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "id": { + "description": "ID of the data.", + "field_type": "core", + "type": "string" + }, + "id_prefix": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "implemented": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "implements": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "implements_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "included_by": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "included_by_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "includes": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "includes_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "input": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "input_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "is_external": { + "default": false, + "description": "If true, no node is created and need is referencing external url.", + "field_type": "core", + "type": "boolean" + }, + "is_import": { + "default": false, + "description": "If true, the need was derived from an import.", + "field_type": "core", + "type": "boolean" + }, + "is_modified": { + "default": false, + "description": "Whether the need was modified by needextend.", + "field_type": "core", + "type": "boolean" + }, + "jinja_content": { + "default": false, + "description": "Whether the content was pre-processed by jinja.", + "field_type": "core", + "type": "boolean" + }, + "language": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "layout": { + "default": null, + "description": "Key of the layout, which is used to render the need.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "line": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "line_coverage_percent": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "lineno": { + "default": null, + "description": "Line number where the need is defined (None if external).", + "field_type": "core", + "type": [ + "integer", + "null" + ] + }, + "links": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "links_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "max_amount": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "max_content_lines": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "mitigated_by": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "mitigated_by_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "mitigation_issue": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "modifications": { + "default": 0, + "description": "Number of modifications by needextend.", + "field_type": "core", + "type": "integer" + }, + "name": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "output": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "output_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "parent_covered": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "parent_has_problem": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "parent_need": { + "default": null, + "description": "Simply the first parent id.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "parent_needs": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "parent_needs_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "partially_verifies": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "partially_verifies_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "parts": { + "additionalProperties": { + "type": "object" + }, + "default": {}, + "description": "Mapping of parts, a.k.a. sub-needs, IDs to data that overrides the need's data", + "field_type": "core", + "type": "object" + }, + "post_content": { + "default": null, + "description": "Additional content after the need.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "post_template": { + "default": null, + "description": "The template key, if the post_content was created from a jinja template.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "pre_content": { + "default": null, + "description": "Additional content before the need.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "pre_template": { + "default": null, + "description": "The template key, if the pre_content was created from a jinja template.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "provides": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "provides_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "query": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "rationale": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "realizes": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "realizes_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "reqtype": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "requirements_tests_completely_passed_percent": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "responsible": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "responsible_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "result": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "result_text": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "reviewer": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "reviewers": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "root_cause": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "safety": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "safety_affected": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "safety_relevant": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "satisfied_by": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "satisfied_by_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "satisfies": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "satisfies_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "section_name": { + "default": null, + "description": "Simply the first section.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "sections": { + "default": [], + "description": "Sections of the need.", + "field_type": "core", + "items": { + "type": "string" + }, + "type": "array" + }, + "security": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "security_affected": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "service": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "signature": { + "default": null, + "description": "Derived from a docutils desc_name node.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "source_code_link": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "specific": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "status": { + "default": null, + "description": "Status of the need.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "style": { + "default": null, + "description": "Comma-separated list of CSS classes (all appended by `needs_style_`).", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "sufficient": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "supported_by": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "supported_by_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "tags": { + "default": [], + "description": "List of tags.", + "field_type": "core", + "items": { + "type": "string" + }, + "type": "array" + }, + "tcl": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "template": { + "default": null, + "description": "The template key, if the content was created from a jinja template.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "test_type": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "testcovered": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "testlink": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "threat_effect": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "threat_id": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "threat_scenario_id": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "title": { + "description": "Title of the need.", + "field_type": "core", + "type": "string" + }, + "tool_version": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "tracking": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "type": { + "default": "", + "description": "Type of the need.", + "field_type": "core", + "type": "string" + }, + "type_name": { + "default": "", + "description": "Name of the type.", + "field_type": "core", + "type": "string" + }, + "updated_at": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "url": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "user": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "uses": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "uses_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "valid_from": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "valid_until": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "verification_method": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "version": { + "default": 0, + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "integer", + "null" + ] + }, + "violates": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "violates_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + } + } + } +} diff --git a/src/tests/docs_bzl/scenarios/reference_integration/modern_module/_expected/needs_json/needs.json b/src/tests/docs_bzl/scenarios/reference_integration/modern_module/_expected/needs_json/needs.json new file mode 100644 index 000000000..43eabf09e --- /dev/null +++ b/src/tests/docs_bzl/scenarios/reference_integration/modern_module/_expected/needs_json/needs.json @@ -0,0 +1,1503 @@ +{ + "current_version": "0.0.0", + "project": "S-CORE Modern Module", + "project_url": "https://example.invalid/score-modern-module", + "versions": { + "0.0.0": { + "creator": { + "program": "sphinx_needs", + "version": "8.3.1" + }, + "needs": { + "comp__modern_component": { + "belongs_to": [ + "feat__modern_component" + ], + "docname": "components/component/index", + "external_css": "external_link", + "id": "comp__modern_component", + "lineno": 29, + "safety": "QM", + "satisfied_by_back": [ + "comp_req__modern_component__platform_feature" + ], + "section_name": "S-CORE Modern Component", + "sections": [ + "S-CORE Modern Component" + ], + "security": "NO", + "status": "valid", + "title": "Modern linked component", + "type": "comp", + "type_name": "Component", + "version": 1 + }, + "comp_req__modern_component__platform_feature": { + "content": "The modern component requires the platform feature made available by its\nparent module.", + "derived_from": [ + "feat_req__platform__feature" + ], + "docname": "components/component/index", + "external_css": "external_link", + "id": "comp_req__modern_component__platform_feature", + "lineno": 37, + "reqtype": "Functional", + "safety": "QM", + "satisfied_by": [ + "comp__modern_component" + ], + "section_name": "S-CORE Modern Component", + "sections": [ + "S-CORE Modern Component" + ], + "security": "NO", + "status": "valid", + "title": "Modern component platform requirement", + "type": "comp_req", + "type_name": "Component Requirement", + "version": 1 + }, + "feat__modern_component": { + "belongs_to_back": [ + "comp__modern_component" + ], + "docname": "components/component/index", + "external_css": "external_link", + "id": "feat__modern_component", + "lineno": 22, + "safety": "QM", + "section_name": "S-CORE Modern Component", + "sections": [ + "S-CORE Modern Component" + ], + "security": "NO", + "status": "valid", + "title": "Modern component feature", + "type": "feat", + "type_name": "Feature", + "version": 1 + }, + "tool_req__modern_component": { + "content": "The modern component implementation is covered by the component source\ncode-link scan. The linked component requirement above depends on the\nplatform feature requirement. The integration test checks that the\ncomponent can be built through its module, where that requirement is\navailable, but not as a standalone bundle.", + "docname": "components/component/index", + "external_css": "external_link", + "id": "tool_req__modern_component", + "lineno": 50, + "section_name": "S-CORE Modern Component", + "sections": [ + "S-CORE Modern Component" + ], + "source_code_link": "https://github.com/placeholder/placeholder/blob/unknown/src/tests/docs_bzl/scenarios/reference_integration/modern_module/docs/components/component/implementation.py#L17<>src/tests/docs_bzl/scenarios/reference_integration/modern_module/docs/components/component/implementation.py:17", + "title": "Modern component implementation is traceable", + "type": "tool_req", + "type_name": "Tool Requirement", + "version": 1 + }, + "tool_req__modern_unlinked_component": { + "content": "This requirement is intentionally not linked to the platform feature\nrequirement. It verifies the independent-component control case.", + "docname": "components/unlinked_component/index", + "external_css": "external_link", + "id": "tool_req__modern_unlinked_component", + "lineno": 22, + "section_name": "S-CORE Modern Unlinked Component", + "sections": [ + "S-CORE Modern Unlinked Component" + ], + "title": "Modern unlinked component is self-contained", + "type": "tool_req", + "type_name": "Tool Requirement", + "version": 1 + } + }, + "needs_amount": 5, + "needs_defaults_removed": true, + "needs_schema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "affects": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "affects_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "applies_to_module_version": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "approved_by": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "approved_by_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "approver": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "approvers": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "arch": { + "additionalProperties": { + "type": "string" + }, + "default": {}, + "description": "Mapping of uml key to uml content.", + "field_type": "core", + "type": "object" + }, + "author": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "avatar": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "belongs_to": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "belongs_to_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "branch_coverage_percent": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "closed_at": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "completion": { + "default": null, + "description": "Added for needgantt functionality", + "field_type": "extra", + "type": [ + "integer", + "null" + ] + }, + "complies": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "complies_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "consequences": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "consists_of": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "consists_of_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "constraints": { + "default": [], + "description": "List of constraint names, which are defined for this need.", + "field_type": "core", + "items": { + "type": "string" + }, + "type": "array" + }, + "constraints_error": { + "default": null, + "description": "An error message set if any constraint failed, and `error_message` field is set in config.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "constraints_passed": { + "default": true, + "description": "True if all constraints passed, False if any failed, None if not yet checked.", + "field_type": "core", + "type": [ + "boolean", + "null" + ] + }, + "constraints_results": { + "additionalProperties": { + "type": "object" + }, + "default": {}, + "description": "Mapping of constraint name, to check name, to result, None if not yet checked.", + "field_type": "core", + "type": [ + "object", + "null" + ] + }, + "contains": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "contains_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "content": { + "default": "", + "description": "The main content of the need.", + "field_type": "core", + "type": "string" + }, + "context": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "covers": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "covers_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "created_at": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "decision": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "derivation_technique": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "derived_from": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "derived_from_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "docname": { + "default": null, + "description": "Name of the document where the need is defined (None if external).", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "doctype": { + "default": ".rst", + "description": "The markup type of the content, denoted by the suffix of the source file, e.g. '.rst'.", + "field_type": "core", + "type": "string" + }, + "duration": { + "default": null, + "description": "Added for needgantt functionality", + "field_type": "extra", + "type": [ + "integer", + "null" + ] + }, + "evidence": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "evidence_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "external_css": { + "default": "", + "description": "CSS class name, added to the external reference.", + "field_type": "core", + "type": "string" + }, + "external_url": { + "default": null, + "description": "URL of the need, if it is an external need.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "failure_effect": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "failure_id": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "fault_id": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "file": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "fulfils": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "fulfils_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "fully_verifies": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "fully_verifies_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "has": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "has_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "has_dead_links": { + "default": false, + "description": "True if any links reference need ids that are not found in the need list.", + "field_type": "core", + "type": "boolean" + }, + "has_forbidden_dead_links": { + "default": false, + "description": "True if any links reference need ids that are not found in the need list, and the link type does not allow dead links.", + "field_type": "core", + "type": "boolean" + }, + "hash": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "id": { + "description": "ID of the data.", + "field_type": "core", + "type": "string" + }, + "id_prefix": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "implemented": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "implements": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "implements_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "included_by": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "included_by_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "includes": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "includes_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "input": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "input_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "is_external": { + "default": false, + "description": "If true, no node is created and need is referencing external url.", + "field_type": "core", + "type": "boolean" + }, + "is_import": { + "default": false, + "description": "If true, the need was derived from an import.", + "field_type": "core", + "type": "boolean" + }, + "is_modified": { + "default": false, + "description": "Whether the need was modified by needextend.", + "field_type": "core", + "type": "boolean" + }, + "jinja_content": { + "default": false, + "description": "Whether the content was pre-processed by jinja.", + "field_type": "core", + "type": "boolean" + }, + "language": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "layout": { + "default": null, + "description": "Key of the layout, which is used to render the need.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "line": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "line_coverage_percent": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "lineno": { + "default": null, + "description": "Line number where the need is defined (None if external).", + "field_type": "core", + "type": [ + "integer", + "null" + ] + }, + "links": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "links_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "max_amount": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "max_content_lines": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "mitigated_by": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "mitigated_by_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "mitigation_issue": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "modifications": { + "default": 0, + "description": "Number of modifications by needextend.", + "field_type": "core", + "type": "integer" + }, + "name": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "output": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "output_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "parent_covered": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "parent_has_problem": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "parent_need": { + "default": null, + "description": "Simply the first parent id.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "parent_needs": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "parent_needs_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "partially_verifies": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "partially_verifies_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "parts": { + "additionalProperties": { + "type": "object" + }, + "default": {}, + "description": "Mapping of parts, a.k.a. sub-needs, IDs to data that overrides the need's data", + "field_type": "core", + "type": "object" + }, + "post_content": { + "default": null, + "description": "Additional content after the need.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "post_template": { + "default": null, + "description": "The template key, if the post_content was created from a jinja template.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "pre_content": { + "default": null, + "description": "Additional content before the need.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "pre_template": { + "default": null, + "description": "The template key, if the pre_content was created from a jinja template.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "provides": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "provides_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "query": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "rationale": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "realizes": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "realizes_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "reqtype": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "requirements_tests_completely_passed_percent": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "responsible": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "responsible_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "result": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "result_text": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "reviewer": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "reviewers": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "root_cause": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "safety": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "safety_affected": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "safety_relevant": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "satisfied_by": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "satisfied_by_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "satisfies": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "satisfies_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "section_name": { + "default": null, + "description": "Simply the first section.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "sections": { + "default": [], + "description": "Sections of the need.", + "field_type": "core", + "items": { + "type": "string" + }, + "type": "array" + }, + "security": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "security_affected": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "service": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "signature": { + "default": null, + "description": "Derived from a docutils desc_name node.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "source_code_link": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "specific": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "status": { + "default": null, + "description": "Status of the need.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "style": { + "default": null, + "description": "Comma-separated list of CSS classes (all appended by `needs_style_`).", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "sufficient": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "supported_by": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "supported_by_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "tags": { + "default": [], + "description": "List of tags.", + "field_type": "core", + "items": { + "type": "string" + }, + "type": "array" + }, + "tcl": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "template": { + "default": null, + "description": "The template key, if the content was created from a jinja template.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "test_type": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "testcovered": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "testlink": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "threat_effect": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "threat_id": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "threat_scenario_id": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "title": { + "description": "Title of the need.", + "field_type": "core", + "type": "string" + }, + "tool_version": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "tracking": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "type": { + "default": "", + "description": "Type of the need.", + "field_type": "core", + "type": "string" + }, + "type_name": { + "default": "", + "description": "Name of the type.", + "field_type": "core", + "type": "string" + }, + "updated_at": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "url": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "user": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "uses": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "uses_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "valid_from": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "valid_until": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "verification_method": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "version": { + "default": 0, + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "integer", + "null" + ] + }, + "violates": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "violates_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + } + } + } +} diff --git a/src/tests/docs_bzl/scenarios/reference_integration/modern_module/docs/components/unlinked_component/_expected/needs_local.json b/src/tests/docs_bzl/scenarios/reference_integration/modern_module/docs/components/unlinked_component/_expected/needs_local.json new file mode 100644 index 000000000..8bdb206d2 --- /dev/null +++ b/src/tests/docs_bzl/scenarios/reference_integration/modern_module/docs/components/unlinked_component/_expected/needs_local.json @@ -0,0 +1,1419 @@ +{ + "current_version": "0.0.0", + "project": "docs_bundle", + "project_url": "", + "versions": { + "0.0.0": { + "creator": { + "program": "sphinx_needs", + "version": "8.3.1" + }, + "needs": { + "tool_req__modern_unlinked_component": { + "content": "This requirement is intentionally not linked to the platform feature\nrequirement. It verifies the independent-component control case.", + "docname": "index", + "external_css": "external_link", + "id": "tool_req__modern_unlinked_component", + "lineno": 22, + "section_name": "S-CORE Modern Unlinked Component", + "sections": [ + "S-CORE Modern Unlinked Component" + ], + "title": "Modern unlinked component is self-contained", + "type": "tool_req", + "type_name": "Tool Requirement", + "version": 1 + } + }, + "needs_amount": 1, + "needs_defaults_removed": true, + "needs_schema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "affects": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "affects_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "applies_to_module_version": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "approved_by": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "approved_by_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "approver": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "approvers": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "arch": { + "additionalProperties": { + "type": "string" + }, + "default": {}, + "description": "Mapping of uml key to uml content.", + "field_type": "core", + "type": "object" + }, + "author": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "avatar": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "belongs_to": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "belongs_to_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "branch_coverage_percent": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "closed_at": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "completion": { + "default": null, + "description": "Added for needgantt functionality", + "field_type": "extra", + "type": [ + "integer", + "null" + ] + }, + "complies": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "complies_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "consequences": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "consists_of": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "consists_of_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "constraints": { + "default": [], + "description": "List of constraint names, which are defined for this need.", + "field_type": "core", + "items": { + "type": "string" + }, + "type": "array" + }, + "constraints_error": { + "default": null, + "description": "An error message set if any constraint failed, and `error_message` field is set in config.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "constraints_passed": { + "default": true, + "description": "True if all constraints passed, False if any failed, None if not yet checked.", + "field_type": "core", + "type": [ + "boolean", + "null" + ] + }, + "constraints_results": { + "additionalProperties": { + "type": "object" + }, + "default": {}, + "description": "Mapping of constraint name, to check name, to result, None if not yet checked.", + "field_type": "core", + "type": [ + "object", + "null" + ] + }, + "contains": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "contains_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "content": { + "default": "", + "description": "The main content of the need.", + "field_type": "core", + "type": "string" + }, + "context": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "covers": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "covers_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "created_at": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "decision": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "derivation_technique": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "derived_from": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "derived_from_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "docname": { + "default": null, + "description": "Name of the document where the need is defined (None if external).", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "doctype": { + "default": ".rst", + "description": "The markup type of the content, denoted by the suffix of the source file, e.g. '.rst'.", + "field_type": "core", + "type": "string" + }, + "duration": { + "default": null, + "description": "Added for needgantt functionality", + "field_type": "extra", + "type": [ + "integer", + "null" + ] + }, + "evidence": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "evidence_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "external_css": { + "default": "", + "description": "CSS class name, added to the external reference.", + "field_type": "core", + "type": "string" + }, + "external_url": { + "default": null, + "description": "URL of the need, if it is an external need.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "failure_effect": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "failure_id": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "fault_id": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "file": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "fulfils": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "fulfils_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "fully_verifies": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "fully_verifies_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "has": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "has_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "has_dead_links": { + "default": false, + "description": "True if any links reference need ids that are not found in the need list.", + "field_type": "core", + "type": "boolean" + }, + "has_forbidden_dead_links": { + "default": false, + "description": "True if any links reference need ids that are not found in the need list, and the link type does not allow dead links.", + "field_type": "core", + "type": "boolean" + }, + "hash": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "id": { + "description": "ID of the data.", + "field_type": "core", + "type": "string" + }, + "id_prefix": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "implemented": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "implements": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "implements_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "included_by": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "included_by_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "includes": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "includes_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "input": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "input_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "is_external": { + "default": false, + "description": "If true, no node is created and need is referencing external url.", + "field_type": "core", + "type": "boolean" + }, + "is_import": { + "default": false, + "description": "If true, the need was derived from an import.", + "field_type": "core", + "type": "boolean" + }, + "is_modified": { + "default": false, + "description": "Whether the need was modified by needextend.", + "field_type": "core", + "type": "boolean" + }, + "jinja_content": { + "default": false, + "description": "Whether the content was pre-processed by jinja.", + "field_type": "core", + "type": "boolean" + }, + "language": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "layout": { + "default": null, + "description": "Key of the layout, which is used to render the need.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "line": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "line_coverage_percent": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "lineno": { + "default": null, + "description": "Line number where the need is defined (None if external).", + "field_type": "core", + "type": [ + "integer", + "null" + ] + }, + "links": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "links_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "max_amount": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "max_content_lines": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "mitigated_by": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "mitigated_by_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "mitigation_issue": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "modifications": { + "default": 0, + "description": "Number of modifications by needextend.", + "field_type": "core", + "type": "integer" + }, + "name": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "output": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "output_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "parent_covered": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "parent_has_problem": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "parent_need": { + "default": null, + "description": "Simply the first parent id.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "parent_needs": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "parent_needs_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "partially_verifies": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "partially_verifies_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "parts": { + "additionalProperties": { + "type": "object" + }, + "default": {}, + "description": "Mapping of parts, a.k.a. sub-needs, IDs to data that overrides the need's data", + "field_type": "core", + "type": "object" + }, + "post_content": { + "default": null, + "description": "Additional content after the need.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "post_template": { + "default": null, + "description": "The template key, if the post_content was created from a jinja template.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "pre_content": { + "default": null, + "description": "Additional content before the need.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "pre_template": { + "default": null, + "description": "The template key, if the pre_content was created from a jinja template.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "provides": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "provides_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "query": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "rationale": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "realizes": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "realizes_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "reqtype": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "requirements_tests_completely_passed_percent": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "responsible": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "responsible_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "result": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "result_text": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "reviewer": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "reviewers": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "root_cause": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "safety": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "safety_affected": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "safety_relevant": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "satisfied_by": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "satisfied_by_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "satisfies": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "satisfies_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "section_name": { + "default": null, + "description": "Simply the first section.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "sections": { + "default": [], + "description": "Sections of the need.", + "field_type": "core", + "items": { + "type": "string" + }, + "type": "array" + }, + "security": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "security_affected": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "service": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "signature": { + "default": null, + "description": "Derived from a docutils desc_name node.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "source_code_link": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "specific": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "status": { + "default": null, + "description": "Status of the need.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "style": { + "default": null, + "description": "Comma-separated list of CSS classes (all appended by `needs_style_`).", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "sufficient": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "supported_by": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "supported_by_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "tags": { + "default": [], + "description": "List of tags.", + "field_type": "core", + "items": { + "type": "string" + }, + "type": "array" + }, + "tcl": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "template": { + "default": null, + "description": "The template key, if the content was created from a jinja template.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "test_type": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "testcovered": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "testlink": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "threat_effect": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "threat_id": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "threat_scenario_id": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "title": { + "description": "Title of the need.", + "field_type": "core", + "type": "string" + }, + "tool_version": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "tracking": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "type": { + "default": "", + "description": "Type of the need.", + "field_type": "core", + "type": "string" + }, + "type_name": { + "default": "", + "description": "Name of the type.", + "field_type": "core", + "type": "string" + }, + "updated_at": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "url": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "user": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "uses": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "uses_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "valid_from": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "valid_until": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "verification_method": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "version": { + "default": 0, + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "integer", + "null" + ] + }, + "violates": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "violates_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + } + } + } +} diff --git a/src/tests/docs_bzl/scenarios/reference_integration/score_platform/_expected/needs_json/needs.json b/src/tests/docs_bzl/scenarios/reference_integration/score_platform/_expected/needs_json/needs.json new file mode 100644 index 000000000..fb4ecca51 --- /dev/null +++ b/src/tests/docs_bzl/scenarios/reference_integration/score_platform/_expected/needs_json/needs.json @@ -0,0 +1,1447 @@ +{ + "current_version": "0.0.0", + "project": "S-CORE Platform", + "project_url": "https://example.invalid/score-platform", + "versions": { + "0.0.0": { + "creator": { + "program": "sphinx_needs", + "version": "8.3.1" + }, + "needs": { + "feat__platform_feature": { + "docname": "platform/feature", + "external_css": "external_link", + "id": "feat__platform_feature", + "lineno": 30, + "safety": "QM", + "satisfied_by_back": [ + "feat_req__platform__feature" + ], + "section_name": "Feature Requirements", + "sections": [ + "Feature Requirements" + ], + "security": "NO", + "status": "valid", + "title": "Platform feature", + "type": "feat", + "type_name": "Feature", + "version": 1 + }, + "feat_req__platform__feature": { + "content": "The platform provides the feature required by integrated modules.", + "docname": "platform/feature", + "external_css": "external_link", + "id": "feat_req__platform__feature", + "lineno": 18, + "reqtype": "Functional", + "safety": "QM", + "satisfied_by": [ + "feat__platform_feature" + ], + "section_name": "Feature Requirements", + "sections": [ + "Feature Requirements" + ], + "security": "NO", + "status": "valid", + "title": "Platform feature requirement", + "type": "feat_req", + "type_name": "Feature Requirement", + "valid_from": "v1.0.0", + "version": 1 + } + }, + "needs_amount": 2, + "needs_defaults_removed": true, + "needs_schema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "affects": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "affects_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "applies_to_module_version": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "approved_by": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "approved_by_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "approver": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "approvers": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "arch": { + "additionalProperties": { + "type": "string" + }, + "default": {}, + "description": "Mapping of uml key to uml content.", + "field_type": "core", + "type": "object" + }, + "author": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "avatar": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "belongs_to": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "belongs_to_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "branch_coverage_percent": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "closed_at": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "completion": { + "default": null, + "description": "Added for needgantt functionality", + "field_type": "extra", + "type": [ + "integer", + "null" + ] + }, + "complies": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "complies_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "consequences": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "consists_of": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "consists_of_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "constraints": { + "default": [], + "description": "List of constraint names, which are defined for this need.", + "field_type": "core", + "items": { + "type": "string" + }, + "type": "array" + }, + "constraints_error": { + "default": null, + "description": "An error message set if any constraint failed, and `error_message` field is set in config.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "constraints_passed": { + "default": true, + "description": "True if all constraints passed, False if any failed, None if not yet checked.", + "field_type": "core", + "type": [ + "boolean", + "null" + ] + }, + "constraints_results": { + "additionalProperties": { + "type": "object" + }, + "default": {}, + "description": "Mapping of constraint name, to check name, to result, None if not yet checked.", + "field_type": "core", + "type": [ + "object", + "null" + ] + }, + "contains": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "contains_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "content": { + "default": "", + "description": "The main content of the need.", + "field_type": "core", + "type": "string" + }, + "context": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "covers": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "covers_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "created_at": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "decision": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "derivation_technique": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "derived_from": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "derived_from_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "docname": { + "default": null, + "description": "Name of the document where the need is defined (None if external).", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "doctype": { + "default": ".rst", + "description": "The markup type of the content, denoted by the suffix of the source file, e.g. '.rst'.", + "field_type": "core", + "type": "string" + }, + "duration": { + "default": null, + "description": "Added for needgantt functionality", + "field_type": "extra", + "type": [ + "integer", + "null" + ] + }, + "evidence": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "evidence_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "external_css": { + "default": "", + "description": "CSS class name, added to the external reference.", + "field_type": "core", + "type": "string" + }, + "external_url": { + "default": null, + "description": "URL of the need, if it is an external need.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "failure_effect": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "failure_id": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "fault_id": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "file": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "fulfils": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "fulfils_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "fully_verifies": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "fully_verifies_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "has": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "has_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "has_dead_links": { + "default": false, + "description": "True if any links reference need ids that are not found in the need list.", + "field_type": "core", + "type": "boolean" + }, + "has_forbidden_dead_links": { + "default": false, + "description": "True if any links reference need ids that are not found in the need list, and the link type does not allow dead links.", + "field_type": "core", + "type": "boolean" + }, + "hash": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "id": { + "description": "ID of the data.", + "field_type": "core", + "type": "string" + }, + "id_prefix": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "implemented": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "implements": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "implements_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "included_by": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "included_by_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "includes": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "includes_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "input": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "input_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "is_external": { + "default": false, + "description": "If true, no node is created and need is referencing external url.", + "field_type": "core", + "type": "boolean" + }, + "is_import": { + "default": false, + "description": "If true, the need was derived from an import.", + "field_type": "core", + "type": "boolean" + }, + "is_modified": { + "default": false, + "description": "Whether the need was modified by needextend.", + "field_type": "core", + "type": "boolean" + }, + "jinja_content": { + "default": false, + "description": "Whether the content was pre-processed by jinja.", + "field_type": "core", + "type": "boolean" + }, + "language": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "layout": { + "default": null, + "description": "Key of the layout, which is used to render the need.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "line": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "line_coverage_percent": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "lineno": { + "default": null, + "description": "Line number where the need is defined (None if external).", + "field_type": "core", + "type": [ + "integer", + "null" + ] + }, + "links": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "links_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "max_amount": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "max_content_lines": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "mitigated_by": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "mitigated_by_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "mitigation_issue": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "modifications": { + "default": 0, + "description": "Number of modifications by needextend.", + "field_type": "core", + "type": "integer" + }, + "name": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "output": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "output_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "parent_covered": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "parent_has_problem": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "parent_need": { + "default": null, + "description": "Simply the first parent id.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "parent_needs": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "parent_needs_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "partially_verifies": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "partially_verifies_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "parts": { + "additionalProperties": { + "type": "object" + }, + "default": {}, + "description": "Mapping of parts, a.k.a. sub-needs, IDs to data that overrides the need's data", + "field_type": "core", + "type": "object" + }, + "post_content": { + "default": null, + "description": "Additional content after the need.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "post_template": { + "default": null, + "description": "The template key, if the post_content was created from a jinja template.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "pre_content": { + "default": null, + "description": "Additional content before the need.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "pre_template": { + "default": null, + "description": "The template key, if the pre_content was created from a jinja template.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "provides": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "provides_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "query": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "rationale": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "realizes": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "realizes_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "reqtype": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "requirements_tests_completely_passed_percent": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "responsible": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "responsible_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "result": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "result_text": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "reviewer": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "reviewers": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "root_cause": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "safety": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "safety_affected": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "safety_relevant": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "satisfied_by": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "satisfied_by_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "satisfies": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "satisfies_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "section_name": { + "default": null, + "description": "Simply the first section.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "sections": { + "default": [], + "description": "Sections of the need.", + "field_type": "core", + "items": { + "type": "string" + }, + "type": "array" + }, + "security": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "security_affected": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "service": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "signature": { + "default": null, + "description": "Derived from a docutils desc_name node.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "source_code_link": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "specific": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "status": { + "default": null, + "description": "Status of the need.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "style": { + "default": null, + "description": "Comma-separated list of CSS classes (all appended by `needs_style_`).", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "sufficient": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "supported_by": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "supported_by_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "tags": { + "default": [], + "description": "List of tags.", + "field_type": "core", + "items": { + "type": "string" + }, + "type": "array" + }, + "tcl": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "template": { + "default": null, + "description": "The template key, if the content was created from a jinja template.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "test_type": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "testcovered": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "testlink": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "threat_effect": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "threat_id": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "threat_scenario_id": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "title": { + "description": "Title of the need.", + "field_type": "core", + "type": "string" + }, + "tool_version": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "tracking": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "type": { + "default": "", + "description": "Type of the need.", + "field_type": "core", + "type": "string" + }, + "type_name": { + "default": "", + "description": "Name of the type.", + "field_type": "core", + "type": "string" + }, + "updated_at": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "url": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "user": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "uses": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "uses_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "valid_from": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "valid_until": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "verification_method": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "version": { + "default": 0, + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "integer", + "null" + ] + }, + "violates": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "violates_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + } + } + } +} diff --git a/src/tests/docs_bzl/scenarios/subdirectory_bundle/consumer/_expected/needs_json/needs.json b/src/tests/docs_bzl/scenarios/subdirectory_bundle/consumer/_expected/needs_json/needs.json new file mode 100644 index 000000000..09e3ff71a --- /dev/null +++ b/src/tests/docs_bzl/scenarios/subdirectory_bundle/consumer/_expected/needs_json/needs.json @@ -0,0 +1,1449 @@ +{ + "current_version": "0.0.0", + "project": "Subdirectory Bundle Consumer", + "project_url": "https://example.invalid/subdirectory-bundle-consumer", + "versions": { + "0.0.0": { + "creator": { + "program": "sphinx_needs", + "version": "8.3.1" + }, + "needs": { + "gd_req__consumer": { + "content": "The consumer also has a local requirement, so its needs output can be\nchecked for exactly one copy of each mounted requirement.", + "docname": "index", + "external_css": "external_link", + "id": "gd_req__consumer", + "lineno": 18, + "section_name": "Consumer documentation", + "sections": [ + "Consumer documentation" + ], + "title": "Consumer requirement", + "type": "gd_req", + "type_name": "Process Requirements", + "version": 1 + }, + "gd_req__embedded": { + "content": "The embedded documentation is supplied by a docs_bundle in a subdirectory.", + "docname": "producer/embedded/index", + "external_css": "external_link", + "id": "gd_req__embedded", + "lineno": 18, + "section_name": "Embedded documentation", + "sections": [ + "Embedded documentation" + ], + "title": "Embedded requirement", + "type": "gd_req", + "type_name": "Process Requirements", + "version": 1 + }, + "gd_req__producer_root": { + "content": "The producer's regular documentation is part of its public docs bundle.", + "docname": "producer/index", + "external_css": "external_link", + "id": "gd_req__producer_root", + "lineno": 18, + "section_name": "Producer documentation", + "sections": [ + "Producer documentation" + ], + "title": "Producer root requirement", + "type": "gd_req", + "type_name": "Process Requirements", + "version": 1 + } + }, + "needs_amount": 3, + "needs_defaults_removed": true, + "needs_schema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "affects": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "affects_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "applies_to_module_version": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "approved_by": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "approved_by_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "approver": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "approvers": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "arch": { + "additionalProperties": { + "type": "string" + }, + "default": {}, + "description": "Mapping of uml key to uml content.", + "field_type": "core", + "type": "object" + }, + "author": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "avatar": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "belongs_to": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "belongs_to_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "branch_coverage_percent": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "closed_at": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "completion": { + "default": null, + "description": "Added for needgantt functionality", + "field_type": "extra", + "type": [ + "integer", + "null" + ] + }, + "complies": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "complies_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "consequences": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "consists_of": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "consists_of_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "constraints": { + "default": [], + "description": "List of constraint names, which are defined for this need.", + "field_type": "core", + "items": { + "type": "string" + }, + "type": "array" + }, + "constraints_error": { + "default": null, + "description": "An error message set if any constraint failed, and `error_message` field is set in config.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "constraints_passed": { + "default": true, + "description": "True if all constraints passed, False if any failed, None if not yet checked.", + "field_type": "core", + "type": [ + "boolean", + "null" + ] + }, + "constraints_results": { + "additionalProperties": { + "type": "object" + }, + "default": {}, + "description": "Mapping of constraint name, to check name, to result, None if not yet checked.", + "field_type": "core", + "type": [ + "object", + "null" + ] + }, + "contains": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "contains_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "content": { + "default": "", + "description": "The main content of the need.", + "field_type": "core", + "type": "string" + }, + "context": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "covers": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "covers_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "created_at": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "decision": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "derivation_technique": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "derived_from": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "derived_from_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "docname": { + "default": null, + "description": "Name of the document where the need is defined (None if external).", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "doctype": { + "default": ".rst", + "description": "The markup type of the content, denoted by the suffix of the source file, e.g. '.rst'.", + "field_type": "core", + "type": "string" + }, + "duration": { + "default": null, + "description": "Added for needgantt functionality", + "field_type": "extra", + "type": [ + "integer", + "null" + ] + }, + "evidence": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "evidence_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "external_css": { + "default": "", + "description": "CSS class name, added to the external reference.", + "field_type": "core", + "type": "string" + }, + "external_url": { + "default": null, + "description": "URL of the need, if it is an external need.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "failure_effect": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "failure_id": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "fault_id": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "file": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "fulfils": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "fulfils_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "fully_verifies": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "fully_verifies_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "has": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "has_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "has_dead_links": { + "default": false, + "description": "True if any links reference need ids that are not found in the need list.", + "field_type": "core", + "type": "boolean" + }, + "has_forbidden_dead_links": { + "default": false, + "description": "True if any links reference need ids that are not found in the need list, and the link type does not allow dead links.", + "field_type": "core", + "type": "boolean" + }, + "hash": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "id": { + "description": "ID of the data.", + "field_type": "core", + "type": "string" + }, + "id_prefix": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "implemented": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "implements": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "implements_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "included_by": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "included_by_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "includes": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "includes_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "input": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "input_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "is_external": { + "default": false, + "description": "If true, no node is created and need is referencing external url.", + "field_type": "core", + "type": "boolean" + }, + "is_import": { + "default": false, + "description": "If true, the need was derived from an import.", + "field_type": "core", + "type": "boolean" + }, + "is_modified": { + "default": false, + "description": "Whether the need was modified by needextend.", + "field_type": "core", + "type": "boolean" + }, + "jinja_content": { + "default": false, + "description": "Whether the content was pre-processed by jinja.", + "field_type": "core", + "type": "boolean" + }, + "language": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "layout": { + "default": null, + "description": "Key of the layout, which is used to render the need.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "line": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "line_coverage_percent": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "lineno": { + "default": null, + "description": "Line number where the need is defined (None if external).", + "field_type": "core", + "type": [ + "integer", + "null" + ] + }, + "links": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "links_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "max_amount": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "max_content_lines": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "mitigated_by": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "mitigated_by_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "mitigation_issue": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "modifications": { + "default": 0, + "description": "Number of modifications by needextend.", + "field_type": "core", + "type": "integer" + }, + "name": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "output": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "output_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "parent_covered": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "parent_has_problem": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "parent_need": { + "default": null, + "description": "Simply the first parent id.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "parent_needs": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "parent_needs_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "partially_verifies": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "partially_verifies_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "parts": { + "additionalProperties": { + "type": "object" + }, + "default": {}, + "description": "Mapping of parts, a.k.a. sub-needs, IDs to data that overrides the need's data", + "field_type": "core", + "type": "object" + }, + "post_content": { + "default": null, + "description": "Additional content after the need.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "post_template": { + "default": null, + "description": "The template key, if the post_content was created from a jinja template.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "pre_content": { + "default": null, + "description": "Additional content before the need.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "pre_template": { + "default": null, + "description": "The template key, if the pre_content was created from a jinja template.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "provides": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "provides_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "query": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "rationale": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "realizes": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "realizes_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "reqtype": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "requirements_tests_completely_passed_percent": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "responsible": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "responsible_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "result": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "result_text": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "reviewer": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "reviewers": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "root_cause": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "safety": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "safety_affected": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "safety_relevant": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "satisfied_by": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "satisfied_by_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "satisfies": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "satisfies_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "section_name": { + "default": null, + "description": "Simply the first section.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "sections": { + "default": [], + "description": "Sections of the need.", + "field_type": "core", + "items": { + "type": "string" + }, + "type": "array" + }, + "security": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "security_affected": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "service": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "signature": { + "default": null, + "description": "Derived from a docutils desc_name node.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "source_code_link": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "specific": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "status": { + "default": null, + "description": "Status of the need.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "style": { + "default": null, + "description": "Comma-separated list of CSS classes (all appended by `needs_style_`).", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "sufficient": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "supported_by": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "supported_by_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "tags": { + "default": [], + "description": "List of tags.", + "field_type": "core", + "items": { + "type": "string" + }, + "type": "array" + }, + "tcl": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "template": { + "default": null, + "description": "The template key, if the content was created from a jinja template.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "test_type": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "testcovered": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "testlink": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "threat_effect": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "threat_id": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "threat_scenario_id": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "title": { + "description": "Title of the need.", + "field_type": "core", + "type": "string" + }, + "tool_version": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "tracking": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "type": { + "default": "", + "description": "Type of the need.", + "field_type": "core", + "type": "string" + }, + "type_name": { + "default": "", + "description": "Name of the type.", + "field_type": "core", + "type": "string" + }, + "updated_at": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "url": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "user": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "uses": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "uses_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "valid_from": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "valid_until": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "verification_method": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "version": { + "default": 0, + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "integer", + "null" + ] + }, + "violates": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "violates_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + } + } + } +} diff --git a/src/tests/docs_bzl/scenarios/subdirectory_bundle/producer/_expected/needs_json/needs.json b/src/tests/docs_bzl/scenarios/subdirectory_bundle/producer/_expected/needs_json/needs.json new file mode 100644 index 000000000..6a304b688 --- /dev/null +++ b/src/tests/docs_bzl/scenarios/subdirectory_bundle/producer/_expected/needs_json/needs.json @@ -0,0 +1,1434 @@ +{ + "current_version": "0.0.0", + "project": "Subdirectory Bundle Producer", + "project_url": "https://example.invalid/subdirectory-bundle-producer", + "versions": { + "0.0.0": { + "creator": { + "program": "sphinx_needs", + "version": "8.3.1" + }, + "needs": { + "gd_req__embedded": { + "content": "The embedded documentation is supplied by a docs_bundle in a subdirectory.", + "docname": "embedded/index", + "external_css": "external_link", + "id": "gd_req__embedded", + "lineno": 18, + "section_name": "Embedded documentation", + "sections": [ + "Embedded documentation" + ], + "title": "Embedded requirement", + "type": "gd_req", + "type_name": "Process Requirements", + "version": 1 + }, + "gd_req__producer_root": { + "content": "The producer's regular documentation is part of its public docs bundle.", + "docname": "index", + "external_css": "external_link", + "id": "gd_req__producer_root", + "lineno": 18, + "section_name": "Producer documentation", + "sections": [ + "Producer documentation" + ], + "title": "Producer root requirement", + "type": "gd_req", + "type_name": "Process Requirements", + "version": 1 + } + }, + "needs_amount": 2, + "needs_defaults_removed": true, + "needs_schema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "affects": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "affects_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "applies_to_module_version": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "approved_by": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "approved_by_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "approver": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "approvers": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "arch": { + "additionalProperties": { + "type": "string" + }, + "default": {}, + "description": "Mapping of uml key to uml content.", + "field_type": "core", + "type": "object" + }, + "author": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "avatar": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "belongs_to": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "belongs_to_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "branch_coverage_percent": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "closed_at": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "completion": { + "default": null, + "description": "Added for needgantt functionality", + "field_type": "extra", + "type": [ + "integer", + "null" + ] + }, + "complies": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "complies_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "consequences": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "consists_of": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "consists_of_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "constraints": { + "default": [], + "description": "List of constraint names, which are defined for this need.", + "field_type": "core", + "items": { + "type": "string" + }, + "type": "array" + }, + "constraints_error": { + "default": null, + "description": "An error message set if any constraint failed, and `error_message` field is set in config.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "constraints_passed": { + "default": true, + "description": "True if all constraints passed, False if any failed, None if not yet checked.", + "field_type": "core", + "type": [ + "boolean", + "null" + ] + }, + "constraints_results": { + "additionalProperties": { + "type": "object" + }, + "default": {}, + "description": "Mapping of constraint name, to check name, to result, None if not yet checked.", + "field_type": "core", + "type": [ + "object", + "null" + ] + }, + "contains": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "contains_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "content": { + "default": "", + "description": "The main content of the need.", + "field_type": "core", + "type": "string" + }, + "context": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "covers": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "covers_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "created_at": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "decision": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "derivation_technique": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "derived_from": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "derived_from_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "docname": { + "default": null, + "description": "Name of the document where the need is defined (None if external).", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "doctype": { + "default": ".rst", + "description": "The markup type of the content, denoted by the suffix of the source file, e.g. '.rst'.", + "field_type": "core", + "type": "string" + }, + "duration": { + "default": null, + "description": "Added for needgantt functionality", + "field_type": "extra", + "type": [ + "integer", + "null" + ] + }, + "evidence": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "evidence_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "external_css": { + "default": "", + "description": "CSS class name, added to the external reference.", + "field_type": "core", + "type": "string" + }, + "external_url": { + "default": null, + "description": "URL of the need, if it is an external need.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "failure_effect": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "failure_id": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "fault_id": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "file": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "fulfils": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "fulfils_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "fully_verifies": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "fully_verifies_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "has": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "has_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "has_dead_links": { + "default": false, + "description": "True if any links reference need ids that are not found in the need list.", + "field_type": "core", + "type": "boolean" + }, + "has_forbidden_dead_links": { + "default": false, + "description": "True if any links reference need ids that are not found in the need list, and the link type does not allow dead links.", + "field_type": "core", + "type": "boolean" + }, + "hash": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "id": { + "description": "ID of the data.", + "field_type": "core", + "type": "string" + }, + "id_prefix": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "implemented": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "implements": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "implements_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "included_by": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "included_by_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "includes": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "includes_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "input": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "input_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "is_external": { + "default": false, + "description": "If true, no node is created and need is referencing external url.", + "field_type": "core", + "type": "boolean" + }, + "is_import": { + "default": false, + "description": "If true, the need was derived from an import.", + "field_type": "core", + "type": "boolean" + }, + "is_modified": { + "default": false, + "description": "Whether the need was modified by needextend.", + "field_type": "core", + "type": "boolean" + }, + "jinja_content": { + "default": false, + "description": "Whether the content was pre-processed by jinja.", + "field_type": "core", + "type": "boolean" + }, + "language": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "layout": { + "default": null, + "description": "Key of the layout, which is used to render the need.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "line": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "line_coverage_percent": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "lineno": { + "default": null, + "description": "Line number where the need is defined (None if external).", + "field_type": "core", + "type": [ + "integer", + "null" + ] + }, + "links": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "links_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "max_amount": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "max_content_lines": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "mitigated_by": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "mitigated_by_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "mitigation_issue": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "modifications": { + "default": 0, + "description": "Number of modifications by needextend.", + "field_type": "core", + "type": "integer" + }, + "name": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "output": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "output_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "parent_covered": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "parent_has_problem": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "parent_need": { + "default": null, + "description": "Simply the first parent id.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "parent_needs": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "parent_needs_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "partially_verifies": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "partially_verifies_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "parts": { + "additionalProperties": { + "type": "object" + }, + "default": {}, + "description": "Mapping of parts, a.k.a. sub-needs, IDs to data that overrides the need's data", + "field_type": "core", + "type": "object" + }, + "post_content": { + "default": null, + "description": "Additional content after the need.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "post_template": { + "default": null, + "description": "The template key, if the post_content was created from a jinja template.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "pre_content": { + "default": null, + "description": "Additional content before the need.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "pre_template": { + "default": null, + "description": "The template key, if the pre_content was created from a jinja template.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "provides": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "provides_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "query": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "rationale": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "realizes": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "realizes_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "reqtype": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "requirements_tests_completely_passed_percent": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "responsible": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "responsible_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "result": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "result_text": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "reviewer": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "reviewers": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "root_cause": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "safety": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "safety_affected": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "safety_relevant": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "satisfied_by": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "satisfied_by_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "satisfies": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "satisfies_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "section_name": { + "default": null, + "description": "Simply the first section.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "sections": { + "default": [], + "description": "Sections of the need.", + "field_type": "core", + "items": { + "type": "string" + }, + "type": "array" + }, + "security": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "security_affected": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "service": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "signature": { + "default": null, + "description": "Derived from a docutils desc_name node.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "source_code_link": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "specific": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "status": { + "default": null, + "description": "Status of the need.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "style": { + "default": null, + "description": "Comma-separated list of CSS classes (all appended by `needs_style_`).", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "sufficient": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "supported_by": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "supported_by_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "tags": { + "default": [], + "description": "List of tags.", + "field_type": "core", + "items": { + "type": "string" + }, + "type": "array" + }, + "tcl": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "template": { + "default": null, + "description": "The template key, if the content was created from a jinja template.", + "field_type": "core", + "type": [ + "string", + "null" + ] + }, + "test_type": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "testcovered": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "testlink": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "threat_effect": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "threat_id": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "threat_scenario_id": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "title": { + "description": "Title of the need.", + "field_type": "core", + "type": "string" + }, + "tool_version": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "tracking": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "type": { + "default": "", + "description": "Type of the need.", + "field_type": "core", + "type": "string" + }, + "type_name": { + "default": "", + "description": "Name of the type.", + "field_type": "core", + "type": "string" + }, + "updated_at": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "url": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "user": { + "default": null, + "description": "Added by service github-issues", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "uses": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "uses_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + }, + "valid_from": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "valid_until": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "verification_method": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, + "version": { + "default": 0, + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "integer", + "null" + ] + }, + "violates": { + "default": [], + "description": "Link field", + "field_type": "links", + "items": { + "type": "string" + }, + "type": "array" + }, + "violates_back": { + "default": [], + "description": "Backlink field", + "field_type": "backlinks", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + } + } + } +} diff --git a/src/tests/docs_bzl/test_basic_docs.py b/src/tests/docs_bzl/test_basic_docs.py deleted file mode 100644 index 199bafdd1..000000000 --- a/src/tests/docs_bzl/test_basic_docs.py +++ /dev/null @@ -1,41 +0,0 @@ -# ******************************************************************************* -# Copyright (c) 2026 Contributors to the Eclipse Foundation -# -# See the NOTICE file(s) distributed with this work for additional -# information regarding copyright ownership. -# -# This program and the accompanying materials are made available under the -# terms of the Apache License Version 2.0 which is available at -# https://www.apache.org/licenses/LICENSE-2.0 -# -# SPDX-License-Identifier: Apache-2.0 -# ******************************************************************************* - -"""Public docs() smoke scenario.""" - -from src.tests.docs_bzl.helpers import built_output, load_needs_json, run_scenario - - -def test_basic_docs_builds_html(): - result = run_scenario("run", "basic_docs", ":docs") - - index_html = result.build_dir / "index.html" - - assert "Basic Test" in index_html.read_text(encoding="utf-8") - - -def test_basic_docs_builds_needs_without_conf_py(): - """Root docs data supports literalinclude in the sandboxed Sphinx build.""" - result = run_scenario("build", "basic_docs", ":needs_json") - - # With no docs/conf.py the generated config is used; it must set a non-empty - # version so sphinx-needs writes a non-empty current_version into needs.json - # (an empty current_version makes the file unusable for external consumers). - assert result.artifacts is not None, f"expected artifacts: {result}" - data = load_needs_json(result.artifacts["needs.json"]) - assert data["current_version"], "current_version must be non-empty" - - generated_conf = built_output("scenarios/basic_docs", "docs/conf.py") - assert 'required_in_id = ["docs_as_code"]' in generated_conf.read_text( - encoding="utf-8" - ) diff --git a/src/tests/docs_bzl/test_cross_module_compatibility.py b/src/tests/docs_bzl/test_cross_module_compatibility.py index c2d428bd8..12a686ef6 100644 --- a/src/tests/docs_bzl/test_cross_module_compatibility.py +++ b/src/tests/docs_bzl/test_cross_module_compatibility.py @@ -10,6 +10,8 @@ import subprocess from pathlib import Path +import pytest + from src.tests.docs_bzl.helpers import repo_root, run_scenario @@ -88,6 +90,7 @@ def _write_cross_module_consumer( ) +@pytest.mark.bazel_slow def test_cross_module_version_mismatch_is_reported_without_failing( tmp_path: Path, ) -> None: @@ -124,6 +127,7 @@ def test_cross_module_version_mismatch_is_reported_without_failing( assert (tmp_path / "_build/compatibility-findings.html").is_file() +@pytest.mark.bazel_slow def test_external_findings_remain_fatal_by_default(tmp_path: Path) -> None: _write_cross_module_consumer(tmp_path) result = subprocess.run( @@ -137,6 +141,7 @@ def test_external_findings_remain_fatal_by_default(tmp_path: Path) -> None: assert "is missing required attribute: `status`" in result.stderr +@pytest.mark.bazel_slow def test_local_version_mismatch_remains_fatal() -> None: result = run_scenario("run", "local_version_mismatch", ":docs", expect_error=True) assert "condition 'version==1' not satisfied" in result.stderr diff --git a/src/tests/docs_bzl/test_data_files_runfiles.py b/src/tests/docs_bzl/test_data_files_runfiles.py index 2240248b8..5cbad6ab3 100644 --- a/src/tests/docs_bzl/test_data_files_runfiles.py +++ b/src/tests/docs_bzl/test_data_files_runfiles.py @@ -11,60 +11,18 @@ # SPDX-License-Identifier: Apache-2.0 # ******************************************************************************* -"""Verify that genrule-generated RST sources are reachable at ``bazel run`` time. +"""Keep the negative source-bundle boundary assertion for the data fixture.""" -The ``srcs`` attribute of ``docs_bundle`` can carry genrule outputs that live -in ``bazel-out/.../bin/``. The bundle stages them into the runfiles of -``:docs``; ``score_mounts`` then resolves the generated source root through -``/bazel-bin`` and mounts it. This end-to-end test fails if either half -of that chain regresses.""" +import pytest -from src.tests.docs_bzl.helpers import built_output, run_bazel, run_scenario - - -def test_generated_source_files_reachable_at_runtime(): - """Genrule output in a docs_bundle src dep must be resolved by Sphinx.""" - result = run_scenario("run", "data_files_runfiles", ":docs") - - generated_html = result.build_dir / "data_test" / "index.html" - - assert "Generated Data Page" in generated_html.read_text(encoding="utf-8") - assert "generated-data-diagram" in generated_html.read_text(encoding="utf-8") - - -def test_legacy_generated_data_files_remain_reachable_at_runtime(): - """Legacy generated RST files declared through ``data`` still work.""" - result = run_scenario("run", "data_files_runfiles", ":docs") - - legacy_html = result.build_dir / "legacy_data_test" / "index.html" - - assert "Legacy Data Page" in legacy_html.read_text(encoding="utf-8") +from src.tests.docs_bzl.helpers import run_scenario +@pytest.mark.bazel_slow def test_explicit_source_bundle_excludes_undeclared_siblings(): - """Explicit source bundles must not recursively mount undeclared files.""" + """Expected-output matching intentionally does not cover forbidden extras.""" result = run_scenario("run", "data_files_runfiles", ":docs") - declared_html = result.build_dir / "isolated_test" / "index.html" undeclared_html = result.build_dir / "isolated_test" / "undeclared.html" - assert "Isolated Declared Page" in declared_html.read_text(encoding="utf-8") assert not undeclared_html.exists() - - -def test_explicit_source_bundles_export_local_needs_from_their_source_root(): - """Explicit source targets are staged with their bundle entry as the root.""" - run_bazel( - [ - "build", - "//src/tests/docs_bzl/scenarios/data_files_runfiles:data_bundle.__internal__.needs_local", - "//src/tests/docs_bzl/scenarios/data_files_runfiles:isolated_source_bundle.__internal__.needs_local", - ] - ) - - for target in ("data_bundle", "isolated_source_bundle"): - needs_output = built_output( - "scenarios/data_files_runfiles", - f"{target}.__internal__.needs_local/_build/needs/needs.json", - ) - assert needs_output.is_file() diff --git a/src/tests/docs_bzl/test_docs_bzl_scenarios.py b/src/tests/docs_bzl/test_docs_bzl_scenarios.py new file mode 100644 index 000000000..edcbdd77b --- /dev/null +++ b/src/tests/docs_bzl/test_docs_bzl_scenarios.py @@ -0,0 +1,56 @@ +# ******************************************************************************* +# Copyright (c) 2026 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 +# +# SPDX-License-Identifier: Apache-2.0 +# ******************************************************************************* +"""Golden-output integration tests for public ``docs.bzl`` scenarios.""" + +import pytest + +from src.tests.docs_bzl.expected_outputs import ( + ExpectedOutput, + discover_expected_outputs, + discover_expected_scenarios, + update_expected_output, +) + + +def _expected_output_test_cases() -> list[object]: + """Create one pytest test case per checked-in target output. + + The target command determines the marker directly, so build-only outputs + are cacheable and targets that execute Sphinx through ``bazel run`` are + slow without classifying unrelated outputs in the same scenario. + """ + test_cases: list[object] = [] + for scenario in discover_expected_scenarios(): + for expected in discover_expected_outputs(scenario): + marker = ( + pytest.mark.bazel_slow + if expected.target.command == "run" + else pytest.mark.bazel_cached + ) + test_cases.append( + pytest.param( + scenario, + expected, + marks=marker, + id=f"{scenario}[{expected.short_name}]", + ) + ) + return test_cases + + +@pytest.mark.parametrize(("scenario", "expected_output"), _expected_output_test_cases()) +def test_docs_bzl_scenario_expected_output( + scenario: str, expected_output: ExpectedOutput +): + """Check one generated public-scenario output against its checked-in contract.""" + update_expected_output(scenario, expected_output) diff --git a/src/tests/docs_bzl/test_expected_output_consistency.py b/src/tests/docs_bzl/test_expected_output_consistency.py new file mode 100644 index 000000000..5ed4026f9 --- /dev/null +++ b/src/tests/docs_bzl/test_expected_output_consistency.py @@ -0,0 +1,95 @@ +# ******************************************************************************* +# Copyright (c) 2026 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 +# +# SPDX-License-Identifier: Apache-2.0 +# ******************************************************************************* +"""Behavioral tests for the checked-in expected-output contract.""" + +from pathlib import Path + +import pytest + +import src.tests.docs_bzl.expected_outputs as expected_outputs +from src.tests.docs_bzl.expected_outputs import ( + ExpectedOutput, + ExpectedTarget, + update_expected_output, +) + + +def _stub_expected_output_execution( + monkeypatch: pytest.MonkeyPatch, + expected_path: Path, + actual_path: Path, +) -> ExpectedOutput: + """Replace Bazel execution with one deterministic Expected-/Actual-file pair.""" + expected = ExpectedOutput( + short_name="fixture", + target=ExpectedTarget( + label=":fixture", + command="build", + output_kind="file", + output_path="fixture", + ), + expected_path=expected_path, + ) + monkeypatch.setattr( + expected_outputs, + "_run_expected_target", + lambda scenario, expected: None, + ) + monkeypatch.setattr( + expected_outputs, + "_expected_file_pairs", + lambda expected, scenario: [(expected_path, actual_path)], + ) + return expected + + +@pytest.mark.bazel_cached +def test_changed_expected_output_is_reported_with_diff( + tmp_path: Path, monkeypatch: pytest.MonkeyPatch +) -> None: + """Changed output is written and reported for review as a failing check.""" + expected_path = tmp_path / "expected.txt" + actual_path = tmp_path / "actual.txt" + expected_path.write_text("before\n", encoding="utf-8") + actual_path.write_text("after\n", encoding="utf-8") + expected = _stub_expected_output_execution(monkeypatch, expected_path, actual_path) + + with pytest.raises(AssertionError, match="expected outputs changed") as failure: + update_expected_output("fixture", expected) + + assert expected_path.read_text(encoding="utf-8") == "after\n" + assert "-before" in str(failure.value) + assert "+after" in str(failure.value) + + +@pytest.mark.bazel_cached +def test_unchanged_expected_output_is_accepted_without_writing( + tmp_path: Path, monkeypatch: pytest.MonkeyPatch +) -> None: + """Stable generated output passes and does not rewrite its expected file.""" + expected_path = tmp_path / "expected.txt" + actual_path = tmp_path / "actual.txt" + expected_path.write_text("stable\n", encoding="utf-8") + actual_path.write_text("stable\n", encoding="utf-8") + expected = _stub_expected_output_execution(monkeypatch, expected_path, actual_path) + write_calls: list[tuple[Path, bytes]] = [] + monkeypatch.setattr( + expected_outputs, + "_write_expected_file", + lambda path, content: write_calls.append((path, content)), + ) + + update_expected_output("fixture", expected) + + assert expected_path.read_text(encoding="utf-8") == "stable\n" + assert write_calls == [] diff --git a/src/tests/docs_bzl/test_external_bundle.py b/src/tests/docs_bzl/test_external_bundle.py deleted file mode 100644 index 39f230147..000000000 --- a/src/tests/docs_bzl/test_external_bundle.py +++ /dev/null @@ -1,39 +0,0 @@ -# ******************************************************************************* -# Copyright (c) 2026 Contributors to the Eclipse Foundation -# -# See the NOTICE file(s) distributed with this work for additional -# information regarding copyright ownership. -# -# This program and the accompanying materials are made available under the -# terms of the Apache License Version 2.0 which is available at -# https://www.apache.org/licenses/LICENSE-2.0 -# -# SPDX-License-Identifier: Apache-2.0 -# ******************************************************************************* - -# ******************************************************************************* -# Copyright (c) 2026 Contributors to the Eclipse Foundation -# -# See the NOTICE file(s) distributed with this work for additional -# information regarding copyright ownership. -# -# This program and the accompanying materials are made available under the -# terms of the Apache License Version 2.0 which is available at -# https://www.apache.org/licenses/LICENSE-2.0 -# ******************************************************************************* -"""External docs_bundle() scenario.""" - -import json - -from src.tests.docs_bzl.helpers import run_scenario - - -def test_external_bundle_builds_in_sandbox_and_at_runtime(): - run_scenario("build", "external_bundle", ":needs_json") - result = run_scenario("run", "external_bundle", ":docs") - - assert (result.build_dir / "index.html").is_file() - report = json.loads( - (result.build_dir / "compatibility-findings.json").read_text(encoding="utf-8") - ) - assert report["summary"]["count"] >= 0 diff --git a/src/tests/docs_bzl/test_invalid_bundle_placements.py b/src/tests/docs_bzl/test_invalid_bundle_placements.py index 4af200f89..4ca8cc6bf 100644 --- a/src/tests/docs_bzl/test_invalid_bundle_placements.py +++ b/src/tests/docs_bzl/test_invalid_bundle_placements.py @@ -23,9 +23,12 @@ # ******************************************************************************* """Invalid docs_bundle() placement scenario.""" +import pytest + from src.tests.docs_bzl.helpers import repo_root, run_scenario +@pytest.mark.bazel_slow def test_invalid_bundle_placements_are_rejected_during_analysis(): run_scenario("build", "invalid_bundle_placements", ":bad", expect_error=True) run_scenario( @@ -33,6 +36,7 @@ def test_invalid_bundle_placements_are_rejected_during_analysis(): ) +@pytest.mark.bazel_slow def test_source_dir_and_srcs_are_rejected_during_loading(): scenario_dir = ( repo_root() / "src/tests/docs_bzl/scenarios/invalid_source_combination" diff --git a/src/tests/docs_bzl/test_metamodel_violation.py b/src/tests/docs_bzl/test_metamodel_violation.py index 0dfe8b1ff..bea4a3419 100644 --- a/src/tests/docs_bzl/test_metamodel_violation.py +++ b/src/tests/docs_bzl/test_metamodel_violation.py @@ -23,9 +23,12 @@ # ******************************************************************************* """Invalid metamodel scenario for the public docs() API.""" +import pytest + from src.tests.docs_bzl.helpers import run_scenario +@pytest.mark.bazel_slow def test_metamodel_violation_fails_build(): result = run_scenario( "build", "metamodel_violation", ":needs_json", expect_error=True diff --git a/src/tests/docs_bzl/test_missing_docs_config.py b/src/tests/docs_bzl/test_missing_docs_config.py index c8511a08a..5bffed761 100644 --- a/src/tests/docs_bzl/test_missing_docs_config.py +++ b/src/tests/docs_bzl/test_missing_docs_config.py @@ -8,9 +8,12 @@ # ******************************************************************************* """Validation of docs() configuration fallback.""" +import pytest + from src.tests.docs_bzl.helpers import repo_root, run_scenario +@pytest.mark.bazel_slow def test_missing_conf_and_macro_values_fails_analysis(): scenario_dir = repo_root() / "src/tests/docs_bzl/scenarios/missing_docs_config" build_file = scenario_dir / "BUILD" diff --git a/src/tests/docs_bzl/test_nested_bundles.py b/src/tests/docs_bzl/test_nested_bundles.py deleted file mode 100644 index a3f6bde35..000000000 --- a/src/tests/docs_bzl/test_nested_bundles.py +++ /dev/null @@ -1,87 +0,0 @@ -# ******************************************************************************* -# Copyright (c) 2026 Contributors to the Eclipse Foundation -# -# See the NOTICE file(s) distributed with this work for additional -# information regarding copyright ownership. -# -# This program and the accompanying materials are made available under the -# terms of the Apache License Version 2.0 which is available at -# https://www.apache.org/licenses/LICENSE-2.0 -# -# SPDX-License-Identifier: Apache-2.0 -# ******************************************************************************* - -# ******************************************************************************* -# Copyright (c) 2026 Contributors to the Eclipse Foundation -# -# See the NOTICE file(s) distributed with this work for additional -# information regarding copyright ownership. -# -# This program and the accompanying materials are made available under the -# terms of the Apache License Version 2.0 which is available at -# https://www.apache.org/licenses/LICENSE-2.0 -# ******************************************************************************* -"""Nested docs_bundle() scenario.""" - -import json - -from src.tests.docs_bzl.helpers import built_output, run_scenario - - -def test_nested_bundles_keep_data_with_the_mount_that_declares_it(): - """Keep parent-owned generated data off nested mounts that do not declare it.""" - result = run_scenario("run", "nested_bundles", ":docs") - - manifest = json.loads( - built_output("scenarios/nested_bundles", "_mounts_manifest.json").read_text( - encoding="utf-8" - ) - ) - assert [mount["mount_at"] for mount in manifest["mounts"]] == [ - "concepts/example_bundle", - "concepts/example_bundle/child", - ] - assert [mount["entry_doc"] for mount in manifest["mounts"]] == [ - "index", - "landing", - ] - # ``:parent`` declares ``generated_doc_output``; ``:child`` declares no data. - # Each entry must therefore retain its own data set after the parent is mounted. - parent_mount = next( - m for m in manifest["mounts"] if m["mount_at"] == "concepts/example_bundle" - ) - assert parent_mount["data"] == [ - "src/tests/docs_bzl/scenarios/nested_bundles/generated/generated_output.txt", - ] - child_mount = next( - m - for m in manifest["mounts"] - if m["mount_at"] == "concepts/example_bundle/child" - ) - assert child_mount["data"] == [] - - sourcelinks = json.loads( - built_output("scenarios/nested_bundles", "sourcelinks_json.json").read_text( - encoding="utf-8" - ) - ) - assert {link["file"] for link in sourcelinks} == { - "src/tests/docs_bzl/scenarios/nested_bundles/child/example.py", - "src/tests/docs_bzl/scenarios/nested_bundles/child/example.cc", - "src/tests/docs_bzl/scenarios/nested_bundles/child/filegroup_source.py", - } - assert (result.build_dir / "concepts" / "example_bundle" / "index.html").is_file() - assert ( - result.build_dir / "concepts" / "example_bundle" / "child" / "landing.html" - ).is_file() - - -def test_nested_bundle_aggregator_preserves_declared_order(): - run_scenario("build", "nested_bundles", ":ordered_aggregate_manifest") - - manifest = json.loads( - built_output( - "scenarios/nested_bundles", "ordered_aggregate_manifest.json" - ).read_text(encoding="utf-8") - ) - assert [mount["mount_at"] for mount in manifest["mounts"]] == ["first", "second"] diff --git a/src/tests/docs_bzl/test_reference_integration.py b/src/tests/docs_bzl/test_reference_integration.py index 0df5eb22e..87438baa7 100644 --- a/src/tests/docs_bzl/test_reference_integration.py +++ b/src/tests/docs_bzl/test_reference_integration.py @@ -13,92 +13,12 @@ """Reference integration scenario for the public docs() API.""" -from typing import cast - import pytest -from src.tests.docs_bzl.helpers import built_output, load_needs, run_bazel, run_scenario - - -def test_score_platform_publishes_feature_requirement(): - """The platform fixture provides the external requirement used by modules.""" - result = run_scenario( - "build", "reference_integration/score_platform", ":needs_json" - ) - assert result.artifacts - - needs = load_needs(result.artifacts["needs.json"]) - assert "feat_req__platform__feature" in needs, sorted(needs) - - -def test_module_and_component_needs_targets_build_with_source_links(): - """Preserve component source links in composed Needs builds. - - The module targets prove that ``code_targets`` creates links for nested - component bundles and propagates them through the module bundle. Both - targets are built in one Bazel invocation because this suite deliberately - drives coarse-grained integration cases. - """ - expected_links = [ - ( - "reference_integration/legacy_module", - "tool_req__legacy_component", - "legacy_module/docs/components/component/implementation.py#L14", - ), - ( - "reference_integration/modern_module", - "tool_req__modern_component", - "modern_module/docs/components/component/implementation.py#L17", - ), - ] - # Build the module and nested component bundles together so the assertions - # below verify source-link propagation at each relevant bundle boundary. - run_bazel( - [ - "build", - *[ - f"//src/tests/docs_bzl/scenarios/{scenario}:needs_json" - for scenario, _, _ in expected_links - ], - "//src/tests/docs_bzl/scenarios/reference_integration/legacy_module/docs/components/component:docs_bundle.__internal__.needs_local", - ] - ) - - for scenario, need_id, source_link_fragment in expected_links: - # Each Needs export must retain the source path belonging to the - # package where the annotated implementation is defined. - needs = load_needs( - built_output( - f"scenarios/{scenario}", - "needs_json/_build/needs/needs.json", - ) - ) - need = needs.get(need_id) - assert isinstance(need, dict), sorted(needs) - typed_need = cast(dict[str, object], need) - source_code_link = typed_need.get("source_code_link") - assert isinstance(source_code_link, str) - assert source_link_fragment in source_code_link - - # The component's own export uses the same source-link input as the - # composed module build. Keep this assertion separate from the module - # outputs so the local target is verified as an actual standalone export. - local_needs = load_needs( - built_output( - "scenarios/reference_integration/legacy_module/docs/components/component", - "docs_bundle.__internal__.needs_local/_build/needs/needs.json", - ) - ) - local_need = local_needs.get("tool_req__legacy_component") - assert isinstance(local_need, dict), sorted(local_needs) - typed_local_need = cast(dict[str, object], local_need) - local_source_code_link = typed_local_need.get("source_code_link") - assert isinstance(local_source_code_link, str) - assert "legacy_module/docs/components/component/implementation.py#L14" in ( - local_source_code_link - ) +from src.tests.docs_bzl.helpers import run_scenario +@pytest.mark.bazel_slow def test_nested_component_package_is_mounted_by_its_module(): """Nested component bundles are rendered at both module mount points.""" result = run_scenario("run", "reference_integration/modern_module", ":docs") @@ -111,41 +31,9 @@ def test_nested_component_package_is_mounted_by_its_module(): ).is_file() -def test_modern_module_linked_and_unlinked_components(): - """Parent context is required only for the component with an external link. - - The modern module imports the platform Needs. Its linked component relies - on that imported feature requirement, whereas the unlinked component has - no dependency outside its own bundle and is the independent-build control. - """ - module_result = run_scenario( - "build", "reference_integration/modern_module", ":needs_json" - ) - assert module_result.artifacts - module_needs = load_needs(module_result.artifacts["needs.json"]) - # Building through the module provides the platform requirement and must - # export both the linked and unlinked component requirements. - assert { - "comp_req__modern_component__platform_feature", - "tool_req__modern_component", - "tool_req__modern_unlinked_component", - } <= module_needs.keys() - - # The unlinked component has no external references, so its local Needs - # export is valid without the modern module's external_needs declaration. - run_scenario( - "build", - "reference_integration/modern_module/docs/components/unlinked_component", - ":docs_bundle.__internal__.needs_local", - ) - unlinked_needs = load_needs( - built_output( - "scenarios/reference_integration/modern_module/docs/components/unlinked_component", - "docs_bundle.__internal__.needs_local/_build/needs/needs.json", - ) - ) - assert "tool_req__modern_unlinked_component" in unlinked_needs - +@pytest.mark.bazel_slow +def test_linked_component_requires_parent_context(): + """A linked component cannot build standalone without its external Needs.""" # The linked component intentionally omits that external Needs input. The # standalone build must therefore fail while resolving its derived_from # link to the platform feature requirement. @@ -158,18 +46,7 @@ def test_modern_module_linked_and_unlinked_components(): assert "feat_req__platform__feature" in str(exc_info.value) -def test_reference_integration_root_bundle_exports_its_own_needs(): - """The root docs() bundle exposes a local Needs export for its own sources.""" - run_scenario( - "build", "reference_integration", ":docs_bundle.__internal__.needs_local" - ) - - assert built_output( - "scenarios/reference_integration", - "docs_bundle.__internal__.needs_local/_build/needs/needs.json", - ).is_file() - - +@pytest.mark.bazel_slow def test_reference_integration_builds_with_platform_requirements(): """Mount modules and render nested component source-code links.""" result = run_scenario("run", "reference_integration", ":docs") diff --git a/src/tests/docs_bzl/test_subdirectory_bundle.py b/src/tests/docs_bzl/test_subdirectory_bundle.py index 6bbf6ba6a..35251631c 100644 --- a/src/tests/docs_bzl/test_subdirectory_bundle.py +++ b/src/tests/docs_bzl/test_subdirectory_bundle.py @@ -12,12 +12,15 @@ # ******************************************************************************* """Coverage for bundles in nested Bazel packages and source directories.""" -from src.tests.docs_bzl.helpers import load_needs, run_bazel, run_package +import pytest + +from src.tests.docs_bzl.helpers import run_bazel, run_package PRODUCER = "//src/tests/docs_bzl/scenarios/subdirectory_bundle/producer" CONSUMER = "//src/tests/docs_bzl/scenarios/subdirectory_bundle/consumer" +@pytest.mark.bazel_cached def test_docs_targets_build_with_a_bundle_in_a_subdirectory(): targets = [ "docs", @@ -44,31 +47,9 @@ def test_docs_targets_build_with_a_bundle_in_a_subdirectory(): ) -def test_producer_needs_include_subdirectory_bundle_once(): - result = run_package( - "build", "scenarios/subdirectory_bundle/producer", ":needs_json" - ) - assert result.artifacts is not None - - needs = load_needs(result.artifacts["needs.json"]) - assert set(needs) == { - "gd_req__producer_root", - "gd_req__embedded", - } - - -def test_consumer_can_render_and_check_transitive_bundle_without_duplicate_needs(): - result = run_package( - "build", "scenarios/subdirectory_bundle/consumer", ":needs_json" - ) - assert result.artifacts is not None - needs = load_needs(result.artifacts["needs.json"]) - assert set(needs) == { - "gd_req__producer_root", - "gd_req__embedded", - "gd_req__consumer", - } - +@pytest.mark.bazel_slow +def test_consumer_can_render_and_run_documentation_checks(): + """Runtime rendering and documentation checks work across package boundaries.""" producer_result = run_package( "run", "scenarios/subdirectory_bundle/producer", ":docs" )