task

package
Version: v0.7.1-0...-009166e Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2021 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateIssue

func CreateIssue(login *config.Login, repoOwner, repoName string, opts gitea.CreateIssueOption) error

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

func CreateLogin

func CreateLogin(name, token, user, passwd, sshKey, giteaURL string, insecure bool) error

CreateLogin create a login to be stored in config

func CreateMilestone

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

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

func CreatePull

func CreatePull(login *config.Login, repoOwner, repoName, base, head string, opts *gitea.CreateIssueOption) error

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

func CreatePullReview

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

CreatePullReview submits a review for a PR

func GenerateLoginName

func GenerateLoginName(url, user string) (string, error)

GenerateLoginName generates a name string based on instance URL & adds username if the result is not unique

func GetDefaultPRBase

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

GetDefaultPRBase retrieves the default base branch for the given repo

func GetDefaultPRHead

func GetDefaultPRHead(localRepo *local_git.TeaRepo) (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(head 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 gitea API

func LabelsExport

func LabelsExport(labels []*gitea.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) ([]gitea.CreatePullReviewComment, error)

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

func PullCheckout

func PullCheckout(
	login *config.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 *config.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 ResolveLabelNames

func ResolveLabelNames(client *gitea.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.TeaContext, 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

This section is empty.

Jump to

Keyboard shortcuts

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