Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrBranchLockedForReview = errors.New("branch locked for review")
ErrBranchLockedForReview is returned by reviewPreflight when the branch is locked because a review is in progress. Use errors.Is to detect it.
View Source
var ErrReviewChangesRequested = errors.New("reviewer requested changes")
ErrReviewChangesRequested is returned by reviewPreflight when the reviewer has requested changes. Use errors.Is to detect it.
Functions ¶
This section is empty.
Types ¶
type ClosePrompter ¶ added in v0.9.5
type ClosePrompter interface {
// PickBranch is called only when at least one in-progress branch exists.
// A non-nil error indicates cancellation or an internal failure.
PickBranch(ctx context.Context, branches []store.BranchRow, current string) (*store.BranchRow, error)
// PickStrategy is called only when MergeDryRun reports no conflicts.
PickStrategy(ctx context.Context) (MergeStrategy, error)
// ConfirmMerge gates the actual merge. confirmed=false means the operator
// declined; runClose prints "Aborted." and returns nil.
ConfirmMerge(ctx context.Context, branch, base string, strategy MergeStrategy) (confirmed bool, err error)
// ComposeMessage runs inline AFTER the strategy has staged its changes
// (after MergeSquash / MergeRebase+soft-reset / MergeNoFFNoCommit). The
// prefill is already populated with issue-derived type/scope and a
// strategy-specific subject. The returned tui.CommitOption is passed to
// git.Client.Commit verbatim.
ComposeMessage(ctx context.Context, prefill map[string]any) ([]byte, tui.CommitOption, error)
// PickTrackerStatus is called only when a tracker is configured AND the
// merge succeeded. An empty return signals "no selection" — the caller
// decides whether to treat that as skip or abort.
PickTrackerStatus(ctx context.Context, issueID, trackerType string, statuses []string) (string, error)
// ConfirmDeleteBranch runs after a successful merge.
ConfirmDeleteBranch(ctx context.Context, branchName string) (delete bool, err error)
}
ClosePrompter resolves every user-facing decision in the close flow. The production implementation drives huh forms; the test implementation in close_prompter_test.go returns canned values.
Each method maps 1:1 to a huh.NewForm call in the pre-refactor close.go. The order below mirrors the order calls happen in runClose.
type Issue ¶
type Issue struct {
// contains filtered or unexported fields
}
func (Issue) GetRootCmd ¶
type MergeStrategy ¶ added in v0.8.0
type MergeStrategy string
const ( StrategySquash MergeStrategy = "squash" StrategyRebase MergeStrategy = "rebase" StrategyClassic MergeStrategy = "classic" )
Click to show internal directories.
Click to hide internal directories.