Closed smuu closed 3 months ago
The recent changes streamline method execution within the Instance
struct in pkg/instance/instance.go
by restricting certain methods to only operate in the 'Preparing' state, enhancing clarity in state management. The StartAsync
method now omits checks for sidecar states, simplifying the starting process for instances. Overall, these modifications lead to stricter control over state transitions, improving the robustness of instance management.
File | Change Summary |
---|---|
pkg/instance/errors.go |
Updated error messages (ErrSettingCommand , ErrSettingArgsNotAllowed , etc.) to restrict actions to the 'Preparing' state. |
pkg/instance/instance.go |
Updated multiple methods (SetCommand , SetArgs , AddPortTCP , etc.) to restrict execution to the 'Preparing' state. Removed sidecar state verification from StartAsync . |
sequenceDiagram
participant User
participant Instance
User->>Instance: SetCommand(command)
alt If in Preparing State
Instance-->>User: Command Set Successfully
else
Instance-->>User: Error: Cannot Set Command
end
User->>Instance: StartAsync()
Instance-->>User: Instance Started (no sidecar check)
π° In the meadow, under the sun,
A rabbit hops, the work is done.
With states now clear, and paths so bright,
Preparing joy, a simpler flight!
Hooray for changes, letβs all cheer,
A happy code, letβs spread the cheer! πΌ
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
@smuu some of the tests need to be updated to accommodate the new changes. They are failing right now: https://github.com/celestiaorg/knuu/actions/runs/10111618203/job/27963924324?pr=532#step:5:591
blocked by #533
As we have grouping now, I don't think this adds any value anymore. This was intended to make the usage more precise, but I think we achieved that by grouping.
As we have grouping now, I don't think this adds any value anymore. This was intended to make the usage more precise, but I think we achieved that by grouping.
Agreed. let's close this pr
Overview
The functions that are left to remove from comitted state will be fixed with https://github.com/celestiaorg/knuu/issues/519
Closes https://github.com/celestiaorg/knuu/issues/123
Summary by CodeRabbit
New Features
Bug Fixes
StartAsync
method.