Skip to content

refactor: simplify / ungeneralize needs.json export of project_url - #797

Closed
AlexanderLanin wants to merge 1 commit into
eclipse-score:mainfrom
etas-contrib:pr/needs-exporter-api
Closed

refactor: simplify / ungeneralize needs.json export of project_url#797
AlexanderLanin wants to merge 1 commit into
eclipse-score:mainfrom
etas-contrib:pr/needs-exporter-api

Conversation

@AlexanderLanin

@AlexanderLanin AlexanderLanin commented Sep 3, 2026

Copy link
Copy Markdown
Member

Why this matters

The Needs JSON exporter currently exposes a generic helper whose field list, validation policy, and output values are passed separately. That makes a one-field customization harder to understand and makes it awkward for specialized exports that must write different metadata. It's simply super difficult to extend a generic exporter. And we only export one value.

What changed

  • Replace the generic exporter helper with explicit project URL registration.
  • Preserve the existing host behavior: project_url is validated and exported from Sphinx configuration.
  • Allow callers to provide an explicit JSON value without mutating the active Sphinx configuration.
  • Resolve the host configuration at finalization time and make repeated registration idempotent.
  • Keep export values tied to the Sphinx configuration owning each Needs list.
  • Add regression coverage for configured values, missing configuration, late configuration changes, and repeated registration.

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

Configuration snapshots and stacked exporter wrappers can produce stale or incorrect project URLs.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Refactors Needs JSON export registration around the SCORE-specific project_url field.

Changes:

  • Adds explicit project URL export and override support.
  • Adds regression tests for configuration and overrides.
File summaries
File Description
external_needs.py Implements project URL export registration.
test_external_needs.py Tests missing, configured, and overridden values.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 2
  • Review effort level: Balanced

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

Comment thread src/extensions/score_metamodel/external_needs.py Outdated
Comment thread src/extensions/score_metamodel/external_needs.py Outdated
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

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

@AlexanderLanin AlexanderLanin changed the title [PR0] Refactor Needs JSON project URL export registration refactor: simplify / ungeneralize custom needs json export of project URL Sep 3, 2026
@AlexanderLanin AlexanderLanin changed the title refactor: simplify / ungeneralize custom needs json export of project URL refactor: simplify / ungeneralize needs.json export of project_url Sep 3, 2026
@AlexanderLanin AlexanderLanin changed the title refactor: simplify / ungeneralize needs.json export of project_url [PR0] Refactor Needs JSON project URL export registration Sep 3, 2026
@AlexanderLanin AlexanderLanin changed the title [PR0] Refactor Needs JSON project URL export registration refactor: simplify / ungeneralize needs.json export of project_url Sep 3, 2026
@AlexanderLanin
AlexanderLanin force-pushed the pr/needs-exporter-api branch 5 times, most recently from 9171c09 to 8c48f40 Compare September 3, 2026 07:26
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.

2 participants