Skip to content

feat: module verification report / complex templates - #763

Merged
AlexanderLanin merged 13 commits into
mainfrom
ver
Aug 28, 2026
Merged

feat: module verification report / complex templates#763
AlexanderLanin merged 13 commits into
mainfrom
ver

Conversation

@AlexanderLanin

@AlexanderLanin AlexanderLanin commented Aug 26, 2026

Copy link
Copy Markdown
Member

@github-actions

github-actions Bot commented Aug 26, 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: edc2d291-9906-48a9-b841-33662ca489fa
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: 5.786s
INFO: 0 processes.
ERROR: Build did NOT complete successfully
ERROR: Build failed. Not running target

@github-actions

Copy link
Copy Markdown
Contributor

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

@AlexanderLanin AlexanderLanin changed the title initial version complex templates Aug 27, 2026
@AlexanderLanin AlexanderLanin changed the title complex templates feat: module verification report / complex templates Aug 27, 2026
@AlexanderLanin
AlexanderLanin requested a lite review from Copilot August 27, 2026 20:57

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

This PR adds infrastructure for complex Sphinx-Needs .need templates (including graph traversal and a post-merge re-render pass) and introduces an initial “tiny” module verification report template that generates real Sphinx sections for navigation/ToC.

Changes:

  • Added a new score_sphinx_needs_templates Sphinx extension that (a) registers the shared templates folder, (b) exposes a linked_needs() helper, and (c) re-reads pages with marked post_templates after parallel Needs collection is merged.
  • Added a complex mod_ver_report_tiny.need template that builds feature/component sections and summary tables/pies from the Need graph.
  • Wired the new extension into the Sphinx bundle and added a new auto_mod_ver_report need type.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/needs_templates/mod_ver_report_tiny.need New complex post-template for module verification reports with feature/component sections and statistics.
src/extensions/score_sphinx_needs_templates/README.md Documents the new extension behavior and the linked_needs helper.
src/extensions/score_sphinx_needs_templates/BUILD Bazel target for the new extension, including templates as runtime data.
src/extensions/score_sphinx_needs_templates/init.py Implements template folder discovery, linked_needs, and the marked-page second read.
src/extensions/score_sphinx_bundle/BUILD Drops direct template data dependency and depends on the new templates extension instead.
src/extensions/score_sphinx_bundle/init.py Loads score_sphinx_needs_templates and removes bundle-local template folder config.
src/extensions/score_metamodel/metamodel.yaml Adds auto_mod_ver_report need type.
src/BUILD Exposes the new extension’s sources at the top-level filegroup.
Suppressed comments (1)

src/needs_templates/mod_ver_report_tiny.need:259

  • Same as above: these needpie filters depend on locals()/len(), which may not be available in Sphinx-Needs filter expressions. Using direct boolean checks on the backlink fields is simpler and avoids evaluation errors.
         type == "comp_req" and "{{ component_id }}" in satisfied_by and ("fully_verifies_back" in locals() and len(fully_verifies_back) > 0)
         type == "comp_req" and "{{ component_id }}" in satisfied_by and ("partially_verifies_back" in locals() and len(partially_verifies_back) > 0) and not ("fully_verifies_back" in locals() and len(fully_verifies_back) > 0)
         type == "comp_req" and "{{ component_id }}" in satisfied_by and not ("fully_verifies_back" in locals() and len(fully_verifies_back) > 0) and not ("partially_verifies_back" in locals() and len(partially_verifies_back) > 0)

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

Comment thread src/needs_templates/module_verification_report.need Outdated
Comment thread src/extensions/score_sphinx_needs_templates/__init__.py Outdated
@AlexanderLanin
AlexanderLanin marked this pull request as draft August 27, 2026 21:26
Downstream SCORE repositories currently have no independent, at-a-glance
view of whether their module verification report builds pass. This adds
a standalone tool that checks out each configured repository, runs its
docs build, and aggregates the results into a single gallery whose index
page is designed for non-developers: a plain-language summary count,
status badges, and collapsed failure details instead of a raw
technical table.
…n reports

The generated report page used a bespoke auto_mod_ver_report need type
that only supported belongs_to, so it could not participate in the
document/workproduct realization model the rest of the metamodel uses.
Switching it to the generic document type and linking realizes:
wp__verification_module_ver_report brings it in line with that model.
document has no belongs_to link, so mod_ver_report_tiny now recovers the
module id from the report's own id (doc__<module>_verification_report)
instead.
@AlexanderLanin
AlexanderLanin marked this pull request as ready for review August 28, 2026 13:08
Drop the locals()/len() guards around the fully_verifies_back /
partially_verifies_back needpie filters - those backlink fields always
exist on comp_req/feat_req needs, so a plain truthy check suffices and
avoids a possible NameError in the filter eval context. Also swap the
internal app.events.emit() call for the public app.emit() wrapper.
@AlexanderLanin
AlexanderLanin requested a balanced review from Copilot August 28, 2026 13:09

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

The consumer tests for module_verification_report are in here as a first pass.

That code will reworked & refactored in the future and is currently not fully working but a good starting point.
TAlked about in a call, seems okay-ish.

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 14 out of 15 changed files in this pull request and generated 5 comments.

Suppressed comments (1)

src/extensions/score_sphinx_needs_templates/init.py:167

  • The env-updated purge/reread is the compatibility-sensitive core of this extension, but the added smoke test only checks that report.html exists; it would pass if the second read never populated any graph-derived sections. Add file-based Sphinx assertions for rendered feature/component sections, including parallel and incremental rebuilds and an externally resolved Need, as required by the linked design decision.
    app.connect("builder-inited", _capture_template_environment)
    app.connect("env-updated", _rerender_pages_with_complex_post_templates)

Comment thread tools/BUILD Outdated
Comment thread tools/module_verification_reports.py Outdated
Comment on lines +224 to +225
{% set component_slug_norm = component_title|replace("_", "")|replace(" ", "")|lower %}
{% set component_anchor = component_title|replace("_", "-")|replace(" ", "-")|lower %}
Comment thread src/extensions/score_sphinx_needs_templates/__init__.py Outdated
Comment thread tools/module_verification_reports.py
- tools/BUILD: the data glob only matched a nonexistent
  module_verification_profiles/ directory, so the real
  module_verification_reports.toml next to the script was missing from
  runfiles. List it explicitly.
- module_verification_reports.py: default golden root pointed at
  scripts_bazel/, but tools/BUILD packages goldens under tools/ -
  align the two so --check-goldens/--update-goldens find the right path.
- score_sphinx_needs_templates: resolve linked needs by the link's full
  qualified string (id[condition]) instead of the bare id, so a
  version-qualified link resolves the matching NeedItem instead of an
  arbitrary same-id candidate.
The rename in 6064471 mechanically turned an old regression guard
(":post_template: mod_ver_report_tiny" must not collapse to bare
"mod_ver_report") into a self-contradiction once the template's name
became "module_verification_report" itself - the assertion now
directly contradicted the line above it, failing bazel test //...
Remove the now-meaningless guard.

Also add .cache to .bazelignore: module_verification_reports.py's
downstream checkout cache (introduced in 32c69fb) includes a
self-referencing overlay of this repo, which sends Bazel's package
discovery into an infinite symlink loop for anyone with a populated
cache.
@AlexanderLanin
AlexanderLanin merged commit 298732e into main Aug 28, 2026
20 of 21 checks passed
@AlexanderLanin
AlexanderLanin deleted the ver branch August 28, 2026 15:40
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