devstream icon indicating copy to clipboard operation
devstream copied to clipboard

:four_leaf_clover: `Proposal`: Support for rollback in case of error in intermediate steps

Open aFlyBird0 opened this issue 3 years ago • 5 comments

What Would You Like to Add? Why Is This Needed?

https://github.com/devstream-io/devstream/blob/ed469dc9332a11be0b96c27b38d4fd507dc6508b/internal/pkg/upgrade/upgrade.go#L133-L165

Design

Anything else

aFlyBird0 avatar Oct 13 '22 17:10 aFlyBird0

I want to do it

0zyt avatar Oct 16 '22 07:10 0zyt

I want to do it

Do as much as you like!

aFlyBird0 avatar Oct 16 '22 07:10 aFlyBird0

@xavier-hou Hi,Do you think it is necessary to consider being interrupted by a signal such as CTRL+C?

0zyt avatar Oct 16 '22 07:10 0zyt

This is the commit on my branch:https://github.com/0zyt/devstream/commit/3f62a93a92c6fbf018e332a5fdeb7d3e85a7bfed

I had a discussion with @aFlyBird0 about writing test for this feature because I couldn't find a better way to test this feature.

06a239906039e95fe4b78db8e2cdbff

The codes above from @aFlyBird0 ,

I think this is a practical and effective way to test, but it doesn't look elegant at first glance. The other way is to keep it simple and elegant and not change the function signature and to verify it locally by me or other members, but this is not a transparent way to test an open source project and may not be good enough. So I would like to hear your thoughts.

@xavier-hou @Danielhui @steinliber @IronCore864

I will PR after getting a better way.

0zyt avatar Oct 16 '22 14:10 0zyt

nd a better way to test this feature.

I think this is a way to test it, but as you said, it changes the signature of the func, which might be a bit confusing to read.

I personally suggest a better way to test it. What do you guys think?

IronCore864 avatar Oct 17 '22 08:10 IronCore864