Documentation
¶
Index ¶
- func ApprovePr(approverClient *github.Client, ghPrClientDetails GhPrClientDetails, ...) error
- func BumpVersion(ghPrClientDetails GhPrClientDetails, defaultBranch string, filePath string, ...) error
- func CompareRepoDirectories(ghPrClientDetails GhPrClientDetails, sourcePath string, targetPath string, ...) (bool, string, error)
- func DetectDrift(ghPrClientDetails GhPrClientDetails) error
- func DoesPrHasLabel(eventPayload github.PullRequestEvent, name string) bool
- func GeneratePromotionPlan(ghPrClientDetails GhPrClientDetails, config *cfg.Config, configBranch string) (map[string]PromotionInstance, error)
- func GenerateSyncTreeEntriesForCommit(treeEntries *[]*github.TreeEntry, ghPrClientDetails GhPrClientDetails, ...) error
- func GetBotGhIdentity(githubGraphQlClient *githubv4.Client, ctx context.Context) (string, error)
- func GetFileContent(ghPrClientDetails GhPrClientDetails, branch string, filePath string) (string, error, int)
- func GetInRepoConfig(ghPrClientDetails GhPrClientDetails, defaultBranch string) (*cfg.Config, error)
- func HandleEvent(r *http.Request, ctx context.Context, ...)
- func HandlePREvent(eventPayload *github.PullRequestEvent, ghPrClientDetails GhPrClientDetails, ...)
- func MergePr(details GhPrClientDetails, number *int) error
- func MimizeStalePrComments(ghPrClientDetails GhPrClientDetails, githubGraphQlClient *githubv4.Client, ...) error
- func SetCommitStatus(ghPrClientDetails GhPrClientDetails, state string)
- type GhClientPair
- type GhPrClientDetails
- func (p GhPrClientDetails) CommentOnPr(commentBody string) error
- func (p *GhPrClientDetails) GetDefaultBranch() (string, error)
- func (p *GhPrClientDetails) GetRef() (string, error)
- func (p *GhPrClientDetails) GetSHA() (string, error)
- func (p *GhPrClientDetails) ToggleCommitStatus(context string, user string) error
- type PromotionInstance
- type PromotionInstanceMetaData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApprovePr ¶
func ApprovePr(approverClient *github.Client, ghPrClientDetails GhPrClientDetails, prNumber *int) error
func BumpVersion ¶ added in v0.0.17
func CompareRepoDirectories ¶
func DetectDrift ¶ added in v0.0.8
func DetectDrift(ghPrClientDetails GhPrClientDetails) error
func DoesPrHasLabel ¶
func DoesPrHasLabel(eventPayload github.PullRequestEvent, name string) bool
func GeneratePromotionPlan ¶ added in v0.0.8
func GeneratePromotionPlan(ghPrClientDetails GhPrClientDetails, config *cfg.Config, configBranch string) (map[string]PromotionInstance, error)
func GenerateSyncTreeEntriesForCommit ¶ added in v0.0.17
func GetBotGhIdentity ¶ added in v0.1.4
go-github is my peffered way to interact with GitHub because of the better developer expirience(pre made types, easy API mocking). But some functionality is not availalble in GH V3 rest API, like PR comment minimization, so here we are:
func GetFileContent ¶
func GetInRepoConfig ¶ added in v0.0.8
func GetInRepoConfig(ghPrClientDetails GhPrClientDetails, defaultBranch string) (*cfg.Config, error)
func HandleEvent ¶ added in v0.0.8
func HandlePREvent ¶ added in v0.1.4
func HandlePREvent(eventPayload *github.PullRequestEvent, ghPrClientDetails GhPrClientDetails, mainGithubClientPair GhClientPair, approverGithubClientPair GhClientPair, ctx context.Context)
func MergePr ¶ added in v0.1.7
func MergePr(details GhPrClientDetails, number *int) error
func MimizeStalePrComments ¶
func MimizeStalePrComments(ghPrClientDetails GhPrClientDetails, githubGraphQlClient *githubv4.Client, botIdentity string) error
func SetCommitStatus ¶
func SetCommitStatus(ghPrClientDetails GhPrClientDetails, state string)
Types ¶
type GhClientPair ¶ added in v0.1.4
type GhClientPair struct {
// contains filtered or unexported fields
}
func (*GhClientPair) GetAndCache ¶ added in v0.1.7
type GhPrClientDetails ¶
type GhPrClientDetails struct {
GhClientPair *GhClientPair
// This whole struct describe the metadata of the PR, so it makes sense to share the context with everything to generate HTTP calls related to that PR, right?
Ctx context.Context //nolint:containedctx
DefaultBranch string
Owner string
Repo string
PrAuthor string
PrNumber int
PrSHA string
Ref string
PrLogger *log.Entry
Labels []*github.Label
PrMetadata prMetadata
}
func (GhPrClientDetails) CommentOnPr ¶
func (p GhPrClientDetails) CommentOnPr(commentBody string) error
func (*GhPrClientDetails) GetDefaultBranch ¶
func (p *GhPrClientDetails) GetDefaultBranch() (string, error)
func (*GhPrClientDetails) GetRef ¶
func (p *GhPrClientDetails) GetRef() (string, error)
func (*GhPrClientDetails) GetSHA ¶
func (p *GhPrClientDetails) GetSHA() (string, error)
func (*GhPrClientDetails) ToggleCommitStatus ¶
func (p *GhPrClientDetails) ToggleCommitStatus(context string, user string) error
type PromotionInstance ¶ added in v0.0.8
type PromotionInstance struct {
Metadata PromotionInstanceMetaData `deep:"-"` // Unit tests ignore Metadata currently
ComputedSyncPaths map[string]string // key is target, value is source
}
Click to show internal directories.
Click to hide internal directories.