Documentation
¶
Overview ¶
Package lock provides functionality for locking and unlocking branches in a stack.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Deps ¶ added in v0.30.1
type Deps struct {
Engine Engine
Out output.Output
// PRSync pushes the lock metadata and refreshes the affected PRs.
PRSync actions.PRSync
// Submit runs the nested submit offered before locking unpushed branches.
Submit submit.Deps
}
Deps are the collaborators lock and unlock need. Adapters build them from their own runtime state; the action never sees bootstrap types.
type Engine ¶ added in v0.30.1
type Engine interface {
engine.BranchLookup
Graph(ctx context.Context, strategy engine.SortStrategy) *engine.StackGraph
ReadBranchRemoteStatuses(ctx context.Context, branches engine.Branches) engine.BranchRemoteStatuses
SetLocked(ctx context.Context, branches engine.Branches, reason engine.LockReason) (engine.BatchLockResult, error)
}
Engine lists exactly the engine methods lock and unlock call.
type Handler ¶
type Handler interface {
// PromptSubmitBeforeLock prompts user to submit unpushed changes before locking
// Returns true to submit before locking, false to skip
PromptSubmitBeforeLock(unpushedBranches []string) (bool, error)
// PromptUnlockDownstack prompts user to also unlock downstack locked branches
// Returns true to unlock downstack branches, false to skip
PromptUnlockDownstack(lockedBranchNames []string) (bool, error)
// GetSubmitHandler returns a handler for the nested submit operation
SubmitHandler() submit.Handler
// Cleanup restores terminal state (may be no-op)
Cleanup()
// IsInteractive returns true if the handler supports interactive prompts
IsInteractive() bool
}
Handler receives events from lock/unlock actions
type NullHandler ¶
NullHandler is a no-op handler for when nil is passed. It embeds handler.NullBase for Cleanup() and IsInteractive().
func (*NullHandler) PromptSubmitBeforeLock ¶
func (h *NullHandler) PromptSubmitBeforeLock([]string) (bool, error)
PromptSubmitBeforeLock implements Handler. Returns false (skip submit) for null handler.
func (*NullHandler) PromptUnlockDownstack ¶
func (h *NullHandler) PromptUnlockDownstack([]string) (bool, error)
PromptUnlockDownstack implements Handler. Returns false (skip) for null handler.
func (*NullHandler) SubmitHandler ¶ added in v0.30.1
func (h *NullHandler) SubmitHandler() submit.Handler
SubmitHandler implements Handler. Returns nil for null handler.