Skip to content

chore(deps): upgrade to Sphinx-Needs 9.3.0 - #1079

Merged
a-zw merged 5 commits into
eclipse-score:mainfrom
etas-contrib:experiment/sphinx-needs-9
Dec 4, 2026
Merged

a-zw merged 5 commits into
eclipse-score:mainfrom
etas-contrib:experiment/sphinx-needs-9

Conversation

@AlexanderLanin

Copy link
Copy Markdown
Member

Why

Upgrade to Sphinx-Needs 9 to reduce the cost of document-local needextend filters in large documentation builds while retaining Python 3.12 support. An earlier compatibility prototype with 9.3.0 reduced the Reference Integration Sphinx run from 315 to 170 seconds using the same test artifacts. This addresses the performance bottleneck described in #1075 through the upstream filter implementation.

Changes

  • Pin Sphinx-Needs 9.3.0 in the Python 3.12 and 3.14 lockfiles. The Python 3.12 build continues to resolve Sphinx 9.1.1.
  • Register Sphinx-Needs type definitions and SCORE validation rules separately from the same YAML metamodel. Sphinx-Needs 9 validates needs_types and removes SCORE-specific keys.
  • Forward the field schema to the Sphinx-Needs needextend implementation and preserve the SCORE policy checks.

The Reference Integration prototype generated its HTML and exports but reported a warning for the needtable filter in the ASPICE appendix from process_description. The filter is written as "c.this_doc()". Sphinx-Needs 9 treats the quoted expression as a constant.

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.

🟡 Changes recommended

Approval is blocked by two unresolved critical issues: retained non-SCORE need types can abort builds, and the Sphinx-Needs upgrade triggers a warning that fails the strict documentation build.

2 open issues
What changed in this PR

This pull request upgrades the documentation stack to Sphinx-Needs 9.3.0 and adapts SCORE's metamodel integration to the updated Sphinx-Needs APIs and schema model.

Changes:

  • Pins Sphinx-Needs 9.3.0 and refreshes the Python 3.12 and 3.14 dependency lockfiles.
  • Migrates relocated Sphinx-Needs APIs, including NeedsView, NeedsCoreFields, and logging support.
  • Separates SCORE-specific type metadata from Sphinx-Needs definitions and forwards the field schema through needextend processing.
File Description
src/​requirements.txt Updates the Python 3.12 dependency lockfile for Sphinx-Needs 9.3.0 and its transitive dependencies.
src/​requirements.in Pins the direct Sphinx-Needs dependency to version 9.3.0.
src/​requirements_py314.txt Updates the Python 3.14 dependency lockfile for Sphinx-Needs 9.3.0 and its transitive dependencies.
src/​extensions/​score_metrics/​traceability_metrics.py Updates the NeedsView import for the Sphinx-Needs 9 API.
src/​extensions/​score_metrics/​tests/​test_traceability_metrics.py Updates the traceability metrics test import for the relocated NeedsView.
src/​extensions/​score_metamodel/​yaml_parser.py Imports NeedsCoreFields from its new Sphinx-Needs module.
src/​extensions/​score_metamodel/​tests/​test_testcase.py Updates the testcase test import for the relocated NeedsView.
src/​extensions/​score_metamodel/​tests/​test_metamodel__init__.py Updates the metamodel initialization test import for the relocated NeedsView.
src/​extensions/​score_metamodel/​tests/​test_graph_checks.py Updates the graph checks test import for the relocated NeedsView.
src/​extensions/​score_metamodel/​tests/​test_external_needs.py Adjusts exporter assertions for the updated Sphinx-Needs finalization behavior.
src/​extensions/​score_metamodel/​tests/​test_check_options.py Updates validation tests to use separate SCORE-specific type metadata.
src/​extensions/​score_metamodel/​tests/​test_check_needs_extends.py Supplies the new field schema argument to the needextend wrapper tests.
src/​extensions/​score_metamodel/​tests/​rst/​conf.py Registers fixture types through the new SCORE type registration helper.
src/​extensions/​score_metamodel/​log.py Migrates the SphinxLoggerAdapter import to Sphinx's logging module.
src/​extensions/​score_metamodel/​checks/​tool_qualification.py Updates the NeedsView import for the Sphinx-Needs 9 API.
src/​extensions/​score_metamodel/​checks/​testcase.py Updates the testcase checker import for the relocated NeedsView.
src/​extensions/​score_metamodel/​checks/​graph_checks.py Updates the graph checker import for the relocated NeedsView.
src/​extensions/​score_metamodel/​checks/​check_options.py Reads SCORE-specific validation metadata separately from Sphinx-Needs type definitions.
src/​extensions/​score_metamodel/​checks/​check_needs_extends.py Forwards the Sphinx-Needs field schema through needextend processing and updates its processor integration.
src/​extensions/​score_metamodel/​checks/​attributes_format.py Reads SCORE-specific type metadata separately from Sphinx-Needs type definitions.
src/​extensions/​score_metamodel/​__init__.py Registers Sphinx-Needs-compatible types separately from SCORE-specific type definitions and validation rules.

Review effort: Lite

Comment thread src/requirements.in Resolved
Use the faster document-local needextend filter evaluation while retaining Python 3.12 support. Register SCORE validation rules separately from Sphinx-Needs type definitions and forward the field schema in the needextend hook.

Signed-off-by: Alexander Lanin <Alexander.Lanin@etas.com>
@a-zw
a-zw force-pushed the experiment/sphinx-needs-9 branch from 91c19b0 to 33f3fc3 Compare December 2, 2026 12:51
Copilot AI lite review requested due to automatic review settings December 2, 2026 12:51

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.

🟡 Changes recommended

A critical finding shows the change breaks Sphinx-Needs 9.3 needextend semantics by restricting filters per document and altering global extension ordering.

3 open issues

Review effort: Lite

Copilot AI lite review requested due to automatic review settings December 3, 2026 07:51

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.

🟡 Changes recommended

The SCORE validation pass applies same-document needextend directives in source order, while Sphinx-Needs 9.3 applies them by (extend_priority, docname, lineno); when directives with different priorities set or replace the same field, validation can inspect a different intermediate Need state than the application pass, potentially causing false policy violations or missing real ones.

2 open issues
2 resolved since last review

Review effort: Lite

Copilot AI lite review requested due to automatic review settings December 3, 2026 10:11

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.

🔵 Needs a closer look

The Sphinx-Needs upgrade changes filter and needextend semantics and generated outputs across Python 3.12 and 3.14. Full Bazel/Sphinx integration builds could not be run in this review context, so compatibility of those changes remains unverified.

2 open issues

Review effort: Lite

Copilot AI lite review requested due to automatic review settings December 3, 2026 14:06

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.

🔵 Needs a closer look

The scenario dependency change may leave the Bazel lockfile stale, and because CI uses strict lockfile validation, scenario resolution could fail; please verify the lockfile is regenerated consistently with the module changes.

2 open issues

Review effort: Lite

@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

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

@a-zw
a-zw marked this pull request as ready for review December 3, 2026 16:29

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

Seems good. 💯

More changes than anticipated but actually less than I thought after looking through the changelogs

Comment thread src/requirements.in Resolved

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.

🔵 Needs a closer look

The module dependency change may leave the Bazel lockfile out of sync, creating uncertainty about whether the end-to-end test setup will run successfully and requiring human review before approval.

No open issues 🎉

2 resolved since last review

Review effort: Lite

@a-zw
a-zw merged commit 39ecd39 into eclipse-score:main Dec 4, 2026
25 of 32 checks passed
@a-zw
a-zw deleted the experiment/sphinx-needs-9 branch December 4, 2026 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Development

Successfully merging this pull request may close these issues.

4 participants