git

package
v0.0.0-...-fb7f86c Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2023 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MainBranch                 = "main"
	HomeDir                    = "."
	RepoOwner                  = "grafana"
	OSSRepo                    = "grafana"
	EnterpriseRepo             = "grafana-enterprise"
	EnterpriseCheckName        = "Grafana Enterprise"
	EnterpriseCheckDescription = "Downstream tests to ensure that your changes are compatible with Grafana Enterprise"
)

Variables

View Source
var EnterpriseCheckLabels = []string{"enterprise-ok", "enterprise-failed", "enterprise-override"}
View Source
var (
	ErrorNoDroneBuildLink = errors.New("no drone build link")
)

Functions

func AddLabelToPR

func AddLabelToPR(ctx context.Context, client LabelsService, prID int, newLabel string) error

func CreateEnterpriseBuildFailedComment

func CreateEnterpriseBuildFailedComment(ctx context.Context, client CommentService, link string, prID int) error

func CreateEnterpriseStatus

func CreateEnterpriseStatus(ctx context.Context, client StatusesService, sha, link, status string) (*github.RepoStatus, error)

CreateEnterpriseStatus sets the status on a commit for the enterprise build check.

func DeleteEnterpriseBranch

func DeleteEnterpriseBranch(ctx context.Context, client GitService, branchName string) error

func NewGitHubClient

func NewGitHubClient(ctx context.Context, token string) *github.Client

NewGitHubClient creates a new Client using the provided GitHub token if not empty.

func PRCheckRegexp

func PRCheckRegexp() *regexp.Regexp

Types

type CommentService

type CommentService interface {
	CreateComment(ctx context.Context, owner string, repo string, number int, comment *github.IssueComment) (*github.IssueComment, *github.Response, error)
}

type GitService

type GitService interface {
	DeleteRef(ctx context.Context, owner string, repo string, ref string) (*github.Response, error)
}

type LabelsService

type LabelsService interface {
	ListLabelsByIssue(ctx context.Context, owner string, repo string, number int, opts *github.ListOptions) ([]*github.Label, *github.Response, error)
	RemoveLabelForIssue(ctx context.Context, owner string, repo string, number int, label string) (*github.Response, error)
	AddLabelsToIssue(ctx context.Context, owner string, repo string, number int, labels []string) ([]*github.Label, *github.Response, error)
}

type StatusesService

type StatusesService interface {
	CreateStatus(ctx context.Context, owner, repo, ref string, status *github.RepoStatus) (*github.RepoStatus, *github.Response, error)
}

Jump to

Keyboard shortcuts

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