pr

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2026 License: MIT Imports: 6 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildPRURL

func BuildPRURL(ctx *Context) string

BuildPRURL constructs the full PR URL from the PR context.

func CheckMergeable

func CheckMergeable(ctx *Context) error

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 Merge

func Merge(ctx *Context, deleteAfterMerge bool) error

func Modify

func Modify(ctx *Context, title, body string) (*gitprovider.PullRequest, error)

func PRIndex added in v1.0.0

func PRIndex(ctx *Context) (int64, error)

PRIndex returns the PR index from the task's PRID UDA.

Types

type Context

type Context struct {
	Task     *taskwarrior.Task
	Owner    string
	Repo     string
	Provider gitprovider.Provider
	Info     *gitprovider.RepoInfo
}

func ResolveContext

func ResolveContext() (*Context, error)

Jump to

Keyboard shortcuts

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