Skip to content

feat: metamodel visualization - #686

Merged
AlexanderLanin merged 16 commits into
eclipse-score:mainfrom
etas-contrib:metamodel-overview
Aug 5, 2026
Merged

feat: metamodel visualization#686
AlexanderLanin merged 16 commits into
eclipse-score:mainfrom
etas-contrib:metamodel-overview

Conversation

@a-zw

@a-zw a-zw commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

📌 Description

Adds a visualization of the metamodel as docs_as_code implements it.
Result visible here: https://eclipse-score.github.io/docs-as-code/pr-686/reference/metamodel/index.html

Also, adapts the bundle mechanism to support generated files.

🚨 Impact Analysis

  • This change does not violate any tool requirements and is covered by existing tool requirements
  • This change does not violate any design decisions
  • Otherwise I have created a ticket for new tool qualification

✅ Checklist

  • Added/updated documentation for new or changed features
  • Added/updated tests to cover the changes
  • Followed project coding standards and guidelines

@github-actions

github-actions Bot commented Aug 4, 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: 55a7f443-ebb5-455e-98e9-6ddadf706ab3
Computing main repo mapping: 
Computing main repo mapping: 
Loading: 
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
    currently loading: src
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: 6.413s
INFO: 0 processes.
ERROR: Build did NOT complete successfully
ERROR: Build failed. Not running target

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

The created documentation from the pull request is available at: docu-html

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.

Pull request overview

Adds a generated “metamodel visualization” documentation bundle (RST + Mermaid) and extends the Bazel docs bundle/mount pipeline so Sphinx can mount generated (non-source-tree) files in addition to regular documentation sources.

Changes:

  • Introduces a Bazel genrule + Python generator to emit index.rst and a Mermaid class diagram for the metamodel.
  • Extends bundle/manifest plumbing (DocsBundleInfo, mounts manifest JSON, Python resolver) with a data field to carry generated outputs.
  • Updates score_mounts to mount parent directories of generated files and score_sphinx_bundle to enable Mermaid d3 zoom.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/extensions/score_sphinx_bundle/init.py Sets default Mermaid config (mermaid_d3_zoom).
src/extensions/score_mounts/_resolver.py Extends mount manifest parsing to include data paths.
src/extensions/score_mounts/init.py Adds resolution/mounting of generated “data” files from the manifest.
src/extensions/score_metamodel/docs/generate_metamodel_rst.py New generator producing RST + Mermaid diagram from metamodel.yaml.
src/extensions/score_metamodel/docs/BUILD New Bazel targets to generate and bundle the metamodel visualization docs.
docs.bzl Extends docs_bundle() macro to accept data dependencies.
bzl/mount_rules.bzl Emits data paths into the mounts manifest JSON.
bzl/bundle_rules.bzl Propagates data through DocsBundleInfo / entries for generated-file support.
BUILD Mounts the new metamodel docs bundle into the main docs tree.
Suppressed comments (1)

bzl/bundle_rules.bzl:249

  • Pure-data bundles also set entry.data to a list (own_data), but downstream code expects a depset (mount manifest generation calls .to_list()). Make entry.data a depset here as well to keep the entry schema consistent.
    elif own_data:
        # Pure data bundle: create an entry so the data files appear in the manifest.
        entries.append(struct(
            runtime_path = "",
            src_root = "",
            mount_at = "",
            attach_to = "",
            entry_doc = ctx.attr.entry_doc,
            external = False,
            repository = ctx.label.workspace_name,
            data = own_data,
        ))

Comment thread bzl/bundle_rules.bzl
Comment thread bzl/bundle_rules.bzl Outdated
Comment thread src/extensions/score_mounts/__init__.py Outdated
Comment thread bzl/mount_rules.bzl
Comment thread src/extensions/score_mounts/_resolver.py
Comment thread src/extensions/score_mounts/_resolver.py Outdated
@a-zw
a-zw force-pushed the metamodel-overview branch from bed4959 to 3e9057d Compare August 4, 2026 14:51
@a-zw a-zw changed the title Metamodel visualization feat: metamodel visualization Aug 4, 2026
Comment thread bzl/bundle_rules.bzl
Comment thread src/extensions/score_mounts/__init__.py 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.

Pull request overview

Copilot reviewed 16 out of 17 changed files in this pull request and generated 1 comment.

Suppressed comments (2)

src/extensions/score_mounts/init.py:92

  • The bazel run fallback maps execroot-relative data paths to bazel-bin by hard-coding the configuration segment ("bazel-out/k8-fastbuild/bin/"). This will fail for other configs/platforms (e.g. k8-opt, darwin_arm64-fastbuild). Strip up to the first "/bin/" segment instead so the mapping works across Bazel output configs.
                    walk_file = (
                        ws_root
                        / "bazel-bin"
                        / data_file.removeprefix("bazel-out/k8-fastbuild/bin/")
                    )

src/extensions/score_mounts/init.py:103

  • Data mounts are deduplicated purely by directory path. If two bundles reference data files that resolve to the same directory but have different mount points, the later mount is silently dropped, producing an incomplete/incorrect mount list. At minimum, detect this conflict and fail fast instead of ignoring it.
            walk_dir = walk_file.parent
            if str(walk_dir) not in data_mounts:
                data_mounts[str(walk_dir)] = spec
    return data_mounts

Comment thread src/extensions/score_metamodel/docs/BUILD
@AlexanderLanin
AlexanderLanin merged commit b64a91c into eclipse-score:main Aug 5, 2026
18 of 20 checks passed
@AlexanderLanin
AlexanderLanin deleted the metamodel-overview branch August 5, 2026 08:56
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