Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetValidatedBranchName ¶
func GetValidatedBranchName( ctx context.Context, branchNameFlag string, cfg *config.Config, presenter PresenterInterface, gitClient *git.GitClient, assumeYes bool, ) (string, error)
GetValidatedBranchName is a helper function that can be used by the command before initializing the workflow. It's not a step itself.
Types ¶
type CheckAndPromptStashStep ¶
type CheckAndPromptStashStep struct {
GitClient *git.GitClient
Presenter PresenterInterface
AssumeYes bool
DidStash bool // ADDED: This field will track if a stash was performed.
}
--- Step 2: Check for clean workspace and offer to stash ---
func (*CheckAndPromptStashStep) Description ¶
func (s *CheckAndPromptStashStep) Description() string
type CheckOnMainBranchStep ¶
type CheckOnMainBranchStep struct {
GitClient *git.GitClient
Presenter PresenterInterface
}
--- Step 1: Check if on the main branch ---
func (*CheckOnMainBranchStep) Description ¶
func (s *CheckOnMainBranchStep) Description() string
type CreateAndPushBranchStep ¶
--- Step 4: Create and push the new branch ---
func (*CreateAndPushBranchStep) Description ¶
func (s *CreateAndPushBranchStep) Description() string
type PresenterInterface ¶
type PresenterInterface interface {
Error(format string, a ...any)
Info(format string, a ...any)
Success(format string, a ...any)
Detail(format string, a ...any)
Step(format string, a ...any)
Summary(format string, a ...any)
Newline()
PromptForConfirmation(prompt string) (bool, error)
PromptForInput(prompt string) (string, error)
Advice(format string, a ...any)
}
PresenterInterface defines the UI methods the workflow engine needs. This decouples the engine from the concrete ui.Presenter.
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
Runner manages the execution of a series of workflow steps.
func NewRunner ¶
func NewRunner(presenter PresenterInterface, assumeYes bool) *Runner
NewRunner creates a new workflow runner.
type Step ¶
type Step interface {
// Description returns a user-friendly string explaining what this step will do.
// This is used to build the "plan" shown to the user before confirmation.
Description() string
// PreCheck runs any prerequisite validations before the main execution.
// If it returns an error, the entire workflow is aborted.
PreCheck(ctx context.Context) error
// Execute performs the primary action of the step.
Execute(ctx context.Context) error
}
Step represents a single, discrete, and reusable action within a larger workflow.
type UpdateMainBranchStep ¶
--- Step 3: Update the main branch from remote ---
func (*UpdateMainBranchStep) Description ¶
func (s *UpdateMainBranchStep) Description() string
Click to show internal directories.
Click to hide internal directories.