-
Notifications
You must be signed in to change notification settings - Fork 29
Adds a copy action #150
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
Adds a copy action #150
Conversation
|
Here is an experimental implementation, it was fairly straightforward :) |
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 personally really like this. It's simple nomenclature and implementation.
Annecdotally to me the alternative approach of using runtime expressions is more powerful in some ways, but also limiting in others. We've been using them at Speakeasy to represent complex concepts in Arazzo but unfortunately we've had to build escape hatches for places where they don't work (specifically the lack of conditionals). I'd propose we accept this as a minor version bump, and do that as an independent addition to this change as part of future work given a set of differing use-cases.
|
cc: @RobertCraigie @yjp20 Would be great to get your feedback on this one. |
cd596cc to
cbac889
Compare
|
Really I would like the "make a 1.1-dev branch" changes in a different pull request from the "add a copy action" changes. They are different things. |
@lornajane Are you referring to the unit tests infrastructure changes? Or would you like me to target a different branch all together? |
RobertCraigie
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.
Thanks for the ping @mikekistler! Super excited to see this is being worked on :)
I'll note that as someone that is not deeply familiar with Overlays yet, on first glance it was not immediately clear to me which json path was the one being updated, but it did click very quickly after I actually thought about it.
It feels silly to write that out as it is pretty clear now but that was my initial reaction, so I'm curious if you considered another name for the operation to be super explicit? e.g. copy-from?
I‘d like to have a separate PR that
This PR should only contain
|
|
I'll stand up a new PR for the 1.1-dev setup changes soon, and once we merge it, this one should get easier to review and I'll address the other comments. Sorry about the "mess" I iterated my way through the changes to get this PR in an as advanced state as possible. |
|
There, I just pushed #180 |
|
@baywet — #justfyi I am working on an updated overlay.md to illustrate what I mentioned on the call today. I am adding some examples and changing some headings for consistency because with a table of examples the inconsistency stands out more. I also changed some text from passive to active voice because the ghost of my technical writing professor in university is always sitting on my shoulder commenting on my passive voice. Hope to have this available very soon, though I am not 100% sure how to submit a PR to a PR. Should I submit a PR to baywet/Overlay-Specification/feat/copy-node and then mention that I did so here? |
|
For anybody following along, thanks for bearing with us while we clean up the branches/versions story. I've just "temporary aligned" things before retargeting to main (pending on #183). |
philsturgeon
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.
Really nice and simple. Solves the issues well. Welcome addition to overlays. 🫡
lornajane
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 think we could adjust the example content to tell more of a self-contained story so I added some suggestions but we're definitely close!
Co-authored-by: Lorna Jane Mitchell <[email protected]>
Co-authored-by: Ralf Handl <[email protected]>
Co-authored-by: Ralf Handl <[email protected]>
ralfhandl
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.
Sorry, one more nit.
Co-authored-by: Ralf Handl <[email protected]>
lornajane
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.
This is in great shape! Thanks @baywet and also all the reviewers
fixes #146
fixes #121
closes #140
Hi everyone,
I've tried to get to the simplest common denominator, and incorporate some of the feedback that was already provided:
I'm proposing to add a copy field to the action, that's mutually exclusive with remove or update. It's functionally equivalent to the update field except that it uses a JSON path to source the JSON Node instead of defining it inline.
I know there was some additional thinking about templating expressions, sourcing from env variables etc... But I think those can be considered orthogonal and be added in a separate PR by their champions. I'd like to get the smallest possible unit that brings a meaningful contribution through.
As an image is better than a thousand words, here are a couple of examples.
Copying a node to a node that already exists
Here the existing foo path item properties are being copied to the bar path item.
Copying a node to a node that DOES NOT already exists
Moving an item
A couple of todos if that gets consensus: