issue

package
v0.13.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 9, 2026 License: MIT Imports: 29 Imported by: 0

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.

View Source
var ErrReviewSyncNeeded = errors.New("review sync needed")

ErrReviewSyncNeeded is returned by reviewPreflight when reviewer commits on the @review branch conflict with the feature branch (or the tree is dirty) and the developer must run `git zf review sync` before closing.

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) (commit.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 commit.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)

	// PickBaseBranch lets the operator choose the merge target. It is called
	// only when no --base override was given AND more than one candidate branch
	// exists. defaultBase is pre-selected; branches is the candidate list.
	PickBaseBranch(ctx context.Context, defaultBase string, branches []string) (string, 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 New

func New(appConfig *config.AppConfig) Issue

func (Issue) GetRootCmd

func (i Issue) GetRootCmd() *cobra.Command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL