Skip to content

refactor: map documents to their owning bundles - #849

Merged
AlexanderLanin merged 3 commits into
eclipse-score:mainfrom
etas-contrib:feature/bundle-document-ownership
Sep 22, 2026
Merged

AlexanderLanin merged 3 commits into
eclipse-score:mainfrom
etas-contrib:feature/bundle-document-ownership

Conversation

@AlexanderLanin

@AlexanderLanin AlexanderLanin commented Sep 22, 2026 •

Copy link
Copy Markdown
Member

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:

  • A host document such as index resolves to the root documentation bundle.
  • A mounted child document such as concepts/example_bundle/child/landing resolves to the child bundle that supplied it, not the host bundle.
  • A document loaded through a data-only mount has no bundle association, so it is not incorrectly attributed to the root bundle.
  • A standalone bundle's Needs export sees only that bundle's own documents, excluding nested bundle entries.

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.

@AlexanderLanin AlexanderLanin changed the title refactor: retain bundle metadata for documents refactor: map documents to their owning bundles Sep 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Documentation preview for this pull request is available at:
pr-849: https://eclipse-score.github.io/docs-as-code/pr-849/

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Low severity

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.

Comment thread src/extensions/docs/mounts_internals.rst Outdated

@a-zw a-zw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@AlexanderLanin
AlexanderLanin merged commit d5f3de6 into eclipse-score:main Sep 22, 2026
22 checks passed
@AlexanderLanin
AlexanderLanin deleted the feature/bundle-document-ownership branch September 22, 2026 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

3 participants