refactor: map documents to their owning bundles - #849
Merged
AlexanderLanin merged 3 commits intoSep 22, 2026
Merged
AlexanderLanin merged 3 commits into
AlexanderLanin merged 3 commits into
Conversation
AlexanderLanin
requested review from
MaximilianSoerenPollak,
a-zw,
dcalavrezo-qorix and
nradakovic
as code owners
September 22, 2026 13:51
Contributor
|
Documentation preview for this pull request is available at: |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The public mapping documentation incorrectly implies that discovered data-only documents are included.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Adds document-to-bundle ownership mapping for Sphinx builds and local bundle exports.
Changes:
- Maps discovered source documents to bundle metadata.
- Excludes data-only mounts from ownership.
- Adds local-only manifests for standalone Needs exports.
| File | Description |
|---|---|
src/extensions/score_mounts/__init__.py |
Builds and exposes document-bundle mappings. |
src/extensions/score_mounts/_resolver.py |
Clarifies bundle association terminology. |
src/extensions/score_mounts/tests/test_data_mounts.py |
Tests root, child, and data-only ownership. |
src/extensions/docs/mounts_internals.rst |
Documents mapping internals. |
docs.bzl |
Passes local manifests to Needs actions. |
bzl/mount_rules.bzl |
Adds root-entry-only manifest generation. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.

Why this is needed
A composed documentation site contains documents from several bundles, but a document-level consumer cannot tell which bundle supplied a document without re-deriving ownership from filesystem paths and mount configuration. That breaks down for nested bundles and data-only mounts, and can cause a document to inherit metadata from the wrong bundle.
Concrete result
After this PR, a consumer processing the Sphinx environment can ask for the bundle of each discovered document and use that bundle's direct metadata and code targets:
indexresolves to the root documentation bundle.concepts/example_bundle/child/landingresolves to the child bundle that supplied it, not the host bundle.This gives downstream document-level checks and exporters a direct, unambiguous input for choosing the correct bundle identity and direct code targets for each document. They no longer need to infer ownership from paths or mount placement.
The mapping is exposed through
get_document_bundles(app), and the three ownership outcomes above are covered by regression tests.