pr

package
v0.0.0-...-1883019 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2025 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindPullRequestAuthor

func FindPullRequestAuthor(ctx context.Context, scmClient *scm.Client, repoFullName, prNumberStr string) (string, error)

func MergeCommitPullRequestNumber

func MergeCommitPullRequestNumber(commit *scm.Commit) (string, error)

Types

type Options

type Options struct {
	environments.EnvironmentPullRequestOptions

	Dir                string
	ConfigFile         string
	Version            string
	VersionFile        string
	AddChangelog       string
	GitCommitUsername  string
	GitCommitUserEmail string
	PipelineCommitSha  string
	PipelineRepoURL    string
	AutoMerge          bool
	NoVersion          bool
	GitCredentials     bool
	PRAssignees        []string
	Labels             []string
	TemplateData       map[string]interface{}
	PullRequestSHAs    map[string]string
	Helmer             helmer.Helmer
	GraphQLClient      *githubv4.Client
	UpdateConfig       v1alpha1.UpdateConfig
}

Options the options for the command

func NewCmdPullRequest

func NewCmdPullRequest() (*cobra.Command, *Options)

NewCmdPullRequest creates a command object for the command

func (*Options) AddPullRequest

func (o *Options) AddPullRequest(pr *scm.PullRequest)

AddPullRequest lets store pull requests so we can use the PR data later on

func (*Options) ApplyChanges

func (o *Options) ApplyChanges(dir, gitURL string, change v1alpha1.Change) error

ApplyChanges applies the changes to the given dir

func (*Options) ApplyCommand

func (o *Options) ApplyCommand(dir string, command *v1alpha1.Command) error

func (*Options) ApplyGo

func (o *Options) ApplyGo(dir, gitURL string, gc *v1alpha1.GoChange) error

ApplyGo applies the go change

func (*Options) ApplyRegex

func (o *Options) ApplyRegex(dir, gitURL string, change v1alpha1.Change, regex *v1alpha1.Regex) error

ApplyRegex applies the regex change

func (*Options) ApplyVersionStream

func (o *Options) ApplyVersionStream(dir string, vs *v1alpha1.VersionStreamChange) error

ApplyVersionStream applies the version stream change

func (*Options) AssignUsersToIssue

func (o *Options) AssignUsersToIssue(pullRequest *scm.PullRequest, users []string, gitURL, gitKind string) error

AssignUsersToIssue adds users as an assignee to the PR Issue

func (*Options) AssignUsersToPullRequestIssue

func (o *Options) AssignUsersToPullRequestIssue(rule *v1alpha1.Rule, pullRequest *scm.PullRequest, ruleURL, pipelineURL, pipelineSHA, gitKind string) error

AssignUsersToPullRequestIssue assigns user to a downstream PR issue

func (*Options) EvaluateVersionTemplate

func (o *Options) EvaluateVersionTemplate(templateText, gitURL string) (string, error)

func (*Options) FindCommitAuthor

func (o *Options) FindCommitAuthor(gitURL, sha, gitKind string) (string, error)

FindCommitAuthor finds the author of the commit, or the author of the PR if the commit is a merge commit

func (*Options) FindURLs

func (o *Options) FindURLs(rule *v1alpha1.Rule) error

func (*Options) GetSparseCheckoutPatterns

func (o *Options) GetSparseCheckoutPatterns(rule *v1alpha1.Rule) ([]string, error)

func (*Options) GoFindURLs

func (o *Options) GoFindURLs(rule *v1alpha1.Rule, gc *v1alpha1.GoChange) error

GoFindURLs find the git URLs for the given go dependency change

func (*Options) ProcessAndCreatePullRequests

func (o *Options) ProcessAndCreatePullRequests(rule *v1alpha1.Rule, baseBranch string, labels []string, automerge bool) error

ProcessAndCreatePullRequests handles the URL loop, sets the closure, and creates/reuses PRs.

func (*Options) ProcessRule

func (o *Options) ProcessRule(rule *v1alpha1.Rule, index int) error

ProcessRule sets the Fork and SparseCheckoutPatterns for the given rule

func (*Options) Run

func (o *Options) Run() error

Run implements the command

func (*Options) SetChangeLog

func (o *Options) SetChangeLog(addChangeLog string) error

func (*Options) SetCommitDetails

func (o *Options) SetCommitDetails(dir string) error

SetCommitDetails discovers the git URL, and sets the application name, commit message and title

func (*Options) SparseCheckoutPatternsGo

func (o *Options) SparseCheckoutPatternsGo() []string

SparseCheckoutPatternsGo return the patterns to check out sparsely

func (*Options) SparseCheckoutPatternsRegex

func (o *Options) SparseCheckoutPatternsRegex(regex *v1alpha1.Regex) []string

SparseCheckoutPatternsRegex return the patterns to check out sparsely

func (*Options) Validate

func (o *Options) Validate() error

Jump to

Keyboard shortcuts

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