Skip to content
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

feat: support release rollback #1028

Open
healthjyk opened this issue Apr 10, 2024 · 9 comments · May be fixed by #1370
Open

feat: support release rollback #1028

healthjyk opened this issue Apr 10, 2024 · 9 comments · May be fixed by #1370
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature

Comments

@healthjyk
Copy link
Contributor

healthjyk commented Apr 10, 2024

What would you like to be added?

support release rollback, i.e. kusion apply with specified release

Why is this needed?

rollback to the last success release quickly

@healthjyk healthjyk added the kind/feature Categorizes issue or PR as related to a new feature label Apr 10, 2024
@healthjyk healthjyk self-assigned this Apr 10, 2024
@SparkYuan SparkYuan changed the title feat: support roll-back, i.e. kusion apply with specified release feat: support release rollback Jun 13, 2024
@liu-hm19 liu-hm19 assigned liu-hm19 and unassigned healthjyk Aug 5, 2024
@liu-hm19 liu-hm19 modified the milestone: v0.13.0 Aug 5, 2024
@SparkYuan
Copy link
Member

Sure, welcome to join us!

@riven-blade
Copy link
Contributor

kusion release rollback --revision=[num]
kusion rollback --revision=[num]

Which of these two methods do you think is better?

@ffforest
Copy link
Contributor

ffforest commented Dec 27, 2024

kusion release rollback --revision=[num] kusion rollback --revision=[num]

Which of these two methods do you think is better?

I think out of these two, kusion release rollback is better, since the user would typically do the following together:

  1. kusion release list, shows all release revisions under a stack
  2. kusion release show --revision, selects a particular revision to look into
  3. kusion release rollback, use the selected revision to rollback (effectively roll forward because it involves a new apply)

kusion release rollback is more intuitive in this case.
Another option may be simply supporting kusion apply with an additional flag --release-revision xxx, with the benefit of one less concept.

cc @liu-hm19

@riven-blade
Copy link
Contributor

I thought about a few points and wanted to discuss it. What is our positioning of the rollback behavior? Is it different from the normal apply? Will a new release version be generated? Or is it just a rollback version, parallel to the release version? role. We must think about these designs in advance before we can proceed with code development.

@liu-hm19
Copy link
Contributor

liu-hm19 commented Jan 2, 2025

@riven-blade Well, what we expect for the kusion release rollback sub-command is to conveniently help users roll back to a specific succeeded Release version. In particular, the sub-command will use the Spec of the specified succeeded Release. Therefore, from the perspective of execution, it should be similar to the command of kusion apply --spec-file [/path/to/spec.yaml] and will result in the creation of a new revision.

If you have any different thoughts on the kusion release rollback sub-command, feel free to share in the comments at any time!

@adohe
Copy link
Contributor

adohe commented Jan 2, 2025

For reference implementation, I would suggest you guys take a look at helm rollback, helm provides similar functionality to rollback release to a previous revision, code snippet can be found here. cc @riven-blade @liu-hm19

@riven-blade
Copy link
Contributor

I looked through the code logic of helm rollback. It found the previousRelease version and generated a targetRelease based on it, and then changed currentRelease -> targetRelease. In our scenario, our apply deployment will have some parameters - -yes, detail, diff, etc., are they needed in rollback?

@liu-hm19
Copy link
Contributor

liu-hm19 commented Jan 2, 2025

@riven-blade I think during the execution of kusion release rollback, it is still necessary to retain the flags related to previewing the apply diffs. And I'll take another close look at how helm's rollback is implemented. Could you provide a brief implementation design based on our discussion?

@riven-blade
Copy link
Contributor

riven-blade commented Jan 2, 2025

Okay, I'm doing it now. I'll make a first version first. In the design of helm, I understand that it has almost no terminal interaction. We have more terminal interaction in apply. I took a rough look at its rollback and packaged the old version release into a target release, deploy.

@riven-blade riven-blade linked a pull request Jan 3, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants