fix(rules_score): stop duplicating feature requirements in component docs#328
Merged
hoe-jo merged 1 commit intoJul 8, 2026
Conversation
…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.
0641e78 to
538429f
Compare
hoe-jo
approved these changes
Jul 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
component()listsfeature_requirementsalongsidecomponent_requirementsin itsrequirementsattribute so the feature requirement's.lobsterfile is available to resolvederived_fromreferences from the component requirements.component.bzl's Sphinx-doc collection loop did not distinguish between the two providers, so every component listing afeature_requirementstarget re-rendered that feature's full requirements page into its own docs — duplicating the feature requirements content once per referencing component, plus once at thedependable_elementlevel (which already renders it correctly from its ownrequirementsattribute).Changes:
private/component.bzl: only collectSphinxSourcesInfo.srcsfromComponentRequirementsInfo-providing targets inrequirements;FeatureRequirementsInfotargets 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: addcomponent_excludes_feature_req_docs_test, asserting a component'sSphinxSourcesInfo.srcscontains its owncomponent_requirementsRST but not a co-listedfeature_requirementsRST.Validation:
bazel test //...(frombazel/rules/rules_score/test/, a separate module) — 64/64 tests pass, including the new regression test.