Skip to content

feat: link primary bundle Needs to Bazel targets - #854

Merged
a-zw merged 7 commits into
eclipse-score:mainfrom
etas-contrib:feature/bundle-needs-metadata
Sep 25, 2026
Merged

a-zw merged 7 commits into
eclipse-score:mainfrom
etas-contrib:feature/bundle-needs-metadata

Conversation

@AlexanderLanin

@AlexanderLanin AlexanderLanin commented Sep 22, 2026 •

Copy link
Copy Markdown
Member

Why

When users inspect the generated Needs for a documentation bundle, they should be able to see which Bazel target provides the implementation behind the bundle's main subject. This makes the path from a feature or component Need to its implementation easier to understand and gives downstream tools reliable build metadata for traceability and navigation.

A bundle may contain many Needs, such as a feature and its individual requirements. The bundle therefore declares which Need is its primary subject. The generated metadata is attached to that Need, independently of the names of the bundle, target, or child Needs.

What changed

  • Add optional primary_need_id to docs_bundle() and docs().
  • Include the primary Need ID in bundle metadata and composition manifests.
  • Expose the direct Bazel target label and rule type on the bundle's primary Need.
  • Represent multiple direct targets in a compact JSON value.
  • Leave other local Needs as well as imported and external Needs unchanged.
  • Keep metadata consistent across incremental Sphinx builds and update the related documentation and reference coverage.

This comment was marked as outdated.

@AlexanderLanin AlexanderLanin changed the title Expose Bazel target metadata on bundle Needs feat: expose Bazel target metadata on bundle Needs Sep 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

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

@MaximilianSoerenPollak MaximilianSoerenPollak 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.

This looks good imo, but I have some questions regarding some of the details etc.

Comment thread src/extensions/score_metamodel/bundle_matching.py Outdated
Comment thread src/extensions/score_metamodel/bundle_matching.py Outdated
Comment thread src/extensions/score_metamodel/bundle_matching.py Outdated
Comment thread src/extensions/score_metamodel/bundle_matching.py Outdated
Comment thread src/extensions/score_metamodel/bundle_metadata.py Outdated
Comment thread src/extensions/score_metamodel/bundle_metadata.py
Comment thread src/extensions/score_metamodel/bundle_metadata.py
Comment thread src/extensions/score_metamodel/bundle_metadata.py Outdated
@AlexanderLanin AlexanderLanin changed the title feat: expose Bazel target metadata on bundle Needs feat: link primary bundle Needs to Bazel targets Sep 24, 2026

@MaximilianSoerenPollak MaximilianSoerenPollak 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.

Now with the primary need idea looks much better for sure concept wise.

Still one questions but those cna be addressed in future PR's.

Comment thread bzl/bundle_rules.bzl Outdated
Comment thread docs/reference/bazel_macros.rst Outdated

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

Public macro positional compatibility is broken, and custom metamodels do not register the generated fields.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 3 High severity

Open (3)
Resolved since last review (3)

Comment thread docs.bzl
entry_doc = "index",
bundles = [],
code_targets = [],
primary_need_id = None,

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

if people are using positional parameters they deserve trouble

Comment thread docs.bzl
deps = [],
external_needs = [],
code_targets = [],
primary_need_id = None,

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

if people are using positional parameters they deserve trouble

Comment on lines +20 to +21
bazel_target: ^.*$
bazel_type: ^.*$

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

yeah open point for any such type

@MaximilianSoerenPollak MaximilianSoerenPollak 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.

Fine from my side now. ✅

@a-zw
a-zw merged commit 1f8f23c into eclipse-score:main Sep 25, 2026
25 checks passed
@a-zw
a-zw deleted the feature/bundle-needs-metadata branch September 25, 2026 07:23
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.

4 participants