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 attributes to CommitMeta
#5706
Conversation
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.
The apporach LGTM. I suspect the boilerplate in the Rest*TreeResource classes is just technically necessary.
This is apparently required to run in Jersey, which does not recognize annotations on interface methods. |
Codecov ReportBase: 79.27% // Head: 83.92% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #5706 +/- ##
============================================
+ Coverage 79.27% 83.92% +4.65%
============================================
Files 540 31 -509
Lines 16590 1493 -15097
Branches 1628 240 -1388
============================================
- Hits 13151 1253 -11898
+ Misses 2811 172 -2639
+ Partials 628 68 -560
Flags with carried forward coverage won't be shown. Click here to find out more. Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
versioned/transfer/src/test/java/org/projectnessie/versioned/transfer/AbstractExportImport.java
Outdated
Show resolved
Hide resolved
8f7d3c7
to
b3b86a5
Compare
CommitMeta
CommitMeta
Support multiple authors and "signed off by" names. Add explicit parent hash getter. Support list properties. Support deserializing old v1 JSON form in all contexts. Generate v1 (old) JSON in API v1 responses. Generate v2 (new) JSON in API v2 responses. Use v1 JSON for storage. We can switch to v2 JSON in storage in the next releases to make older versions capable of reading metadata JSON during rolling upgrades. This means that the new CommitMeta capabilities are added to the API, but are not yet supported by servers. Note: `@JsonView` annotations have to be both on the HTTP interface and the impl. class to allow both Quarkus and Jersey servers to work properly. Quarkus appears to see the annotation the interface, while Jersey appears to see the annotation on the impl. class. Closes projectnessie#5424
d85fcb3
to
ee51c8b
Compare
Squashed. One minor change remains for list properties, but otherwise the PR should be reviewable now. |
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.
LGTM! The JsonView stuff looks really nice.
Just a few comments for follow-ups.
@@ -35,6 +35,7 @@ public class TestParamObjectsSerialization extends TestModelObjectsSerialization | |||
static List<Case> goodCases() { | |||
final String branchName = "testBranch"; | |||
|
|||
// TODO: add test for CommitMeta v1 |
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.
OKay, let's tackle in a follow-up
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.
I think I meant v2... v1 serialization is tested by existing model serializations tests... I guess this comment is actually in the wrong place... also, general v2 serialization is covered by the "resteasy" and "deserializer" tests in this PR, but yes, I'll add more specific tests in a follow-up PR.
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.
MAPPER.writeValue(out, value); | ||
// Store commit metadata using v2 format. This is mostly to avoid duplicate data from v1 | ||
// attributes in the serialized form. | ||
MAPPER.writerWithView(ApiAttributesV1.class).writeValue(out, value); |
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.
THe comment doesn't match the code ;)
But yea, let's stick to V1 here to avoid a breaking serialization change in the storage code.
Can bump this one in a follow-up to V2 - maybe in two releases after the "Nessie release w/ v2"
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.
I fixed this comment (and removed the one above). Since it's a comment-only change I'll merge once CI passes.
Following up on projectnessie#5706
Following up on projectnessie#5706
Support multiple authors and "signed off by" names.
Add explicit parent hash getter.
Support list properties.
Support deserializing old v1 JSON form in all contexts.
Generate v1 (old) JSON in API v1 responses.
Generate v2 (new) JSON in API v2 responses.
Use v1 JSON for storage. We can switch to v2 JSON in storage in the next releases to make older versions capable of reading metadata JSON during rolling upgrades.
This means that the new
CommitMeta
capabilities are added to the API, but are not yet supported by servers.Note:
@JsonView
annotations have to be both on the HTTP interface and the impl. class to allow both Quarkus and Jersey servers to work properly. Quarkus appears to see the annotation the interface, which Jersey appears to see the annotation on the impl. class.Closes #5424