feat: support release rollback
What type of PR is this?
feature
What this PR does / why we need it:
feat: rollback release
Which issue(s) this PR fixes:
Fixes #1028
Special notes for your reviewer:
Does this PR introduce a user-facing change?
feat: support release rollback
Additional documentation e.g., design docs, usage docs, etc.:
feat: support release rollback
Pull Request Test Coverage Report for Build 12669579227
Details
- 331 of 969 (34.16%) changed or added relevant lines in 19 files are covered.
- 44 unchanged lines in 5 files lost coverage.
- Overall coverage decreased (-1.1%) to 46.415%
| Changes Missing Coverage | Covered Lines | Changed/Added Lines | % |
|---|---|---|---|
| pkg/cmd/cmd.go | 0 | 1 | 0.0% |
| pkg/engine/operation/port_forward.go | 2 | 4 | 50.0% |
| pkg/engine/apply/utils.go | 0 | 3 | 0.0% |
| pkg/engine/apply/state/summary.go | 13 | 17 | 76.47% |
| pkg/engine/apply/print_details.go | 55 | 61 | 90.16% |
| pkg/cmd/meta/meta_options.go | 0 | 12 | 0.0% |
| pkg/cmd/apply/apply_options.go | 0 | 15 | 0.0% |
| pkg/engine/apply/port_forward.go | 0 | 17 | 0.0% |
| pkg/cmd/preview/preview_options.go | 3 | 24 | 12.5% |
| pkg/cmd/apply/apply.go | 0 | 29 | 0.0% |
| <!-- | Total: | 331 | 969 |
| Files with Coverage Reduction | New Missed Lines | % |
|---|---|---|
| pkg/cmd/preview/preview.go | 1 | 31.68% |
| pkg/engine/operation/port_forward.go | 1 | 32.28% |
| pkg/engine/resource/graph/storages/local.go | 6 | 7.69% |
| pkg/util/signal/signal.go | 17 | 0.0% |
| pkg/cmd/apply/apply.go | 19 | 0.0% |
| <!-- | Total: | 44 |
| Totals | |
|---|---|
| Change from base Build 12664971436: | -1.1% |
| Covered Lines: | 10823 |
| Relevant Lines: | 23318 |
💛 - Coveralls
Thanks for your contribution! We'll review this PR a.s.a.p : )
@riven-blade Hi, I've just reviewed the code you submitted, and I think that it looks good to me overall. However, there are still two points I'd like to confirm:
- For the
kusion release rollbackcommand, should it only allow users to roll back to a previously successfully applied release? Since rolling back to a failed revision doesn't seem meaningful, should we add some validation for this in the command? - Why can't we directly reuse the existing
ApplyandStaterelated methods? Instead, we have to implement them again, especially creating a newStatestruct in thereleasepackage. Could you please clarify the reasoning behind this?
cc @ffforest @Yangyang96
Hi, I have made major adjustments to the abstraction of the previous apply logic, and the different operations between apply and rollback are completed in the prepare stage. At the same time, the place where fixme was identified in the previous apply logic has been fixed. Now there is no problem with the code logic when I test it, but I think there are still areas where the code can be optimized, and the priority is not that high. I don’t want a PR to be so heavy