prcreation

package
v0.0.0-...-71d74df Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OrgAwareClient

type OrgAwareClient struct {
	github.Client
	Org       string
	IsAppAuth bool
}

OrgAwareClient wraps a github.Client so that FindIssues routes through FindIssuesWithOrg. Prow's App auth round-tripper requires the org in the request context to resolve the installation token, but bumper.UpdatePullRequestWithLabels internally calls FindIssues which passes an empty org.

When IsAppAuth is true, BotUser() appends "[bot]" to the login so that GitHub's search API author: qualifier matches the App's acting identity.

func (*OrgAwareClient) BotUser

func (c *OrgAwareClient) BotUser() (*github.UserData, error)

BotUser returns the bot user data. When the client is using GitHub App auth, it appends the "[bot]" suffix to the login. GitHub Apps act as "slug[bot]" users, but prow's getUserData only stores the bare slug. The search API's author: qualifier requires the full "slug[bot]" form to match PRs created by the App; using the bare slug results in a 422 because that user does not exist on GitHub.

func (*OrgAwareClient) FindIssues

func (c *OrgAwareClient) FindIssues(query, sort string, asc bool) ([]github.Issue, error)

type PRCreationOptions

type PRCreationOptions struct {
	SelfApprove  bool
	PRSourceMode string
	flagutil.GitHubOptions
	GithubClient github.Client
}

func (*PRCreationOptions) AddFlags

func (o *PRCreationOptions) AddFlags(fs *flag.FlagSet)

func (*PRCreationOptions) Finalize

func (o *PRCreationOptions) Finalize() error

func (*PRCreationOptions) UpsertPR

func (o *PRCreationOptions) UpsertPR(localSourceDir, org, repo, branch, prTitle string, setters ...PrOption) error

UpsertPR creates or updates a pull request. The PRTitle must be alphanumeric except for spaces, as it will be used as the branch name.

type PrOption

type PrOption func(*PrOptions)

PrOption is the type for Optional Parameters

func AdditionalLabels

func AdditionalLabels(additionalLabels []string) PrOption

func GitCommitMessage

func GitCommitMessage(gitCommitMessage string) PrOption

GitCommitMessage is the wrapper to pass in PrCommitMessage that's different from the PrBody This is useful when you wish to provide large markdown information for the PR, but wish to keep the commit simple.

func MatchTitle

func MatchTitle(matchTitle string) PrOption

MatchTitle is the wrapper to pass in MatchTitle as a parameter

func PrAssignee

func PrAssignee(assignee string) PrOption

PrAssignee is the user to whom the PR is assigned

func PrBody

func PrBody(prBody string) PrOption

PrBody is the wrapper to pass in PrBody as a parameter

func SkipPRCreation

func SkipPRCreation() PrOption

SkipPRCreation skips the actual pr creation after committing and pushing

type PrOptions

type PrOptions struct {
	// contains filtered or unexported fields
}

PrOptions allows optional parameters to UpsertPR.

Jump to

Keyboard shortcuts

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