shared

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PullRequestFields = []string{
	"artifactId",
	"autoCompleteSetBy",
	"closedBy",
	"closedDate",
	"codeReviewId",
	"commits",
	"completionOptions",
	"completionQueueTime",
	"createdBy",
	"creationDate",
	"description",
	"forkSource",
	"hasMultipleMergeBases",
	"isDraft",
	"labels",
	"lastMergeCommit",
	"lastMergeSourceCommit",
	"lastMergeTargetCommit",
	"mergeFailureMessage",
	"mergeFailureType",
	"mergeId",
	"mergeOptions",
	"mergeStatus",
	"pullRequestId",
	"remoteUrl",
	"repository",
	"reviewers",
	"sourceRefName",
	"status",
	"supportsIterations",
	"targetRefName",
	"title",
	"url",
	"workItemRefs",
}

Functions

func GetReviewerIdentities added in v0.4.0

func GetReviewerIdentities(ctx context.Context, identityClient identity.Client, reviewerHandles []string) (map[string]identity.Identity, error)

GetReviewerIdentities resolves a list of reviewer handles (e.g., emails) into a map of handle-to-identity objects.

func InitEditorMode

func InitEditorMode(ctx util.CmdContext, editorMode bool, webMode bool, canPrompt bool) (bool, error)

func ResolveReviewers added in v0.4.0

func ResolveReviewers(ctx context.Context, identityClient identity.Client, requiredReviewerHandles []string, optionalReviewerHandles []string) ([]git.IdentityRefWithVote, error)

ResolveReviewers takes lists of required and optional reviewer handles, resolves them, and returns a de-duplicated list of IdentityRefWithVote objects. If a reviewer is in both lists, they are marked as required.

Types

type FindOptions

type FindOptions struct {
	// The ID (number) of the PR to find
	Selector string
	// BaseBranch is the name of the base branch to scope the PR-for-branch lookup to.
	BaseBranch string
	// States lists the possible PR states to scope the PR-for-branch lookup to.
	States []string
}

type PRFinder

type PRFinder interface {
	Find(opts FindOptions) (*git.GitPullRequest, azdo.Repository, error)
}

func NewFinder

func NewFinder(ctx util.CmdContext) (f PRFinder, err error)

type Template

type Template interface {
	Path() string
	Body() []byte
}

type TemplateManager

type TemplateManager interface {
	GetTemplate(ctx context.Context, repo azdo.Repository, branch string) (Template, error)
}

func NewTemplateManager

func NewTemplateManager(ctx util.CmdContext) (TemplateManager, error)

Jump to

Keyboard shortcuts

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