Documentation
¶
Overview ¶
Package pr implements pull request operations for worker sessions.
It resolves a PR context from the TTAL_JOB_ID environment variable, then exposes operations to create, modify, comment on, and squash-merge PRs via the gitprovider abstraction. Merging is gated on reviewer LGTM approval recorded in the task's pr_id UDA.
Plane: worker
Index ¶
- func BuildPRURL(ctx *Context) string
- func CheckMergeable(ctx *Context) error
- func CommentCreate(ctx *Context, body string) (*gitprovider.Comment, error)
- func CommentList(ctx *Context) ([]*gitprovider.Comment, error)
- func Create(ctx *Context, title, body string) (*gitprovider.PullRequest, error)
- func Merge(ctx *Context, deleteAfterMerge bool) error
- func Modify(ctx *Context, title, body string) (*gitprovider.PullRequest, error)
- func PRIndex(ctx *Context) (int64, error)
- type Context
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildPRURL ¶
BuildPRURL constructs the full PR URL from the PR context.
func CheckMergeable ¶
CheckMergeable verifies the PR is not already merged and is mergeable. Returns an error if the PR cannot be merged (conflicts, failing CI, already merged).
func CommentCreate ¶
func CommentCreate(ctx *Context, body string) (*gitprovider.Comment, error)
func CommentList ¶
func CommentList(ctx *Context) ([]*gitprovider.Comment, error)
func Create ¶
func Create(ctx *Context, title, body string) (*gitprovider.PullRequest, error)
func Modify ¶
func Modify(ctx *Context, title, body string) (*gitprovider.PullRequest, error)
Types ¶
type Context ¶
type Context struct {
Task *taskwarrior.Task
Owner string
Repo string
Provider gitprovider.Provider
Info *gitprovider.RepoInfo
}
func ResolveContext ¶
func ResolveContextWithoutProvider ¶ added in v1.6.0
ResolveContextWithoutProvider resolves task metadata and git repo info without creating an authenticated provider. Used by CLI commands that proxy API calls through the daemon.