Skip to content

fix: allow explicit root bundle source allowlists - #853

Open
AlexanderLanin wants to merge 1 commit into
eclipse-score:mainfrom
etas-contrib:fix/docs-mounting-groundwork
Open

AlexanderLanin wants to merge 1 commit into
eclipse-score:mainfrom
etas-contrib:fix/docs-mounting-groundwork

Conversation

@AlexanderLanin

@AlexanderLanin AlexanderLanin commented Sep 22, 2026

Copy link
Copy Markdown
Member

A documentation bundle may intentionally expose only a selected set of source files. For example:

docs_bundle(
    name = "isolated_source_bundle",
    srcs = ["isolated/index.rst"],
)

If isolated/undeclared.rst exists next to it, that file is not part of the bundle and should not be read by its standalone Sphinx build. Before this change, Sphinx could also discover such undeclared sibling files from the shared source directory. That meant a bundle could contain documentation that was not declared in its BUILD file, leading to unexpected pages and incorrect bundle ownership.

With this change, the declared index.rst is included and the undeclared sibling is ignored. From a documentation author’s perspective, docs_bundle(srcs = [...]) now behaves as an exact source-file selection.

The implementation:

  • applies a positive Sphinx include_patterns allowlist to root bundles with explicit srcs;
  • rejects explicit root sources outside the Sphinx source directory;
  • adds a regression test covering the selected-file allowlist behavior.

@github-actions

Copy link
Copy Markdown
Contributor

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

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

🔵 Needs a closer look

The root-bundle behavior needs integration-level regression coverage before approval.

Review effort: Balanced
Findings: None

What changed in this PR

Restricts explicit root documentation bundles to declared source files, preventing Sphinx from discovering undeclared siblings.

Changes:

  • Adds root-bundle include_patterns allowlisting.
  • Validates sources are within the Sphinx source directory.
  • Adds allowlist configuration coverage.
File Description
src/​extensions/​score_mounts/​tests/​test_data_mounts.py Tests allowlist configuration, but lacks standalone discovery coverage.
src/​extensions/​score_mounts/​__init__.py Implements root source allowlisting and validation; related maintainer documentation needs updating.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@AlexanderLanin AlexanderLanin changed the title Fix explicit root bundle source allowlists fix: allow explicit root bundle source allowlists Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants