Skip to content

docs: keep bundle examples self-contained - #780

Draft
AlexanderLanin wants to merge 10 commits into
mainfrom
fix/778-self-contained-docs-bundle
Draft

docs: keep bundle examples self-contained#780
AlexanderLanin wants to merge 10 commits into
mainfrom
fix/778-self-contained-docs-bundle

Conversation

@AlexanderLanin

@AlexanderLanin AlexanderLanin commented Aug 31, 2026

Copy link
Copy Markdown
Member

Fixes #778

The documentation examples intentionally use the test BUILD files as their source of truth. The original literalinclude paths remain unchanged; no copied .inc snapshots are introduced.

The public bundle carries those files through a separate data-only docs_bundle child, composed at a private mount path. The docs() macro stages non-document payloads from composed data-only children below the sandboxed Sphinx source tree, so each file label is declared only on its owning child bundle. Data stays attached to the manifest entry that declares it, preserving the per-entry propagation fix from #779.

A source entry composed with a data-only child carries explicit path_check = "off" because sphinx-mounts 0.1.x cannot express a per-file path-check exception for intentionally declared non-document supporting files outside source_dir. Ordinary mounts remain strict (path_check = "error"). Pure data entries only create mounts for document files; BUILD and other supporting payloads remain bundle inputs without exposing neighboring documents.

This is an intentionally narrow compatibility bridge. Upstream issue useblocks/sphinx-mounts#43 tracks a per-mount allowlist for explicitly declared external dependencies. When that is available, this source-entry-level path_check exception can be replaced by the exact declared files.

Regression coverage includes an external Bzlmod consumer that mounts the public bundle and verifies the rendered original literalinclude, plus a sandboxed needs_json build from a subpackage. The Sphinx action remains sandboxed; the consumer test limits local execution to the known local_path_override sourcelink helper workaround.

Checks:

  • pre-commit run --files BUILD docs.bzl bzl/bundle_rules.bzl docs/reference/bazel_macros.rst src/tests/docs_bzl/scenarios/bundle_data_provider/BUILD src/tests/docs_bzl/test_external_consumer_bundle_data.py
  • bazel build //src/tests/docs_bzl/scenarios/bundle_data_provider:needs_json //:needs_json
  • bazel run //:docs
  • .venv_docs/bin/python -m pytest -q src/tests/docs_bzl/test_external_consumer_bundle_data.py

@github-actions

github-actions Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

License Check Results

🚀 The license check job ran with the Bazel command:

bazel run --lockfile_mode=error //src:license-check

Status: ⚠️ Needs Review

Click to expand output
[License Check Output]
Extracting Bazel installation...
Starting local Bazel server (8.6.0) and connecting to it...
INFO: Invocation ID: ceb57c5b-be81-47cd-9e52-e3ea32e8b0d1
Computing main repo mapping: 
Loading: 
Loading: 0 packages loaded
Loading: 0 packages loaded
WARNING: Target pattern parsing failed.
ERROR: Skipping '//src:license-check': no such target '//src:license-check': target 'license-check' not declared in package 'src' defined by /home/runner/work/docs-as-code/docs-as-code/src/BUILD
ERROR: no such target '//src:license-check': target 'license-check' not declared in package 'src' defined by /home/runner/work/docs-as-code/docs-as-code/src/BUILD
INFO: Elapsed time: 8.015s
INFO: 0 processes.
ERROR: Build did NOT complete successfully
ERROR: Build failed. Not running target

@AlexanderLanin
AlexanderLanin marked this pull request as draft August 31, 2026 14:06
@github-actions

Copy link
Copy Markdown
Contributor

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

@AlexanderLanin
AlexanderLanin force-pushed the fix/778-self-contained-docs-bundle branch from d0e58f6 to 0d7d245 Compare August 31, 2026 15:46
@AlexanderLanin
AlexanderLanin marked this pull request as ready for review August 31, 2026 18:58
@AlexanderLanin
AlexanderLanin force-pushed the fix/778-self-contained-docs-bundle branch from 102ef45 to b10f565 Compare September 1, 2026 06:47
@AlexanderLanin
AlexanderLanin changed the base branch from main to fix/781-bazel-package-mount-boundaries September 1, 2026 06:51
@AlexanderLanin
AlexanderLanin marked this pull request as draft September 1, 2026 08:06
@AlexanderLanin
AlexanderLanin force-pushed the fix/778-self-contained-docs-bundle branch from b10f565 to 102ef45 Compare September 1, 2026 08:29
@AlexanderLanin
AlexanderLanin changed the base branch from fix/781-bazel-package-mount-boundaries to main September 1, 2026 08:29
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.

Public docs_bundle is not self-contained because bundle examples include files outside docs/

1 participant