Skip to content

Add powsybl-diagram version number to metadata output#803

Open
hqqw2h-lgtm wants to merge 2 commits intopowsybl:mainfrom
hqqw2h-lgtm:add-version-to-metadata
Open

Add powsybl-diagram version number to metadata output#803
hqqw2h-lgtm wants to merge 2 commits intopowsybl:mainfrom
hqqw2h-lgtm:add-version-to-metadata

Conversation

@hqqw2h-lgtm
Copy link
Copy Markdown

Summary

Add the powsybl-diagram version number to the metadata JSON output.

A new top-level diagramVersion field is now included in the metadata JSON for both SLD (GraphMetadata) and NAD (DiagramMetadata) diagrams. The version is resolved at startup via ServiceLoader from the PowsyblDiagramVersion SPI provider.

Example output:

{
  "diagramVersion" : "5.4.0-SNAPSHOT",
  ...
}

Changes

  • AbstractMetadata: added getDiagramVersion() method with @JsonProperty("diagramVersion") annotation, and @JsonPropertyOrder to ensure it appears first in the JSON output.

Note

Golden test JSON files may need updating to include the new diagramVersion field. Happy to update them if needed.

Closes #802

skyhww added 2 commits April 4, 2026 11:27
Use ServiceLoader to resolve the powsybl-diagram version at startup and include it as a top-level 'diagramVersion' field in the metadata JSON output for both SLD and NAD diagrams.

Closes powsybl#802

Signed-off-by: hanweiwei <duzielww@163.com>
Made-with: Cursor
Copy link
Copy Markdown
Member

@rolnico rolnico left a comment

Choose a reason for hiding this comment

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

Hello,
Thanks for the PR!
There are a few things to fix:

  • Could you follow the PR template for the PR description?
  • The DCO does not pass on your first commit, could you fix it? It's missing the sign-off.
  • There are many tests that do not pass now, since the expected files do not contain the diagram version yet. Could you fix them?

@rolnico
Copy link
Copy Markdown
Member

rolnico commented Apr 7, 2026

Also, two unrelated things:

  • Why are you using different accounts for the PR and for the commits?
  • Don't hesitate to join us on Slack if you are not already there, and present yourself and to tell us how you would like to contribute!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add powsybl-diagram current version number in the metadata

3 participants