-
Notifications
You must be signed in to change notification settings - Fork 51
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
Add v2 endpoints #325
Add v2 endpoints #325
Conversation
@emerkle826, I took the liberty of moving this PR to draft mode to make it clear it shouldn't be merged. You can take it out of draft mode when the time comes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I'll need a bit more time on this one. I left a couple of questions :)
One big question here - what sort of tests do we have in play for the API? Do we have any sort of e2e testing right now? Do we need it?
management-api-server/src/test/resources/com/datastax/mgmtapi/operator-sample.json
Outdated
Show resolved
Hide resolved
"openAPI": { | ||
"info": { | ||
"version": "0.1", | ||
"version": "0.1.66", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be where the version change to 0.1.67 has to happen (removing the other comment)
@Content( | ||
mediaType = MediaType.APPLICATION_JSON, | ||
schema = @Schema(implementation = EndpointStatesResponse.class))) | ||
public Response getEndpointStates() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs a Test somewhere
6f3e12e
to
17e1eca
Compare
From discussions earlier today, if we already have a test framework for the management API, could we please get some e2e tests on this so that all of the new client methods are exercised - once that's done, I think I'll be pretty confident in this PR :) The other alternative is to check the tests that are added as part of the code gen - @emerkle826 if you are comfortable that those are sufficient we can stick with them. Bearing in mind that this will all be e2e tested in Reaper's tests anyway (but it is still nice to have thorough tests here too...) |
Testing the generated client methods will be difficult with how the generation happens currently. The client source and tests are generated with every compile, but they are not compiled during the compile of the project. Compiling the client requires you to issue another Maven command (i.e. mvn install -f ./management-api-server/target/generated-sources/openapi/java-client/pom.xml from the root of this project. This is a bit of a chicken-and-egg problem in that generated sources are excluded from git version control (things like build artifacts and stuff that is compiled every time you build). So there is no generated client that is actually checked in to git source control. The other issue for the generated client is that tests are also generated, but they are practically useless. All of the tests generated are effectively unit tests, and none of them do any validation other than that the client methods can be called, which is really just a validation of the compile-ability of the generated source. |
Unfortunately, they are useless. |
17e1eca
to
70054ad
Compare
@Miles-Garnsey I've reworked this PR/branch. I've pulled out some of the changes that are not scoped specifically to implementing the v2 endpoints endpoint. I've reverted the This PR still should be rebased after PRs #333, #334 and #335 are merged. |
70054ad
to
1eda5d3
Compare
@Miles-Garnsey Gonna shelve this version for now in favor of #343. I will revisit this PR for a refactor week. The current endpoint returns what we need and #343 fixes the annotations so that the generated client has the proper return type. |
Closing this as it will be handled in a refactor week |
Fixes #326
This PR adds/updates v2 endpoints endpoint (I know) to support new operations to be used by Cassandra Reaper
DO NOT MERGE this until #324 is approved and merge. The rebase this branch off that merge into master