-
Notifications
You must be signed in to change notification settings - Fork 74
Manage merge keys of top-level lists in a more consistent way #122
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
Conversation
amisevsk
left a comment
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.
4db2ec5 to
8cc8418
Compare
|
@kadel Ah yeah I can't believe I forgot that, given that I opened the blocker issue. Yes, these changes should be applied to a |
No problem. I realized that after I opened this PR myself :-/ . Will update it today. |
So after discussing the situation again, the plan would be:
So the main point here is that this PR should wait for the steps 1 and 2 to be finished. @amisevsk please complete or correct this if necessary. |
The above outline is basically it. There's some grey area about how integration will work down the line, but the main idea is to "fix" |
| for i := 0; i < visitorValue.NumField(); i++ { | ||
| unionMemberToRead := typeOfVisitor.Field(i).Name | ||
| unionMember := unionValue.FieldByName(unionMemberToRead) | ||
| if !unionMember.IsNil() { |
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.
In fact the function that should be called instead of IsNil is IsZero. I already fixed that in PR #98.
Signed-off-by: David Festal <dfestal@redhat.com>
Signed-off-by: David Festal <dfestal@redhat.com>
... since keys are now available directly in the top-level lists.
Signed-off-by: David Festal <dfestal@redhat.com>
Signed-off-by: David Festal <dfestal@redhat.com>
Signed-off-by: David Festal <dfestal@redhat.com>
Signed-off-by: David Festal <dfestal@redhat.com>
Signed-off-by: David Festal <dfestal@redhat.com>
8cc8418 to
e081817
Compare
Signed-off-by: David Festal <dfestal@redhat.com>
Signed-off-by: David Festal <dfestal@redhat.com>
Signed-off-by: David Festal <dfestal@redhat.com>
|
@kadel I removed the WIP flag since I reworked this PR to:
@amisevsk You might want to review the PR again. |
new schema is introduced in devfile/api#122
... to avoid referencing the top-level lists that should be merged by name. Signed-off-by: David Festal <dfestal@redhat.com>
Signed-off-by: David Festal <dfestal@redhat.com>
Signed-off-by: David Festal <dfestal@redhat.com>
amisevsk
left a comment
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 have significant issues with the implementation of keys and unions as it's implemented currently. In addition, the messy commit history and big changes in this PR make reviewing that code very difficult (I can't even cleanly leave multi-line comments).
I think to unblock the core functionality of this PR, this PR should remove /pkg/utils and related api files from the repo, and a new PR should be created that re-adds those files to allow a full, straightforward review.
pkg/utils/overriding/test-fixtures/merges/duplicate-with-plugin/plugin.yaml
Outdated
Show resolved
Hide resolved
pkg/utils/overriding/test-fixtures/patches/add-command-and-component/patch.yaml
Outdated
Show resolved
Hide resolved
cf [review comment](devfile#122 (comment)) Signed-off-by: David Festal <dfestal@redhat.com>
cf [review comment](devfile#122 (comment)) Signed-off-by: David Festal <dfestal@redhat.com>
... And use `Keyed` instead of `string` as the item type in the `TopLevelLists` type Signed-off-by: David Festal <dfestal@redhat.com>
Co-authored-by: Angel Misevski <amisevsk@redhat.com>
Co-authored-by: Angel Misevski <amisevsk@redhat.com>
Co-authored-by: Angel Misevski <amisevsk@redhat.com>
Co-authored-by: Angel Misevski <amisevsk@redhat.com>
Signed-off-by: David Festal <dfestal@redhat.com>
Signed-off-by: David Festal <dfestal@redhat.com>
according to this [review comment](devfile#122 (comment)) Signed-off-by: David Festal <dfestal@redhat.com>
Signed-off-by: David Festal <dfestal@redhat.com>
... according to the following [review coment](devfile#122 (comment)) Signed-off-by: David Festal <dfestal@redhat.com>
Simplify checkKeys function in overriding util by separating out the merging maps step Signed-off-by: Angel Misevski <amisevsk@redhat.com>
|
@davidfestal I've added ef7ba59 to simplify cc: @kadel |
amisevsk
left a comment
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.
Bit strange to approve a PR after I've committed to it, but it LGTM at this point.
Fix tests that check error messages to ignore order, since Go iterates through maps in a random order. Signed-off-by: Angel Misevski <amisevsk@redhat.com>
kadel
left a comment
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 👍
new schema is introduced in devfile/api#122
What does this PR do?
nameandid) to top-levelTODO:
What issues does this PR fix or reference?
fixes #102
Is your PR tested? Consider putting some instruction how to test your changes
Docs PR