github

package
v0.0.0-...-9d61cdf Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2024 License: Apache-2.0 Imports: 10 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UnhandledMergeGroupEventError = errors.New("ignoring event: merge_group")

Functions

func CheckIfHelpComment

func CheckIfHelpComment(event interface{}) bool

func CheckIfShowProjectsComment

func CheckIfShowProjectsComment(event interface{}) bool

func ConvertGithubIssueCommentEventToJobs

func ConvertGithubIssueCommentEventToJobs(payload *github.IssueCommentEvent, impactedProjects []digger_config.Project, requestedProject *digger_config.Project, workflows map[string]digger_config.Workflow, prBranchName string) ([]orchestrator.Job, bool, error)

func ConvertGithubPullRequestEventToJobs

func ConvertGithubPullRequestEventToJobs(payload *github.PullRequestEvent, impactedProjects []digger_config.Project, requestedProject *digger_config.Project, config digger_config.DiggerConfig) ([]orchestrator.Job, bool, error)

func CreateJobsForProjects

func CreateJobsForProjects(projects []digger_config.Project, command string, event string, repoFullName string, requestedBy string, workflows map[string]digger_config.Workflow, issueNumber *int, commitSha *string, defaultBranch string, prBranch string) ([]orchestrator.Job, error)

func FindAllProjectsDependantOnImpactedProjects

func FindAllProjectsDependantOnImpactedProjects(impactedProjects []digger_config.Project, dependencyGraph graph.Graph[string, digger_config.Project]) ([]digger_config.Project, error)

func GetRunEnvVars

func GetRunEnvVars(defaultBranch string, prBranch string, projectName string, projectDir string) map[string]string

func ProcessGitHubEvent

func ProcessGitHubEvent(ghEvent interface{}, diggerConfig *digger_config.DiggerConfig, ciService orchestrator.PullRequestService) ([]digger_config.Project, *digger_config.Project, int, error)

Types

type GithubCommentReaction

type GithubCommentReaction string
const GithubCommentConfusedReaction GithubCommentReaction = "confused"
const GithubCommentEyesReaction GithubCommentReaction = "eyes"
const GithubCommentHeartReaction GithubCommentReaction = "heart"
const GithubCommentHoorayReaction GithubCommentReaction = "hooray"
const GithubCommentLaughReaction GithubCommentReaction = "laugh"
const GithubCommentMinusOneReaction GithubCommentReaction = "-1"
const GithubCommentPlusOneReaction GithubCommentReaction = "+1"
const GithubCommentRocketReaction GithubCommentReaction = "rocket"

type GithubService

type GithubService struct {
	Client   *github.Client
	RepoName string
	Owner    string
}

func NewGitHubService

func NewGitHubService(ghToken string, repoName string, owner string) GithubService

func (GithubService) CreateCommentReaction

func (svc GithubService) CreateCommentReaction(id interface{}, reaction string) error

func (GithubService) EditComment

func (svc GithubService) EditComment(prNumber int, id interface{}, comment string) error

func (GithubService) GetApprovals

func (svc GithubService) GetApprovals(prNumber int) ([]string, error)

func (GithubService) GetBranchName

func (svc GithubService) GetBranchName(prNumber int) (string, string, error)

func (GithubService) GetChangedFiles

func (svc GithubService) GetChangedFiles(prNumber int) ([]string, error)

func (GithubService) GetChangedFilesForCommit

func (svc GithubService) GetChangedFilesForCommit(owner string, repo string, commitID string) ([]string, error)

func (GithubService) GetCombinedPullRequestStatus

func (svc GithubService) GetCombinedPullRequestStatus(prNumber int) (string, error)

func (GithubService) GetComments

func (svc GithubService) GetComments(prNumber int) ([]orchestrator.Comment, error)

func (GithubService) GetUserTeams

func (svc GithubService) GetUserTeams(organisation string, user string) ([]string, error)

func (GithubService) IsClosed

func (svc GithubService) IsClosed(prNumber int) (bool, error)

func (GithubService) IsMergeable

func (svc GithubService) IsMergeable(prNumber int) (bool, error)

func (GithubService) IsMerged

func (svc GithubService) IsMerged(prNumber int) (bool, error)

func (GithubService) ListIssues

func (svc GithubService) ListIssues() ([]*orchestrator.Issue, error)

func (GithubService) MergePullRequest

func (svc GithubService) MergePullRequest(prNumber int) error

func (GithubService) PublishComment

func (svc GithubService) PublishComment(prNumber int, comment string) (*orchestrator.Comment, error)

func (GithubService) PublishIssue

func (svc GithubService) PublishIssue(title string, body string) (int64, error)

func (GithubService) SetOutput

func (svc GithubService) SetOutput(prNumber int, key string, value string) error

func (GithubService) SetStatus

func (svc GithubService) SetStatus(prNumber int, status string, statusContext string) error

type MockCiService

type MockCiService struct {
	CommentsPerPr map[int][]*orchestrator.Comment
}

func (MockCiService) CreateCommentReaction

func (t MockCiService) CreateCommentReaction(id interface{}, reaction string) error

func (MockCiService) DownloadLatestPlans

func (t MockCiService) DownloadLatestPlans(prNumber int) (string, error)

func (MockCiService) EditComment

func (t MockCiService) EditComment(prNumber int, commentId interface{}, comment string) error

func (MockCiService) GetApprovals

func (t MockCiService) GetApprovals(prNumber int) ([]string, error)

func (MockCiService) GetBranchName

func (t MockCiService) GetBranchName(prNumber int) (string, string, error)

func (MockCiService) GetChangedFiles

func (t MockCiService) GetChangedFiles(prNumber int) ([]string, error)

func (MockCiService) GetCombinedPullRequestStatus

func (t MockCiService) GetCombinedPullRequestStatus(prNumber int) (string, error)

func (MockCiService) GetComments

func (t MockCiService) GetComments(prNumber int) ([]orchestrator.Comment, error)

func (MockCiService) GetUserTeams

func (t MockCiService) GetUserTeams(organisation string, user string) ([]string, error)

func (MockCiService) IsClosed

func (t MockCiService) IsClosed(prNumber int) (bool, error)

func (MockCiService) IsMergeable

func (t MockCiService) IsMergeable(prNumber int) (bool, error)

func (MockCiService) IsMerged

func (t MockCiService) IsMerged(prNumber int) (bool, error)

func (MockCiService) ListIssues

func (t MockCiService) ListIssues() ([]*orchestrator.Issue, error)

func (MockCiService) MergePullRequest

func (t MockCiService) MergePullRequest(prNumber int) error

func (MockCiService) PublishComment

func (t MockCiService) PublishComment(prNumber int, comment string) (*orchestrator.Comment, error)

func (MockCiService) PublishIssue

func (t MockCiService) PublishIssue(title string, body string) (int64, error)

func (MockCiService) SetOutput

func (svc MockCiService) SetOutput(prNumber int, key string, value string) error

func (MockCiService) SetStatus

func (t MockCiService) SetStatus(prNumber int, status string, statusContext string) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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