Skip to content

fix(rules_score): stop duplicating feature requirements in component docs#328

Merged
hoe-jo merged 1 commit into
eclipse-score:mainfrom
simon-d-bmw:fix/component-requirements-doc-duplication
Jul 8, 2026
Merged

fix(rules_score): stop duplicating feature requirements in component docs#328
hoe-jo merged 1 commit into
eclipse-score:mainfrom
simon-d-bmw:fix/component-requirements-doc-duplication

Conversation

@simon-d-bmw

Copy link
Copy Markdown
Contributor

Summary

component() lists feature_requirements alongside component_requirements in its requirements attribute so the feature requirement's .lobster file is available to resolve derived_from references from the component requirements. component.bzl's Sphinx-doc collection loop did not distinguish between the two providers, so every component listing a feature_requirements target re-rendered that feature's full requirements page into its own docs — duplicating the feature requirements content once per referencing component, plus once at the dependable_element level (which already renders it correctly from its own requirements attribute).

Changes:

  • private/component.bzl: only collect SphinxSourcesInfo.srcs from ComponentRequirementsInfo-providing targets in requirements; FeatureRequirementsInfo targets remain usable there for Lobster tracing but no longer contribute rendered RST to the component's own docs. Docstring updated to document this.
  • test/unit_component_test.bzl / test/BUILD: add component_excludes_feature_req_docs_test, asserting a component's SphinxSourcesInfo.srcs contains its own component_requirements RST but not a co-listed feature_requirements RST.

Validation: bazel test //... (from bazel/rules/rules_score/test/, a separate module) — 64/64 tests pass, including the new regression test.

…docs

component() lists feature_requirements alongside component_requirements
in its `requirements` attribute solely so the feature requirement's
.lobster file is available to resolve derived_from references from the
component requirements. The Sphinx-doc collection loop did not
distinguish between the two, so every component that listed a
feature_requirements target re-rendered that feature's full requirements
page into its own docs, duplicating it once per referencing component
plus once at the dependable_element level.

Only include ComponentRequirementsInfo-providing targets when collecting
SphinxSourcesInfo.srcs for a component; FeatureRequirementsInfo targets
remain usable in `requirements` for Lobster tracing but no longer
contribute rendered RST to the component's own docs.

Adds a regression test (component_excludes_feature_req_docs_test)
asserting a component's SphinxSourcesInfo.srcs contains its own
component_requirements RST but not a co-listed feature_requirements RST.

Validation: bazel test //... run from bazel/rules/rules_score/test
(separate module per .bazelignore) - 64/64 tests pass.
@simon-d-bmw simon-d-bmw force-pushed the fix/component-requirements-doc-duplication branch from 0641e78 to 538429f Compare July 8, 2026 07:40
@simon-d-bmw simon-d-bmw marked this pull request as ready for review July 8, 2026 07:41
@hoe-jo hoe-jo merged commit 7889372 into eclipse-score:main Jul 8, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants