Documentation
¶
Index ¶
- func CommitURL(repo, sha string) string
- func TaskIDFromBranch(branch string) string
- type CommandRunner
- type CommitInfo
- type Helper
- func (h *Helper) CurrentBranch(ctx context.Context) (string, error)
- func (h *Helper) GetCommitInfo(ctx context.Context, sha string) (*CommitInfo, error)
- func (h *Helper) GetPRInfo(ctx context.Context, number int, repo string) (*PRInfo, error)
- func (h *Helper) GetRepoSlug(ctx context.Context) (string, error)
- type OSCommandRunner
- type PRInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TaskIDFromBranch ¶
TaskIDFromBranch extracts a ClickUp task ID from a git branch name.
Patterns matched (in order):
- "CU-abc123-description" → "abc123" (ClickUp native ID)
- "feature/CU-abc123-desc" → "abc123" (with branch prefix)
- "PROJ-42-description" → "PROJ-42" (custom task ID)
- "feature/PROJ-42-desc" → "PROJ-42" (with branch prefix)
Returns "" if no task ID pattern is found.
Types ¶
type CommandRunner ¶
type CommandRunner interface {
Run(ctx context.Context, name string, args ...string) ([]byte, error)
}
CommandRunner abstracts running external commands for testability.
type CommitInfo ¶
CommitInfo holds metadata about a git commit.
type Helper ¶
type Helper struct {
Runner CommandRunner
}
Helper provides git and gh CLI operations.
func (*Helper) CurrentBranch ¶
CurrentBranch returns the current git branch name.
func (*Helper) GetCommitInfo ¶
GetCommitInfo fetches commit metadata using git log. If sha is empty, defaults to HEAD.
type OSCommandRunner ¶
type OSCommandRunner struct{}
OSCommandRunner implements CommandRunner using os/exec.
Click to show internal directories.
Click to hide internal directories.