-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Return merged Resource on schema conflict #4876
Return merged Resource on schema conflict #4876
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
8ea4ac3
to
ba391b8
Compare
ba391b8
to
b2905b3
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4876 +/- ##
=====================================
Coverage 82.6% 82.6%
=====================================
Files 232 232
Lines 18862 18868 +6
=====================================
+ Hits 15595 15601 +6
Misses 2977 2977
Partials 290 290
|
0eaf6cd
to
1aab4d0
Compare
1aab4d0
to
0239f22
Compare
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.
#4876 (comment) can be addressed as a follow-up. I can work on it on Tuesday.
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 that detect
should be changed to handle conflicts better.
4f1da09
to
9f117ab
Compare
Co-authored-by: Robert Pająk <[email protected]>
1d6c1ae
to
b062513
Compare
Big step forward! Thanks for the work here! |
Resolve #2341
Why not just log?
By returning a partial result (the merged conflicting resource), the user is able to decide what they want to do. If we just logged this as a warning, the user may unknowingly use a
Resource
they would rather have dropped or fixed.Specification compliance
The specification states:
Based on this language we are given a fair amount of freedom to handle this conflict in the way we see fit. Looking at other language implementations, Go is the only one that will actually return an error and does not make the merge:
Given the specification also states:
Trying to resolve this conflict by actually using the schemas to make a transformation is not compliant. Additionally, given the reluctance to stabilize these transformations, it does not seem prudent to not provide a better user story here.