Documentation ¶
Index ¶
- Variables
- func CheckoutBranch(log *logrus.Entry, repo *git.Repository, branchName string) error
- func CloneRepository(log *logrus.Entry, url string, token string, path string, ...) (*git.Repository, string, error)
- func GetPullRequestBaseOwnerName(pullRequest *pbc.PullRequest) string
- func GetPullRequestBaseRepoName(pullRequest *pbc.PullRequest) string
- func GetPullRequestHeadOwnerName(pullRequest *pbc.PullRequest) string
- func GetPullRequestHeadRepoName(pullRequest *pbc.PullRequest) string
- func GetPullRequestNumber(pullRequest *pbc.PullRequest) int64
- func PaginatedRequest(initFn func() interface{}, ...) (interface{}, error)
- func ParseNumPages(resp *github.Response) int
- func ParseNumPagesFromLink(link string) int
- func Push(log *logrus.Entry, repo *git.Repository, remoteName string, branchName string, ...) error
- func RebaseOnto(log *logrus.Entry, repo *git.Repository, branchName string, ...) error
- type AddDiscussionCommentMutation
- type AddProjectV2ItemByIdInput
- type AddPullRequestToMergeQueueMutation
- type AddReactionMutation
- type CommitStatus
- type CompareBaseAndHeadQuery
- type CreateCommitStatusOptions
- type DeleteProjectV2ItemMutation
- type DiscussionComment
- type DownloadContentsOptions
- type DownloadMethod
- type FieldDetails
- type FieldNode
- type FieldValue
- type Fields
- type FileSliceLimits
- type FirstCommitAndReviewDateQuery
- type GQLProjectV2Item
- type GQLReviewThread
- type GetAllReviewersApprovedQuery
- type GetAllReviewersQuery
- type GetApprovalsCountQuery
- type GetDiscussionCommentsQuery
- type GetDiscussionIDQuery
- type GetIssueProjectItemsQuery
- type GetLastCommitSHAQuery
- type GetObjectQuery
- type GetPullRequestProjectItemsQuery
- type GetRefIDQuery
- type GitBlame
- type GitBlameAuthorRank
- type GitBlameFile
- type GitBlameFileLines
- type GitBlameQuery
- type GithubAppClient
- type GithubClient
- func (c *GithubClient) AddAssignees(ctx context.Context, owner string, repo string, number int, assignees []string) (*github.Issue, *github.Response, error)
- func (c *GithubClient) AddCommentToDiscussion(ctx context.Context, discussionID, body string) error
- func (c *GithubClient) AddLabels(ctx context.Context, owner string, repo string, number int, labels []string) ([]*github.Label, *github.Response, error)
- func (c *GithubClient) AddPullRequestToGithubMergeQueue(ctx context.Context, pullRequestID string) error
- func (c *GithubClient) AddReactionToDiscussionComment(ctx context.Context, subjectID string, reaction githubv4.ReactionContent) error
- func (c *GithubClient) ComputeGitBlameRank(gitBlame *GitBlame) []GitBlameAuthorRank
- func (c *GithubClient) CreateComment(ctx context.Context, owner string, repo string, number int, ...) (*github.IssueComment, *github.Response, error)
- func (c *GithubClient) CreateCommitStatus(ctx context.Context, owner string, repo string, headSHA string, ...) (*CommitStatus, error)
- func (c *GithubClient) CreateLabel(ctx context.Context, owner string, repo string, label *github.Label) (*github.Label, *github.Response, error)
- func (c *GithubClient) DeleteComment(ctx context.Context, owner string, repo string, commentId int64) (*github.Response, error)
- func (c *GithubClient) DeleteProjectV2Item(ctx context.Context, projectID, itemID string) error
- func (c *GithubClient) DeleteReference(ctx context.Context, owner, repo, ref string) error
- func (c *GithubClient) DownloadContents(ctx context.Context, filePath string, branch *pbc.Branch, ...) ([]byte, error)
- func (c *GithubClient) EditComment(ctx context.Context, owner string, repo string, commentId int64, ...) (*github.IssueComment, *github.Response, error)
- func (c *GithubClient) EditIssue(ctx context.Context, owner string, repo string, number int, ...) (*github.Issue, *github.Response, error)
- func (c *GithubClient) EditLabel(ctx context.Context, owner string, repo string, name string, ...) (*github.Label, *github.Response, error)
- func (c *GithubClient) EditPullRequest(ctx context.Context, owner string, repo string, number int, ...) (*github.PullRequest, *github.Response, error)
- func (c *GithubClient) GetAllReviewers(ctx context.Context, owner, repo, state string, number int) ([]string, error)
- func (c *GithubClient) GetAllReviewersApproved(ctx context.Context, owner, repo string, number int) (bool, error)
- func (c *GithubClient) GetApprovalsCount(ctx context.Context, owner, repo string, number int) (int, error)
- func (c *GithubClient) GetAuthenticatedUserLogin() (string, error)
- func (c *GithubClient) GetCheckRunsForRef(ctx context.Context, owner string, repo string, number int, ref string, ...) ([]*github.CheckRun, error)
- func (c *GithubClient) GetClientGraphQL() *githubv4.Client
- func (c *GithubClient) GetClientREST() *github.Client
- func (c *GithubClient) GetComments(ctx context.Context, owner string, repo string, number int, ...) ([]*github.IssueComment, error)
- func (c *GithubClient) GetDefaultRepositoryBranch(ctx context.Context, owner string, repo string) (string, error)
- func (c *GithubClient) GetDiscussionComments(ctx context.Context, owner, repo string, discussionNum int) ([]DiscussionComment, error)
- func (c *GithubClient) GetDiscussionID(ctx context.Context, owner, repo string, discussionNum int) (string, error)
- func (c *GithubClient) GetFirstCommitAndReviewDate(ctx context.Context, owner, repo string, number int) (*time.Time, *time.Time, error)
- func (c *GithubClient) GetGitBlame(ctx context.Context, owner, name, commitSHA string, filePaths []string) (*GitBlame, error)
- func (c *GithubClient) GetGitHubMergeQueueEntries(ctx context.Context, repoOwner, repoName, branch string, retryCount int) ([]int, error)
- func (c *GithubClient) GetIssue(ctx context.Context, owner, repo string, number int) (*github.Issue, *github.Response, error)
- func (c *GithubClient) GetIssueProjectV2ItemID(ctx context.Context, owner, repo, projectID string, issueNum int) (string, error)
- func (c *GithubClient) GetIssueTimeline(ctx context.Context, owner string, repo string, number int) ([]*github.Timeline, error)
- func (c *GithubClient) GetIssuesAvailableAssignees(ctx context.Context, owner string, repo string) ([]*github.User, error)
- func (c *GithubClient) GetLabel(ctx context.Context, owner string, repo string, name string) (*github.Label, *github.Response, error)
- func (c *GithubClient) GetLastCommitSHA(ctx context.Context, owner, repo string, number int) (string, error)
- func (c *GithubClient) GetLinkedProjectsForIssue(ctx context.Context, owner, repo string, number int, retryCount int) ([]GQLProjectV2Item, error)
- func (c *GithubClient) GetLinkedProjectsForPullRequest(ctx context.Context, owner, repo string, number int, retryCount int) ([]GQLProjectV2Item, error)
- func (c *GithubClient) GetOpenPullRequestsAsReviewer(ctx context.Context, owner string, repo string, usernames []string) (map[string]int, error)
- func (c *GithubClient) GetOrganizationTeams(ctx context.Context, owner string) ([]string, error)
- func (c *GithubClient) GetProjectFieldsByProjectNumber(ctx context.Context, owner, repo string, projectNumber uint64, retryCount int) ([]FieldNode, error)
- func (c *GithubClient) GetProjectV2ByName(ctx context.Context, owner, repo, name string) (*ProjectV2, error)
- func (c *GithubClient) GetPullRequest(ctx context.Context, owner string, repo string, number int) (*github.PullRequest, *github.Response, error)
- func (c *GithubClient) GetPullRequestClosingIssuesCount(ctx context.Context, owner string, repo string, number int) (int, error)
- func (c *GithubClient) GetPullRequestCommits(ctx context.Context, owner string, repo string, number int) ([]*github.RepositoryCommit, error)
- func (c *GithubClient) GetPullRequestFiles(ctx context.Context, owner string, repo string, number int) ([]*github.CommitFile, error)
- func (c *GithubClient) GetPullRequestLastPushDate(ctx context.Context, owner string, repo string, number int) (time.Time, error)
- func (c *GithubClient) GetPullRequestProjectV2ItemID(ctx context.Context, owner, repo, projectID string, prNum int) (string, error)
- func (c *GithubClient) GetPullRequestReviewers(ctx context.Context, owner string, repo string, number int, ...) (*github.Reviewers, error)
- func (c *GithubClient) GetPullRequestReviews(ctx context.Context, owner string, repo string, number int) ([]*github.PullRequestReview, error)
- func (c *GithubClient) GetPullRequestUpToDate(ctx context.Context, owner, repo string, number int) (bool, error)
- func (c *GithubClient) GetPullRequests(ctx context.Context, owner string, repo string) ([]*github.PullRequest, error)
- func (c *GithubClient) GetRawClientGraphQL() *graphql.Client
- func (c *GithubClient) GetRepoCollaborators(ctx context.Context, owner string, repo string) ([]*github.User, error)
- func (c *GithubClient) GetRepositoryBranch(ctx context.Context, owner string, repo string, branch string, ...) (*github.Branch, *github.Response, error)
- func (c *GithubClient) GetReviewThreads(ctx context.Context, owner string, repo string, number int, retryCount int) ([]GQLReviewThread, error)
- func (c *GithubClient) GetToken() string
- func (c *GithubClient) GetTotalRequests() uint64
- func (c *GithubClient) GetUserTeams(ctx context.Context, owner string, login string) ([]string, error)
- func (c *GithubClient) IsFileBinary(ctx context.Context, owner, repo, branch, file string) (bool, error)
- func (c *GithubClient) IsGithubMergeQueueEnabled(ctx context.Context, repoOwner, repoName, branch string) (bool, error)
- func (c *GithubClient) ListCheckRunsForRef(ctx context.Context, owner string, repo string, ref string, ...) (*github.ListCheckRunsResults, *github.Response, error)
- func (c *GithubClient) ListIssuesByRepo(ctx context.Context, owner string, repo string, ...) ([]*github.Issue, *github.Response, error)
- func (c *GithubClient) ListOrganizationMembers(ctx context.Context, org string, opts *github.ListMembersOptions) ([]*github.User, *github.Response, error)
- func (c *GithubClient) ListTeamMembersBySlug(ctx context.Context, org string, slug string, ...) ([]*github.User, *github.Response, error)
- func (c *GithubClient) Merge(ctx context.Context, owner string, repo string, number int, ...) (*github.PullRequestMergeResult, *github.Response, error)
- func (c *GithubClient) RefExists(ctx context.Context, owner, repo, ref string) (bool, error)
- func (c *GithubClient) RemoveLabelForIssue(ctx context.Context, owner string, repo string, number int, label string) (*github.Response, error)
- func (c *GithubClient) RemoveReactionToDiscussionComment(ctx context.Context, subjectID string, reaction githubv4.ReactionContent) error
- func (c *GithubClient) RequestReviewers(ctx context.Context, owner string, repo string, number int, ...) (*github.PullRequest, *github.Response, error)
- func (c *GithubClient) Review(ctx context.Context, owner string, repo string, number int, ...) (*github.PullRequestReview, *github.Response, error)
- func (t *GithubClient) RoundTrip(req *http.Request) (*http.Response, error)
- func (c *GithubClient) SliceGitBlame(blame *GitBlame, filePath string, slices []FileSliceLimits) (*GitBlame, error)
- func (c *GithubClient) TriggerWorkflowByFileName(ctx context.Context, owner, repo, branch, workflowFileName string) (*github.Response, error)
- func (c *GithubClient) WithLogger(ctx context.Context, logger *logrus.Entry) *GithubClient
- type GraphQLRateLimitResponse
- type GraphQLRequest
- type IssueLinkedProjectsQuery
- type LastFiftyOpenedPullRequestsQuery
- type LastPushQuery
- type MergeQueueEntriesQuery
- type MergeQueueQuery
- type NumberFieldValue
- type OrganizationTeamsQuery
- type PageInfo
- type ProjectV2
- type PullRequestLinkedProjectsQuery
- type PullRequestsQuery
- type RemoveReactionMutation
- type ReviewThreadsQuery
- type SingleSelectFieldDetails
- type SingleSelectFieldValue
- type TextFieldValue
- type UpdateProjectV2ItemFieldValueInput
- type UserTeamsQuery
Constants ¶
This section is empty.
Variables ¶
var ( ErrProjectHasNoStatusField = errors.New("project has no status field") ErrProjectHasNoSuchField = errors.New("project field not found") ErrProjectHasNoSuchFieldValue = errors.New("project field value not found") ErrProjectItemsNotFound = errors.New("project items not found") ErrProjectNotFound = errors.New("project not found") ErrProjectStatusNotFound = errors.New("project status not found") ErrProjectItemNotFound = errors.New("project item not found") )
var (
ErrDiscussionNotFound = errors.New("discussion not found")
)
Functions ¶
func CheckoutBranch ¶
CheckoutBranch checks out a given branch in the given repository.
func CloneRepository ¶
func CloneRepository(log *logrus.Entry, url string, token string, path string, options *git.CloneOptions) (*git.Repository, string, error)
CloneRepository clones a repository from a given URL to the provided path. url needs to be an HTTPS uri (e.g. https://github.com/libgit2/TestGitRepository) path can be empty. In this case, the repository will be cloned to a temporary location and the location is returned.
func GetPullRequestBaseOwnerName ¶
func GetPullRequestBaseOwnerName(pullRequest *pbc.PullRequest) string
func GetPullRequestBaseRepoName ¶
func GetPullRequestBaseRepoName(pullRequest *pbc.PullRequest) string
func GetPullRequestHeadOwnerName ¶
func GetPullRequestHeadOwnerName(pullRequest *pbc.PullRequest) string
func GetPullRequestHeadRepoName ¶
func GetPullRequestHeadRepoName(pullRequest *pbc.PullRequest) string
func GetPullRequestNumber ¶
func GetPullRequestNumber(pullRequest *pbc.PullRequest) int64
func PaginatedRequest ¶
func ParseNumPages ¶
ParseNumPages Given a link header string representing pagination info, returns total number of pages.
func ParseNumPagesFromLink ¶
func Push ¶
func Push(log *logrus.Entry, repo *git.Repository, remoteName string, branchName string, token string, force bool) error
Push performs a push of the provided remote/branch.
func RebaseOnto ¶
func RebaseOnto(log *logrus.Entry, repo *git.Repository, branchName string, rebaseOptions *git.RebaseOptions) error
RebaseOnto performs a rebase of the current repository Head onto the given branch. Inspired by https://github.com/libgit2/git2go/blob/main/rebase_test.go#L359
Types ¶
type AddDiscussionCommentMutation ¶ added in v4.10.0
type AddDiscussionCommentMutation struct { AddDiscussionComment struct { ClientMutationID string } `graphql:"addDiscussionComment(input: $input)"` }
type AddPullRequestToMergeQueueMutation ¶ added in v4.12.0
type AddPullRequestToMergeQueueMutation struct { EnqueuePullRequest struct { ClientMutationID string } `graphql:"enqueuePullRequest(input: $input)"` }
type AddReactionMutation ¶ added in v4.10.0
type AddReactionMutation struct { AddReaction struct { ClientMutationID string } `graphql:"addReaction(input: $input)"` }
type CommitStatus ¶
type CompareBaseAndHeadQuery ¶
type CompareBaseAndHeadQuery struct { Repository struct { PullRequest struct { BaseRefOID string BaseRef struct { Target struct { Commit struct { History struct { Nodes []struct { OID string } } `graphql:"history(first: 1)"` } `graphql:"... on Commit"` } `graphql:"target"` } `graphql:"baseRef"` } `graphql:"pullRequest(number: $number)"` } `graphql:"repository(owner: $owner, name: $name)"` }
type DeleteProjectV2ItemMutation ¶
type DeleteProjectV2ItemMutation struct { DeleteProjectV2Item struct { ClientMutationID string } `graphql:"deleteProjectV2Item(input: $input)"` }
type DiscussionComment ¶ added in v4.10.0
type DownloadContentsOptions ¶ added in v4.13.0
type DownloadContentsOptions struct {
Method DownloadMethod
}
type DownloadMethod ¶ added in v4.13.0
type DownloadMethod string
const ( DownloadMethodSHA DownloadMethod = "withSHA" DownloadMethodBranchName DownloadMethod = "withBranchName" )
type FieldDetails ¶
type FieldNode ¶
type FieldNode struct { TypeName string `graphql:"__typename"` SingleSelectFieldDetails SingleSelectFieldDetails `graphql:"... on ProjectV2SingleSelectField"` FieldDetails FieldDetails `graphql:"... on ProjectV2Field"` }
type FieldValue ¶
type FieldValue interface{}
type FileSliceLimits ¶
type FirstCommitAndReviewDateQuery ¶
type FirstCommitAndReviewDateQuery struct { Repository struct { PullRequest struct { Commits struct { Nodes []struct { Commit struct { AuthoredDate time.Time } } } `graphql:"commits(first: 1)"` Reviews struct { Nodes []struct { CreatedAt time.Time } } `graphql:"reviews(first: 1)"` } `graphql:"pullRequest(number: $pullRequestNumber)"` } `graphql:"repository(owner: $repositoryOwner, name: $repositoryName)"` }
type GQLProjectV2Item ¶
type GQLReviewThread ¶
type GetAllReviewersApprovedQuery ¶ added in v4.18.0
type GetAllReviewersApprovedQuery struct { Repository struct { PullRequest struct { ReviewRequests struct { TotalCount int `graphql:"totalCount"` } `graphql:"reviewRequests"` LatestReviews struct { Nodes []struct { State string `graphql:"state"` } } `graphql:"latestReviews(first: 100)"` } `graphql:"pullRequest(number: $number)"` } `graphql:"repository(owner: $owner, name: $name)"` }
type GetAllReviewersQuery ¶ added in v4.18.0
type GetAllReviewersQuery struct { Repository struct { PullRequest struct { ReviewRequests struct { Nodes []struct { RequestedReviewer struct { User struct { Login string `graphql:"login"` } `graphql:"... on User"` Team struct { Slug string `graphql:"slug"` } `graphql:"... on Team"` } `graphql:"requestedReviewer"` } } `graphql:"reviewRequests(first: 100)"` Reviews struct { Nodes []struct { State string `graphql:"state"` Author struct { Login string `graphql:"login"` } } } `graphql:"latestReviews(first: 100)"` } `graphql:"pullRequest(number: $number)"` } `graphql:"repository(owner: $owner, name: $name)"` }
type GetApprovalsCountQuery ¶
type GetApprovalsCountQuery struct { Repository struct { PullRequest struct { Reviews struct { TotalCount int `graphql:"totalCount"` } `graphql:"reviews(first: 1, states: [APPROVED])"` } `graphql:"pullRequest(number: $pullRequestNumber)"` } `graphql:"repository(owner: $repositoryOwner, name: $repositoryName)"` }
type GetDiscussionCommentsQuery ¶ added in v4.10.0
type GetDiscussionCommentsQuery struct { Repository struct { Discussion struct { ID string Body string Author struct { Login string } Comments struct { PageInfo PageInfo Nodes []struct { ID string Body string Author struct { Login string } } } `graphql:"comments(first: 50, after: $afterCursor)"` } `graphql:"discussion(number: $number)"` } `graphql:"repository(owner: $owner, name: $name)"` }
type GetDiscussionIDQuery ¶ added in v4.10.0
type GetDiscussionIDQuery struct { Repository struct { Discussion struct { ID string } `graphql:"discussion(number: $number)"` } `graphql:"repository(owner: $owner, name: $name)"` }
type GetIssueProjectItemsQuery ¶
type GetIssueProjectItemsQuery struct { Repository struct { Issue struct { ProjectItems struct { PageInfo PageInfo Nodes []struct { Project struct { ID string } ID string } } `graphql:"projectItems(first: 100, after: $afterCursor)"` } `graphql:"issue(number: $number)"` } `graphql:"repository(owner: $owner, name: $name)"` }
type GetLastCommitSHAQuery ¶
type GetLastCommitSHAQuery struct { Repository struct { PullRequest struct { Commits struct { Nodes []struct { Commit struct { OID string } } } `graphql:"commits(last: 1)"` } `graphql:"pullRequest(number: $pullRequestNumber)"` } `graphql:"repository(owner: $repositoryOwner, name: $repositoryName)"` }
type GetObjectQuery ¶
type GetObjectQuery struct { Repository struct { Object struct { Blog struct { IsBinary bool } `graphql:"... on Blob"` } `graphql:"object(expression: $expression)"` } `graphql:"repository(owner: $repositoryOwner, name: $repositoryName)"` }
type GetPullRequestProjectItemsQuery ¶
type GetPullRequestProjectItemsQuery struct { Repository struct { PullRequest struct { ProjectItems struct { PageInfo PageInfo Nodes []struct { Project struct { ID string } ID string } } `graphql:"projectItems(first: 100, after: $afterCursor)"` } `graphql:"pullRequest(number: $number)"` } `graphql:"repository(owner: $owner, name: $name)"` }
type GetRefIDQuery ¶
type GetRefIDQuery struct { Repository struct { Ref struct { ID string } `graphql:"ref(qualifiedName: $ref)"` } `graphql:"repository(owner: $owner, name: $repo)"` }
type GitBlame ¶
type GitBlame struct { CommitSHA string Files map[string]GitBlameFile }
type GitBlameAuthorRank ¶
type GitBlameFile ¶
type GitBlameFile struct { FilePath string LineCount uint64 Lines []GitBlameFileLines }
type GitBlameFileLines ¶
type GitBlameQuery ¶
type GithubAppClient ¶
func NewGithubAppClient ¶
func NewGithubAppClient(gitHubAppID int64, gitHubAppPrivateKey []byte) (*GithubAppClient, error)
func (*GithubAppClient) CreateInstallationToken ¶
func (c *GithubAppClient) CreateInstallationToken(ctx context.Context, id int64, opts *github.InstallationTokenOptions) (*github.InstallationToken, error)
CreateInstallationToken creates a new installation token for the github app. For more details see https://docs.github.com/en/rest/apps/apps#create-an-installation-access-token-for-an-app
func (*GithubAppClient) GetInstallations ¶
func (c *GithubAppClient) GetInstallations(ctx context.Context) ([]*github.Installation, error)
GetInstallations returns all installations for the github app. For more details see https://docs.github.com/en/rest/apps/apps#list-installations-for-the-authenticated-app
type GithubClient ¶
type GithubClient struct {
// contains filtered or unexported fields
}
func NewGithubClient ¶
func (*GithubClient) AddAssignees ¶
func (*GithubClient) AddCommentToDiscussion ¶ added in v4.10.0
func (c *GithubClient) AddCommentToDiscussion(ctx context.Context, discussionID, body string) error
func (*GithubClient) AddPullRequestToGithubMergeQueue ¶ added in v4.12.0
func (c *GithubClient) AddPullRequestToGithubMergeQueue(ctx context.Context, pullRequestID string) error
func (*GithubClient) AddReactionToDiscussionComment ¶ added in v4.10.0
func (c *GithubClient) AddReactionToDiscussionComment(ctx context.Context, subjectID string, reaction githubv4.ReactionContent) error
func (*GithubClient) ComputeGitBlameRank ¶
func (c *GithubClient) ComputeGitBlameRank(gitBlame *GitBlame) []GitBlameAuthorRank
func (*GithubClient) CreateComment ¶
func (c *GithubClient) CreateComment(ctx context.Context, owner string, repo string, number int, comment *github.IssueComment) (*github.IssueComment, *github.Response, error)
func (*GithubClient) CreateCommitStatus ¶
func (c *GithubClient) CreateCommitStatus(ctx context.Context, owner string, repo string, headSHA string, opt *CreateCommitStatusOptions) (*CommitStatus, error)
func (*GithubClient) CreateLabel ¶
func (*GithubClient) DeleteComment ¶
func (*GithubClient) DeleteProjectV2Item ¶
func (c *GithubClient) DeleteProjectV2Item(ctx context.Context, projectID, itemID string) error
func (*GithubClient) DeleteReference ¶
func (c *GithubClient) DeleteReference(ctx context.Context, owner, repo, ref string) error
func (*GithubClient) DownloadContents ¶
func (c *GithubClient) DownloadContents(ctx context.Context, filePath string, branch *pbc.Branch, options *DownloadContentsOptions) ([]byte, error)
func (*GithubClient) EditComment ¶
func (c *GithubClient) EditComment(ctx context.Context, owner string, repo string, commentId int64, comment *github.IssueComment) (*github.IssueComment, *github.Response, error)
func (*GithubClient) EditPullRequest ¶
func (c *GithubClient) EditPullRequest(ctx context.Context, owner string, repo string, number int, pull *github.PullRequest) (*github.PullRequest, *github.Response, error)
func (*GithubClient) GetAllReviewers ¶ added in v4.18.0
func (*GithubClient) GetAllReviewersApproved ¶ added in v4.18.0
func (*GithubClient) GetApprovalsCount ¶
func (*GithubClient) GetAuthenticatedUserLogin ¶
func (c *GithubClient) GetAuthenticatedUserLogin() (string, error)
func (*GithubClient) GetCheckRunsForRef ¶
func (*GithubClient) GetClientGraphQL ¶
func (c *GithubClient) GetClientGraphQL() *githubv4.Client
func (*GithubClient) GetClientREST ¶
func (c *GithubClient) GetClientREST() *github.Client
FIXME: Remove these to hide the implementation details.
func (*GithubClient) GetComments ¶
func (c *GithubClient) GetComments(ctx context.Context, owner string, repo string, number int, opts *github.IssueListCommentsOptions) ([]*github.IssueComment, error)
func (*GithubClient) GetDefaultRepositoryBranch ¶
func (*GithubClient) GetDiscussionComments ¶ added in v4.10.0
func (c *GithubClient) GetDiscussionComments(ctx context.Context, owner, repo string, discussionNum int) ([]DiscussionComment, error)
GetDiscussionComments returns the discussion comments for a given discussion number. The first element of the list is the body of the discussion.
func (*GithubClient) GetDiscussionID ¶ added in v4.10.0
func (*GithubClient) GetFirstCommitAndReviewDate ¶
func (*GithubClient) GetGitBlame ¶
func (*GithubClient) GetGitHubMergeQueueEntries ¶ added in v4.12.0
func (*GithubClient) GetIssueProjectV2ItemID ¶
func (c *GithubClient) GetIssueProjectV2ItemID(ctx context.Context, owner, repo, projectID string, issueNum int) (string, error)
GetIssueProjectV2ItemID returns the project item ID for an issue. Each item on a project board is represented by a project item.
func (*GithubClient) GetIssueTimeline ¶
func (*GithubClient) GetIssuesAvailableAssignees ¶
func (*GithubClient) GetLastCommitSHA ¶
func (*GithubClient) GetLinkedProjectsForIssue ¶
func (c *GithubClient) GetLinkedProjectsForIssue(ctx context.Context, owner, repo string, number int, retryCount int) ([]GQLProjectV2Item, error)
func (*GithubClient) GetLinkedProjectsForPullRequest ¶
func (c *GithubClient) GetLinkedProjectsForPullRequest(ctx context.Context, owner, repo string, number int, retryCount int) ([]GQLProjectV2Item, error)
func (*GithubClient) GetOpenPullRequestsAsReviewer ¶
func (*GithubClient) GetOrganizationTeams ¶ added in v4.18.0
func (*GithubClient) GetProjectFieldsByProjectNumber ¶
func (*GithubClient) GetProjectV2ByName ¶
func (*GithubClient) GetPullRequest ¶
func (*GithubClient) GetPullRequestClosingIssuesCount ¶
func (*GithubClient) GetPullRequestCommits ¶
func (c *GithubClient) GetPullRequestCommits(ctx context.Context, owner string, repo string, number int) ([]*github.RepositoryCommit, error)
func (*GithubClient) GetPullRequestFiles ¶
func (c *GithubClient) GetPullRequestFiles(ctx context.Context, owner string, repo string, number int) ([]*github.CommitFile, error)
func (*GithubClient) GetPullRequestLastPushDate ¶
func (*GithubClient) GetPullRequestProjectV2ItemID ¶
func (c *GithubClient) GetPullRequestProjectV2ItemID(ctx context.Context, owner, repo, projectID string, prNum int) (string, error)
GetPullRequestProjectV2ItemID returns the project item ID for a pull request. Each item on a project board is represented by a project item.
func (*GithubClient) GetPullRequestReviewers ¶
func (*GithubClient) GetPullRequestReviews ¶
func (c *GithubClient) GetPullRequestReviews(ctx context.Context, owner string, repo string, number int) ([]*github.PullRequestReview, error)
func (*GithubClient) GetPullRequestUpToDate ¶ added in v4.10.0
func (*GithubClient) GetPullRequests ¶
func (c *GithubClient) GetPullRequests(ctx context.Context, owner string, repo string) ([]*github.PullRequest, error)
func (*GithubClient) GetRawClientGraphQL ¶
func (c *GithubClient) GetRawClientGraphQL() *graphql.Client
func (*GithubClient) GetRepoCollaborators ¶
func (*GithubClient) GetRepositoryBranch ¶
func (*GithubClient) GetReviewThreads ¶
func (c *GithubClient) GetReviewThreads(ctx context.Context, owner string, repo string, number int, retryCount int) ([]GQLReviewThread, error)
func (*GithubClient) GetToken ¶
func (c *GithubClient) GetToken() string
func (*GithubClient) GetTotalRequests ¶ added in v4.19.0
func (c *GithubClient) GetTotalRequests() uint64
func (*GithubClient) GetUserTeams ¶ added in v4.18.0
func (*GithubClient) IsFileBinary ¶
func (*GithubClient) IsGithubMergeQueueEnabled ¶ added in v4.12.0
func (*GithubClient) ListCheckRunsForRef ¶
func (c *GithubClient) ListCheckRunsForRef(ctx context.Context, owner string, repo string, ref string, opts *github.ListCheckRunsOptions) (*github.ListCheckRunsResults, *github.Response, error)
func (*GithubClient) ListIssuesByRepo ¶
func (*GithubClient) ListOrganizationMembers ¶
func (*GithubClient) ListTeamMembersBySlug ¶
func (*GithubClient) Merge ¶
func (c *GithubClient) Merge(ctx context.Context, owner string, repo string, number int, commitMessage string, options *github.PullRequestOptions) (*github.PullRequestMergeResult, *github.Response, error)
func (*GithubClient) RemoveLabelForIssue ¶
func (*GithubClient) RemoveReactionToDiscussionComment ¶ added in v4.10.0
func (c *GithubClient) RemoveReactionToDiscussionComment(ctx context.Context, subjectID string, reaction githubv4.ReactionContent) error
func (*GithubClient) RequestReviewers ¶
func (c *GithubClient) RequestReviewers(ctx context.Context, owner string, repo string, number int, reviewers github.ReviewersRequest) (*github.PullRequest, *github.Response, error)
func (*GithubClient) Review ¶
func (c *GithubClient) Review(ctx context.Context, owner string, repo string, number int, review *github.PullRequestReviewRequest) (*github.PullRequestReview, *github.Response, error)
func (*GithubClient) SliceGitBlame ¶
func (c *GithubClient) SliceGitBlame(blame *GitBlame, filePath string, slices []FileSliceLimits) (*GitBlame, error)
func (*GithubClient) TriggerWorkflowByFileName ¶
func (*GithubClient) WithLogger ¶ added in v4.19.0
func (c *GithubClient) WithLogger(ctx context.Context, logger *logrus.Entry) *GithubClient
type GraphQLRateLimitResponse ¶ added in v4.19.0
type GraphQLRequest ¶ added in v4.19.0
type IssueLinkedProjectsQuery ¶
type IssueLinkedProjectsQuery struct { Repository struct { Issue struct { ProjectItems *struct { Nodes []GQLProjectV2Item PageInfo struct { EndCursor githubv4.String HasNextPage bool } } `graphql:"projectItems(first: 10, after: $projectItemsCursor)"` } `graphql:"issue(number: $issueNumber)"` } `graphql:"repository(owner: $repositoryOwner, name: $repositoryName)"` }
type LastFiftyOpenedPullRequestsQuery ¶
type LastFiftyOpenedPullRequestsQuery struct { Repository struct { PullRequests struct { Nodes []PullRequestsQuery } `graphql:"pullRequests(states: OPEN, last: 50)"` } `graphql:"repository(owner: $owner, name: $name)"` }
type LastPushQuery ¶
type LastPushQuery struct { Repository struct { PullRequest struct { TimelineItems struct { Nodes []struct { Typename string `graphql:"__typename"` HeadRefForcePushedEvent struct { CreatedAt *time.Time } `graphql:"... on HeadRefForcePushedEvent"` PullRequestCommit struct { Commit struct { PushedDate *time.Time CommittedDate *time.Time } } `graphql:"... on PullRequestCommit"` } } `graphql:"timelineItems(last: 1, itemTypes: [HEAD_REF_FORCE_PUSHED_EVENT, PULL_REQUEST_COMMIT])"` } `graphql:"pullRequest(number: $pullRequestNumber)"` } `graphql:"repository(owner: $repositoryOwner, name: $repositoryName)"` }
type MergeQueueEntriesQuery ¶ added in v4.12.0
type MergeQueueEntriesQuery struct { Repository struct { MergeQueue struct { ID string Entries struct { Nodes []struct { PullRequest struct { Number int } } PageInfo struct { EndCursor githubv4.String HasNextPage bool } } `graphql:"entries(first: 100, after: $cursor)"` } `graphql:"mergeQueue(branch: $branchName)"` } `graphql:"repository(owner: $repositoryOwner, name: $repositoryName)"` }
type MergeQueueQuery ¶ added in v4.12.0
type MergeQueueQuery struct { Repository struct { MergeQueue struct { ID string } `graphql:"mergeQueue(branch: $branchName)"` } `graphql:"repository(owner: $repositoryOwner, name: $repositoryName)"` }
type NumberFieldValue ¶
type OrganizationTeamsQuery ¶ added in v4.18.0
type OrganizationTeamsQuery struct { RepositoryOwner struct { Organization struct { Teams struct { PageInfo struct { HasNextPage bool `graphql:"hasNextPage"` EndCursor string `graphql:"endCursor"` } Nodes []struct { Slug string `graphql:"slug"` } } `graphql:"teams(first: 100, after: $cursor)"` } `graphql:"... on Organization"` } `graphql:"repositoryOwner(login: $owner)"` }
type PullRequestLinkedProjectsQuery ¶
type PullRequestLinkedProjectsQuery struct { Repository struct { PullRequest struct { ProjectItems *struct { Nodes []GQLProjectV2Item PageInfo struct { EndCursor githubv4.String HasNextPage bool } } `graphql:"projectItems(first: 10, after: $projectItemsCursor)"` } `graphql:"pullRequest(number: $issueNumber)"` } `graphql:"repository(owner: $repositoryOwner, name: $repositoryName)"` }
type PullRequestsQuery ¶
type PullRequestsQuery struct { ReviewRequests struct { Nodes []struct { RequestedReviewer struct { TypeName string `graphql:"__typename"` AsUser struct { Login githubv4.String } `graphql:"... on User"` } } } `graphql:"reviewRequests(first: 50)"` Reviews struct { Nodes []struct { Author struct { Login githubv4.String } } } `graphql:"reviews(first: 50)"` }
type RemoveReactionMutation ¶ added in v4.10.0
type RemoveReactionMutation struct { RemoveReaction struct { ClientMutationID string } `graphql:"removeReaction(input: $input)"` }
type ReviewThreadsQuery ¶
type ReviewThreadsQuery struct { Repository struct { PullRequest struct { ReviewThreads struct { Nodes []GQLReviewThread PageInfo struct { EndCursor githubv4.String HasNextPage bool } } `graphql:"reviewThreads(first: 10, after: $reviewThreadsCursor)"` } `graphql:"pullRequest(number: $pullRequestNumber)"` } `graphql:"repository(owner: $repositoryOwner, name: $repositoryName)"` }
type SingleSelectFieldValue ¶
type SingleSelectFieldValue struct {
SingleSelectOptionId string `json:"singleSelectOptionId"`
}
type TextFieldValue ¶
type TextFieldValue struct {
Text string `json:"text"`
}
type UpdateProjectV2ItemFieldValueInput ¶
type UpdateProjectV2ItemFieldValueInput struct { ItemID string `json:"itemId"` Value FieldValue `json:"value"` ProjectID string `json:"projectId"` FieldID string `json:"fieldId"` }
type UserTeamsQuery ¶ added in v4.18.0
type UserTeamsQuery struct { RepositoryOwner struct { Organization struct { Teams struct { PageInfo struct { HasNextPage bool `graphql:"hasNextPage"` EndCursor string `graphql:"endCursor"` } Nodes []struct { Slug string `graphql:"slug"` } } `graphql:"teams(first: 100, userLogins: [$login], after: $cursor)"` } `graphql:"... on Organization"` } `graphql:"repositoryOwner(login: $owner)"` }