github

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: MPL-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultMaxRetries = 3
View Source
const GITHUB_CLONE_DEPTH_ENV = "TFBUDDY_GITHUB_CLONE_DEPTH"

Variables

This section is empty.

Functions

func ResolveOwnerName

func ResolveOwnerName(owner *gogithub.User) (string, error)

ResolveOwnerName is a helper func to find a name for the repo owner, which could be in the `Name` field or `Login.

func String

func String(str string) *string

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewGithubClient

func NewGithubClient() *Client

func (*Client) AddMergeRequestDiscussionReply

func (c *Client) AddMergeRequestDiscussionReply(ctx context.Context, prID int, fullName, discussionID, comment string) (vcs.MRNote, error)

func (*Client) CloneMergeRequest

func (c *Client) CloneMergeRequest(ctx context.Context, project string, mr vcs.MR, dest string) (vcs.GitRepo, error)

func (*Client) CreateMergeRequestComment

func (c *Client) CreateMergeRequestComment(ctx context.Context, prID int, fullName string, comment string) error

func (*Client) CreateMergeRequestDiscussion

func (c *Client) CreateMergeRequestDiscussion(ctx context.Context, prID int, fullName string, comment string) (vcs.MRDiscussionNotes, error)

func (*Client) GetIssue

func (c *Client) GetIssue(ctx context.Context, owner *gogithub.User, repo string, issueId int) (*gogithub.Issue, error)

func (*Client) GetMergeRequest

func (c *Client) GetMergeRequest(ctx context.Context, prID int, fullName string) (vcs.DetailedMR, error)

func (*Client) GetMergeRequestApprovals

func (c *Client) GetMergeRequestApprovals(ctx context.Context, id int, project string) (vcs.MRApproved, error)

func (*Client) GetMergeRequestModifiedFiles

func (c *Client) GetMergeRequestModifiedFiles(ctx context.Context, prID int, fullName string) ([]string, error)

func (*Client) GetOldRunUrls added in v0.2.0

func (c *Client) GetOldRunUrls(ctx context.Context, prID int, fullName string, rootCommentID int) (string, error)

Go over all comments on a PR, trying to grab any old TFC run urls and deleting the bodies

func (*Client) GetPipelinesForCommit

func (c *Client) GetPipelinesForCommit(ctx context.Context, projectWithNS string, commitSHA string) ([]vcs.ProjectPipeline, error)

func (*Client) GetPullRequest

func (c *Client) GetPullRequest(ctx context.Context, fullName string, prID int) (*GithubPR, error)

func (*Client) GetRepoFile

func (c *Client) GetRepoFile(ctx context.Context, fullName string, file string, ref string) ([]byte, error)

func (*Client) MergeMR added in v0.3.0

func (c *Client) MergeMR(ctx context.Context, mrIID int, project string) error

func (*Client) PostIssueComment

func (c *Client) PostIssueComment(ctx context.Context, prId int, fullName string, body string) (*gogithub.IssueComment, error)

PostIssueComment adds a comment to an existing Pull Request

func (*Client) PostPullRequestComment

func (c *Client) PostPullRequestComment(ctx context.Context, owner, repo string, prId int, body string) error

PostPullRequestComment adds a review comment to an existing PullRequest

func (*Client) ResolveMergeRequestDiscussion

func (c *Client) ResolveMergeRequestDiscussion(ctx context.Context, s string, i int, s2 string) error

func (*Client) SetCommitStatus

func (c *Client) SetCommitStatus(ctx context.Context, projectWithNS string, commitSHA string, status vcs.CommitStatusOptions) (vcs.CommitStatus, error)

func (*Client) UpdateMergeRequestDiscussionNote

func (c *Client) UpdateMergeRequestDiscussionNote(ctx context.Context, mrIID, noteID int, project, discussionID, comment string) (vcs.MRNote, error)

type GithubPR

type GithubPR struct {
	*gogithub.PullRequest
}

func (*GithubPR) GetAuthor

func (gm *GithubPR) GetAuthor() vcs.MRAuthor

func (*GithubPR) GetInternalID

func (gm *GithubPR) GetInternalID() int

func (*GithubPR) GetSourceBranch

func (gm *GithubPR) GetSourceBranch() string

func (*GithubPR) GetTargetBranch

func (gm *GithubPR) GetTargetBranch() string

func (*GithubPR) GetTitle

func (gm *GithubPR) GetTitle() string

func (*GithubPR) GetWebURL

func (gm *GithubPR) GetWebURL() string

func (*GithubPR) HasConflicts

func (gm *GithubPR) HasConflicts() bool

func (*GithubPR) IsApproved

func (gm *GithubPR) IsApproved() bool

type GithubPRAuthor

type GithubPRAuthor struct {
	*gogithub.User
}

func (*GithubPRAuthor) GetUsername

func (ga *GithubPRAuthor) GetUsername() string

type GithubPRIssueComment

type GithubPRIssueComment struct {
	*gogithub.IssueComment
}

func (*GithubPRIssueComment) GetDiscussionID

func (c *GithubPRIssueComment) GetDiscussionID() string

func (*GithubPRIssueComment) GetMRNotes

func (c *GithubPRIssueComment) GetMRNotes() []vcs.MRNote

type IssueComment

type IssueComment struct {
	*gogithub.IssueComment
}

func (*IssueComment) GetDiscussionID

func (c *IssueComment) GetDiscussionID() string

func (*IssueComment) GetMRNotes

func (c *IssueComment) GetMRNotes() []vcs.MRNote

func (*IssueComment) GetNoteID

func (c *IssueComment) GetNoteID() int64

type PRApproved

type PRApproved struct {
	// contains filtered or unexported fields
}

func (*PRApproved) IsApproved

func (p *PRApproved) IsApproved() bool

type RunEventsWorker

type RunEventsWorker struct {
	// contains filtered or unexported fields
}

func NewRunEventsWorker

func NewRunEventsWorker(client *Client, rs runstream.StreamClient, tfc tfc_api.ApiClient) *RunEventsWorker

func (*RunEventsWorker) Close

func (w *RunEventsWorker) Close()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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