Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add version endpoint #4196

Conversation

paullatzelsperger
Copy link
Member

@paullatzelsperger paullatzelsperger commented May 18, 2024

What this PR changes/adds

This PR adds several things:

  • an ApiVersionService that API modules
  • a new API called the "Version API", that exposes that version information in an endpoint under /.well-known/api/v1/version
  • GH checks to verify the version information was changed if an API changed.

An example of such a check is here:
https://github.com/paullatzelsperger/DataSpaceConnector/actions/runs/9141255716/job/25135444163

Why it does that

client information

Further notes

The check Verify-Api-Version is quite crude now, for example it does not assert that the version was actually incremented or, that the date string is plausible. Let's see how far we get and improve from there.

Linked Issue(s)

Closes #4181

Please be sure to take a look at the contributing guidelines and our etiquette for pull requests.

@paullatzelsperger paullatzelsperger added enhancement New feature or request api Feature related to the (REST) api github_actions Pull requests that update GitHub Actions code labels May 18, 2024
@paullatzelsperger paullatzelsperger marked this pull request as draft May 18, 2024 10:58
@paullatzelsperger paullatzelsperger changed the title feat/4181 add version endpoint feat: add version endpoint May 18, 2024
@codecov-commenter
Copy link

codecov-commenter commented May 18, 2024

Codecov Report

Attention: Patch coverage is 44.73684% with 42 lines in your changes are missing coverage. Please review.

Project coverage is 75.23%. Comparing base (7f20ba5) to head (97ad718).
Report is 268 commits behind head on main.

Files Patch % Lines
...or/api/management/version/VersionApiExtension.java 0.00% 23 Missing ⚠️
...c/api/observability/ObservabilityApiExtension.java 60.00% 3 Missing and 1 partial ⚠️
...onfiguration/ControlApiConfigurationExtension.java 60.00% 3 Missing and 1 partial ⚠️
...iguration/ManagementApiConfigurationExtension.java 60.00% 3 Missing and 1 partial ⚠️
...dentitytrust/sts/StsApiConfigurationExtension.java 60.00% 3 Missing and 1 partial ⚠️
...va/org/eclipse/edc/boot/BootServicesExtension.java 0.00% 1 Missing ⚠️
...onnector/api/management/version/v1/VersionApi.java 0.00% 1 Missing ⚠️
...lipse/edc/spi/system/apiversion/VersionRecord.java 0.00% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4196      +/-   ##
==========================================
+ Coverage   71.74%   75.23%   +3.49%     
==========================================
  Files         919     1015      +96     
  Lines       18457    20622    +2165     
  Branches     1037     1161     +124     
==========================================
+ Hits        13242    15515    +2273     
+ Misses       4756     4593     -163     
- Partials      459      514      +55     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jimmarino
Copy link
Contributor

jimmarino commented May 18, 2024

Let's discuss this. I want to align what we do here with the approach to versioning endpoints in DSP, which is not to say this is un-aligned. I'd like to make sure we have a wholistic approach and a DR for it.

@paullatzelsperger
Copy link
Member Author

paullatzelsperger commented May 18, 2024

I'd like to make sure we have a wholistic approach and a DR for it.

https://github.com/eclipse-edc/Connector/tree/main/docs/developer/decision-records/2023-11-09-api-versioning

However, the D-R does not go into details on how the version information is to be stored (obviously it has to be a file).

To me, the more valuable feature is the CI check anyways, and it took way more time to get quite right (GitHub is a bit picky with git checkouts). I'm less worried about what the URL path or the response schema is but this is the reason it is still in draft :)

@paullatzelsperger paullatzelsperger force-pushed the feat/4181_add_version_endpoint branch 3 times, most recently from 2164238 to 1e040cb Compare May 18, 2024 16:37
@jimmarino
Copy link
Contributor

I'd like to make sure we have a wholistic approach and a DR for it.

https://github.com/eclipse-edc/Connector/tree/main/docs/developer/decision-records/2023-11-09-api-versioning

However, the D-R does not go into details on how the version information is to be stored (obviously it has to be a file).

To me, the more valuable feature is the CI check anyways, and it took way more time to get quite right (GitHub is a bit picky with git checkouts). I'm less worried about what the URL path or the response schema is but this is the reason it is still in draft :)

I'm referring to version discoverability similar to what DSP has. We can discuss.

@paullatzelsperger paullatzelsperger force-pushed the feat/4181_add_version_endpoint branch 14 times, most recently from 299566e to 58845ed Compare May 21, 2024 10:25
@paullatzelsperger paullatzelsperger force-pushed the feat/4181_add_version_endpoint branch 3 times, most recently from df07a8e to 97ad718 Compare May 22, 2024 05:10
@paullatzelsperger paullatzelsperger marked this pull request as ready for review May 22, 2024 05:59
.github/workflows/verify.yaml Outdated Show resolved Hide resolved
.github/workflows/verify.yaml Outdated Show resolved Hide resolved
.github/actions/check-api-version-file/action.yml Outdated Show resolved Hide resolved
@paullatzelsperger paullatzelsperger merged commit f56d98c into eclipse-edc:main May 23, 2024
16 checks passed
@paullatzelsperger paullatzelsperger deleted the feat/4181_add_version_endpoint branch May 23, 2024 04:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Feature related to the (REST) api enhancement New feature or request github_actions Pull requests that update GitHub Actions code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Management API: add version information endpoint
5 participants