task

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2025 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateIssue

func CreateIssue(login *auth.Login, repoOwner, repoName string, opts kmup.CreateIssueOption) error

CreateIssue creates an issue in the given repo and prints the result

func CreateMilestone

func CreateMilestone(login *auth.Login, repoOwner, repoName, title, description string, deadline *time.Time, state kmup.StateType) error

CreateMilestone creates a milestone in the given repo and prints the result

func CreatePull

func CreatePull(ctx *context.KmupContext, base, head string, allowMaintainerEdits *bool, opts *kmup.CreateIssueOption) (err error)

CreatePull creates a PR in the given repo and prints the result

func CreatePullReview

func CreatePullReview(ctx *context.KmupContext, idx int64, status kmup.ReviewStateType, comment string, codeComments []kmup.CreatePullReviewComment) error

CreatePullReview submits a review for a PR

func EditIssue

func EditIssue(ctx *context.KmupContext, client *kmup.Client, opts EditIssueOption) (*kmup.Issue, error)

EditIssue edits an issue and returns the updated issue.

func GetDefaultPRBase

func GetDefaultPRBase(login *auth.Login, owner, repo string) (string, error)

GetDefaultPRBase retrieves the default base branch for the given repo

func GetDefaultPRHead

func GetDefaultPRHead(localRepo *local_git.KmdoRepo) (owner, branch string, err error)

GetDefaultPRHead uses the currently checked out branch, tries to find a remote that has a branch with the same name, and extracts the owner from its URL. If no remote matches, owner is empty, meaning same as head repo owner.

func GetDefaultPRTitle

func GetDefaultPRTitle(header string) string

GetDefaultPRTitle transforms a string like a branchname to a readable text

func GetHeadSpec

func GetHeadSpec(owner, branch, baseOwner string) string

GetHeadSpec creates a head string as expected by kmup API

func LabelsExport

func LabelsExport(labels []*kmup.Label, path string) error

LabelsExport save list of labels to disc

func OpenFileInEditor

func OpenFileInEditor(filename string) error

OpenFileInEditor opens filename in a text editor, and blocks until the editor terminates.

func ParseDiffComments

func ParseDiffComments(diffFile string) ([]kmup.CreatePullReviewComment, error)

ParseDiffComments reads a diff, extracts comments from it & returns them in a kmup compatible struct

func PullCheckout

func PullCheckout(
	login *auth.Login,
	repoOwner, repoName string,
	forceCreateBranch bool,
	index int64,
	callback func(string) (string, error),
) error

PullCheckout checkout current workdir to the head branch of specified pull request

func PullClean

func PullClean(login *auth.Login, repoOwner, repoName string, index int64, ignoreSHA bool, callback func(string) (string, error)) error

PullClean deletes local & remote feature-branches for a closed pull

func PullMerge

func PullMerge(login *auth.Login, repoOwner, repoName string, index int64, opt kmup.MergePullRequestOption) error

PullMerge merges a PR

func RepoClone

func RepoClone(
	path string,
	login *auth.Login,
	repoOwner, repoName string,
	callback func(string) (string, error),
	depth int,
) (*local_git.KmdoRepo, error)

RepoClone creates a local git clone in the given path, and sets up upstream remote for fork repos, for good usability with kmdo.

func ResolveLabelNames

func ResolveLabelNames(client *kmup.Client, owner, repo string, labelNames []string) ([]int64, error)

ResolveLabelNames returns a list of label IDs for a given list of label names

func SavePullDiff

func SavePullDiff(ctx *context.KmupContext, idx int64) (string, error)

SavePullDiff fetches the diff of a pull request and stores it as a temporary file. The path to the file is returned.

Types

type EditIssueOption

type EditIssueOption struct {
	Index        int64
	Title        *string
	Body         *string
	Ref          *string
	Milestone    *string
	Deadline     *time.Time
	AddLabels    []string
	RemoveLabels []string
	AddAssignees []string
}

EditIssueOption wraps around kmup.EditIssueOption which has bad & incosistent semantics.

Jump to

Keyboard shortcuts

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