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 #1370

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

riven-blade
Copy link
Contributor

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

@coveralls
Copy link

coveralls commented Jan 3, 2025

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%
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%
Totals Coverage Status
Change from base Build 12664971436: -1.1%
Covered Lines: 10823
Relevant Lines: 23318

💛 - Coveralls

@riven-blade riven-blade force-pushed the feat-1028 branch 4 times, most recently from 39f4203 to 734d77e Compare January 3, 2025 06:12
@liu-hm19 liu-hm19 self-assigned this Jan 3, 2025
@liu-hm19 liu-hm19 added the kind/feature Categorizes issue or PR as related to a new feature label Jan 3, 2025
@liu-hm19
Copy link
Contributor

liu-hm19 commented Jan 3, 2025

Thanks for your contribution! We'll review this PR a.s.a.p : )

@liu-hm19
Copy link
Contributor

liu-hm19 commented Jan 6, 2025

@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 rollback command, 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 Apply and State related methods? Instead, we have to implement them again, especially creating a new State struct in the release package. Could you please clarify the reasoning behind this?

cc @ffforest @Yangyang96

@riven-blade riven-blade force-pushed the feat-1028 branch 7 times, most recently from c6612bc to f20ca3a Compare January 8, 2025 10:46
@riven-blade
Copy link
Contributor Author

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

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 this pull request may close these issues.

feat: support release rollback
3 participants