-
Notifications
You must be signed in to change notification settings - Fork 225
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
Fixing updates in porch #3329
Comments
This makes sense to me. @droot and I were chatting and we discussed the idea of surfacing another field, likely the merge strategy, and exploring both options that way. But I do agree that we can better represent what's actually happening by doing what you suggest: allowing updates to CloneTask trigger reclone-and-replay, adding an UpdateTask triggers the merge. The advantage of your proposal here over an explicit field is that if/when we feel confident that one way is better than the other, at that point we simply disallow either editing the CloneTask or adding the UpdateTask, we aren't left with a vestigial |
Sounds very reasonable, so +1. Few things come to mind:
|
Yeah, so doing a merge update after doing replays should be fine. With the current task model and replay, there isn't any difference between a package created from The logic for handling the tasks in the package revision update function will need to change. Essentially there should be two options:
|
Yeah, looks good to me. |
When we see an update that changes the first Clone task, we treat that as a signal that the user wants to use the "reclone and replay" strategy for updating the package. See kptdev#3329 for background.
When we see an update that changes the first Clone task, we treat that as a signal that the user wants to use the "reclone and replay" strategy for updating the package. See kptdev#3329 for background.
It sounds like the replay approach to updates wouldn't be supported by the kpt CLI? |
I don't see any reason why we couldn't support it in the CLI. |
Some thoughts on update behaviors:
Some concrete update scenarios I've run into:
In all of those cases, I'd expect the blueprint changes should not clobber downstream customizations. |
When we see an update that changes the first Clone task, we treat that as a signal that the user wants to use the "reclone and replay" strategy for updating the package. See kptdev#3329 for background.
When we see an update that changes the first Clone task, we treat that as a signal that the user wants to use the "reclone and replay" strategy for updating the package. See kptdev#3329 for background.
* Support reclone and replay for updating clone tasks When we see an update that changes the first Clone task, we treat that as a signal that the user wants to use the "reclone and replay" strategy for updating the package. See #3329 for background. * e2e: dump logs * git: Need to force-push branches Eventually we should compare-and-swap, but we want to be able to push our changes even when they are not fast-forward.
* Support reclone and replay for updating clone tasks When we see an update that changes the first Clone task, we treat that as a signal that the user wants to use the "reclone and replay" strategy for updating the package. See kptdev#3329 for background. * e2e: dump logs * git: Need to force-push branches Eventually we should compare-and-swap, but we want to be able to push our changes even when they are not fast-forward.
We are currently discussing two different alternatives for doing updates in porch. It is the current merge behavior from kpt (which is roughly equivalent to how we can do a merge commit in git) and the reclone-and-replay approach (which roughly corresponds to rebase in git). We are still discussing which option is the best long term, with a possible solution being that we support both.
Unfortunately our current porch API and implementation of update is a mix of both. Users specify the new upstream through the CloneTask, even though we actually do merge updates. This leads to very strange task lists, in particular since the updateMutation adds CloneTasks to the history. This is obviously confusing for further updates (which clone task should be used?) and for replaying tasks for creating new revisions (since the actual tasks used isn't accurately represented in the task list).
Luckily I think our API with tasks provide a simple and intuitive way to handle both ways of updating a package:
For doing a merge update (the only type of update we are currently supporting), users should add an
UpdateTask
to the task list and pass the PackageRevision to theUpdate
endpoint of the API. TheUpdateTask
will include a reference to the new Upstream and potentially the merge strategy that should be used. TheUpdateTask
will map directly to theupdateMutation
, that will generate a commit with the changes that corresponds with theUpdateTask
. The updated package will have a task list that accurately describes the mutations of the package, and it is possible to replay the tasks to end up at the same.For doing a reclone-and-replay, the correct way to specify this through the API is to update the original
CloneTask
. This will then cause the update to happen by recloning the package with the new version and then replay the tasks (possibly multiple times for the iterative version of replay updates). This will not lead to anyUpdateTask
in the task history of the revision, and this makes sense since there haven't actually been a merge, just recloning and replaying the update. Again, the resulting PackageRevision can be recreated by replaying the tasks.Since we are still exploring the replay updates, our first goal should be to fix the API to allow for the merge updates. This means creating and handling UpdateTasks. This will give us updates equivalent to kpt in porch. Then we can continue to explore reclone-and-replay, and we can add support for this without impacting the merge updates.
The text was updated successfully, but these errors were encountered: