Documentation ¶
Index ¶
- Constants
- type GitlabClient
- func (c *GitlabClient) AddMergeRequestDiscussionReply(ctx context.Context, mrIID int, project, discussionID, comment string) (vcs.MRNote, error)
- func (c *GitlabClient) CloneMergeRequest(ctx context.Context, project string, mr vcs.MR, dest string) (vcs.GitRepo, error)
- func (c *GitlabClient) CreateMergeRequestComment(ctx context.Context, mrIID int, projectID, comment string) error
- func (c *GitlabClient) CreateMergeRequestDiscussion(ctx context.Context, mrIID int, project, comment string) (vcs.MRDiscussionNotes, error)
- func (c *GitlabClient) GetCommitStatuses(ctx context.Context, projectID, commitSHA string) []*gogitlab.CommitStatus
- func (g *GitlabClient) GetMergeRequest(ctx context.Context, mrIID int, project string) (vcs.DetailedMR, error)
- func (g *GitlabClient) GetMergeRequestApprovals(ctx context.Context, mrIID int, project string) (vcs.MRApproved, error)
- func (g *GitlabClient) GetMergeRequestModifiedFiles(ctx context.Context, mrIID int, projectID string) ([]string, error)
- func (c *GitlabClient) GetOldRunUrls(ctx context.Context, mrIID int, project string, rootNoteID int) (string, error)
- func (g *GitlabClient) GetPipelinesForCommit(ctx context.Context, project, commitSHA string) ([]vcs.ProjectPipeline, error)
- func (g *GitlabClient) GetRepoFile(ctx context.Context, project, file, ref string) ([]byte, error)
- func (c *GitlabClient) MergeMR(ctx context.Context, mrIID int, project string) error
- func (c *GitlabClient) ResolveMergeRequestDiscussion(ctx context.Context, projectWithNamespace string, mrIID int, ...) error
- func (c *GitlabClient) ResolveMergeRequestDiscussionReply(ctx context.Context, mrIID int, project, discussionID string, resolved bool) error
- func (c *GitlabClient) SetCommitStatus(ctx context.Context, projectWithNS string, commitSHA string, ...) (vcs.CommitStatus, error)
- func (c *GitlabClient) UpdateMergeRequestDiscussionNote(ctx context.Context, mrIID, noteID int, project, discussionID, comment string) (vcs.MRNote, error)
- type GitlabCommitStatus
- type GitlabCommitStatusOptions
- func (gO *GitlabCommitStatusOptions) GetContext() string
- func (gO *GitlabCommitStatusOptions) GetDescription() string
- func (gO *GitlabCommitStatusOptions) GetName() string
- func (gO *GitlabCommitStatusOptions) GetPipelineID() int
- func (gO *GitlabCommitStatusOptions) GetState() string
- func (gO *GitlabCommitStatusOptions) GetTargetURL() string
- type GitlabMR
- type GitlabMRApproval
- type GitlabMRAuthor
- type GitlabMRDiscussion
- type GitlabMRNote
- type GitlabMergeCommentEvent
- func (gE *GitlabMergeCommentEvent) GetAttributes() vcs.MRAttributes
- func (gE *GitlabMergeCommentEvent) GetAuthor() vcs.MRAuthor
- func (gE *GitlabMergeCommentEvent) GetDiscussionID() string
- func (gE *GitlabMergeCommentEvent) GetInternalID() int
- func (gE *GitlabMergeCommentEvent) GetLastCommit() vcs.Commit
- func (gE *GitlabMergeCommentEvent) GetMR() vcs.MR
- func (gE *GitlabMergeCommentEvent) GetNote() string
- func (gE *GitlabMergeCommentEvent) GetPathWithNamespace() string
- func (gE *GitlabMergeCommentEvent) GetProject() vcs.Project
- func (gE *GitlabMergeCommentEvent) GetSHA() string
- func (gE *GitlabMergeCommentEvent) GetSourceBranch() string
- func (gE *GitlabMergeCommentEvent) GetTargetBranch() string
- func (gE *GitlabMergeCommentEvent) GetType() string
- func (gE *GitlabMergeCommentEvent) GetUsername() string
- type GitlabPipeline
- type RunStatusUpdater
Constants ¶
const DefaultMaxRetries = 3
const GITLAB_CLONE_DEPTH_ENV = "TFBUDDY_GITLAB_CLONE_DEPTH"
const MR_COMMENT_FORMAT = `
### Terraform Cloud
%s
`
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GitlabClient ¶
type GitlabClient struct {
// contains filtered or unexported fields
}
func NewGitlabClient ¶
func NewGitlabClient() *GitlabClient
func (*GitlabClient) AddMergeRequestDiscussionReply ¶
func (c *GitlabClient) AddMergeRequestDiscussionReply(ctx context.Context, mrIID int, project, discussionID, comment string) (vcs.MRNote, error)
AddMergeRequestDiscussionReply creates a comment on the merge request.
func (*GitlabClient) CloneMergeRequest ¶
func (c *GitlabClient) CloneMergeRequest(ctx context.Context, project string, mr vcs.MR, dest string) (vcs.GitRepo, error)
CloneMergeRequest performs a git clone of the target Gitlab project & merge request branch to the `dest` path.
func (*GitlabClient) CreateMergeRequestComment ¶
func (c *GitlabClient) CreateMergeRequestComment(ctx context.Context, mrIID int, projectID, comment string) error
CreateMergeRequestComment creates a comment on the merge request.
func (*GitlabClient) CreateMergeRequestDiscussion ¶
func (c *GitlabClient) CreateMergeRequestDiscussion(ctx context.Context, mrIID int, project, comment string) (vcs.MRDiscussionNotes, error)
func (*GitlabClient) GetCommitStatuses ¶
func (c *GitlabClient) GetCommitStatuses(ctx context.Context, projectID, commitSHA string) []*gogitlab.CommitStatus
func (*GitlabClient) GetMergeRequest ¶
func (g *GitlabClient) GetMergeRequest(ctx context.Context, mrIID int, project string) (vcs.DetailedMR, error)
func (*GitlabClient) GetMergeRequestApprovals ¶
func (g *GitlabClient) GetMergeRequestApprovals(ctx context.Context, mrIID int, project string) (vcs.MRApproved, error)
func (*GitlabClient) GetMergeRequestModifiedFiles ¶
func (g *GitlabClient) GetMergeRequestModifiedFiles(ctx context.Context, mrIID int, projectID string) ([]string, error)
GetMergeRequestModifiedFiles returns the names of files that were modified in the merge request relative to the repo root, e.g. parent/child/file.txt.
func (*GitlabClient) GetOldRunUrls ¶ added in v0.2.0
func (c *GitlabClient) GetOldRunUrls(ctx context.Context, mrIID int, project string, rootNoteID int) (string, error)
Crawl the comments on this MR for tfbuddy comments, grab any TFC urls out of them, and delete them.
func (*GitlabClient) GetPipelinesForCommit ¶
func (g *GitlabClient) GetPipelinesForCommit(ctx context.Context, project, commitSHA string) ([]vcs.ProjectPipeline, error)
func (*GitlabClient) GetRepoFile ¶
GetRepoFile retrieves a single file from a Gitlab repository using the RepositoryFiles API
func (*GitlabClient) ResolveMergeRequestDiscussion ¶
func (*GitlabClient) ResolveMergeRequestDiscussionReply ¶
func (c *GitlabClient) ResolveMergeRequestDiscussionReply(ctx context.Context, mrIID int, project, discussionID string, resolved bool) error
ResolveMergeRequestDiscussionReply marks a discussion thread as resolved / unresolved.
func (*GitlabClient) SetCommitStatus ¶
func (c *GitlabClient) SetCommitStatus(ctx context.Context, projectWithNS string, commitSHA string, status vcs.CommitStatusOptions) (vcs.CommitStatus, error)
func (*GitlabClient) UpdateMergeRequestDiscussionNote ¶
type GitlabCommitStatus ¶
type GitlabCommitStatus struct {
*gogitlab.CommitStatus
}
func (*GitlabCommitStatus) Info ¶
func (gS *GitlabCommitStatus) Info() string
type GitlabCommitStatusOptions ¶
type GitlabCommitStatusOptions struct {
*gogitlab.SetCommitStatusOptions
}
func (*GitlabCommitStatusOptions) GetContext ¶
func (gO *GitlabCommitStatusOptions) GetContext() string
func (*GitlabCommitStatusOptions) GetDescription ¶
func (gO *GitlabCommitStatusOptions) GetDescription() string
func (*GitlabCommitStatusOptions) GetName ¶
func (gO *GitlabCommitStatusOptions) GetName() string
func (*GitlabCommitStatusOptions) GetPipelineID ¶
func (gO *GitlabCommitStatusOptions) GetPipelineID() int
func (*GitlabCommitStatusOptions) GetState ¶
func (gO *GitlabCommitStatusOptions) GetState() string
func (*GitlabCommitStatusOptions) GetTargetURL ¶
func (gO *GitlabCommitStatusOptions) GetTargetURL() string
type GitlabMR ¶
type GitlabMR struct {
*gogitlab.MergeRequest
}
func (*GitlabMR) GetInternalID ¶
func (*GitlabMR) GetSourceBranch ¶
func (*GitlabMR) GetTargetBranch ¶
func (*GitlabMR) HasConflicts ¶
type GitlabMRApproval ¶
type GitlabMRApproval struct {
*gogitlab.MergeRequestApprovals
}
func (*GitlabMRApproval) IsApproved ¶
func (gm *GitlabMRApproval) IsApproved() bool
type GitlabMRAuthor ¶
func (*GitlabMRAuthor) GetUsername ¶
func (ga *GitlabMRAuthor) GetUsername() string
type GitlabMRDiscussion ¶
type GitlabMRDiscussion struct {
*gogitlab.Discussion
}
func (*GitlabMRDiscussion) GetDiscussionID ¶
func (gd *GitlabMRDiscussion) GetDiscussionID() string
func (*GitlabMRDiscussion) GetMRNotes ¶
func (gd *GitlabMRDiscussion) GetMRNotes() []vcs.MRNote
type GitlabMRNote ¶
func (*GitlabMRNote) GetNoteID ¶
func (gn *GitlabMRNote) GetNoteID() int64
type GitlabMergeCommentEvent ¶
type GitlabMergeCommentEvent struct {
*gogitlab.MergeCommentEvent
}
func (*GitlabMergeCommentEvent) GetAttributes ¶
func (gE *GitlabMergeCommentEvent) GetAttributes() vcs.MRAttributes
func (*GitlabMergeCommentEvent) GetAuthor ¶
func (gE *GitlabMergeCommentEvent) GetAuthor() vcs.MRAuthor
func (*GitlabMergeCommentEvent) GetDiscussionID ¶
func (gE *GitlabMergeCommentEvent) GetDiscussionID() string
func (*GitlabMergeCommentEvent) GetInternalID ¶
func (gE *GitlabMergeCommentEvent) GetInternalID() int
func (*GitlabMergeCommentEvent) GetLastCommit ¶
func (gE *GitlabMergeCommentEvent) GetLastCommit() vcs.Commit
func (*GitlabMergeCommentEvent) GetMR ¶
func (gE *GitlabMergeCommentEvent) GetMR() vcs.MR
func (*GitlabMergeCommentEvent) GetNote ¶
func (gE *GitlabMergeCommentEvent) GetNote() string
func (*GitlabMergeCommentEvent) GetPathWithNamespace ¶
func (gE *GitlabMergeCommentEvent) GetPathWithNamespace() string
func (*GitlabMergeCommentEvent) GetProject ¶
func (gE *GitlabMergeCommentEvent) GetProject() vcs.Project
func (*GitlabMergeCommentEvent) GetSHA ¶
func (gE *GitlabMergeCommentEvent) GetSHA() string
func (*GitlabMergeCommentEvent) GetSourceBranch ¶
func (gE *GitlabMergeCommentEvent) GetSourceBranch() string
func (*GitlabMergeCommentEvent) GetTargetBranch ¶
func (gE *GitlabMergeCommentEvent) GetTargetBranch() string
func (*GitlabMergeCommentEvent) GetType ¶
func (gE *GitlabMergeCommentEvent) GetType() string
func (*GitlabMergeCommentEvent) GetUsername ¶
func (gE *GitlabMergeCommentEvent) GetUsername() string
type GitlabPipeline ¶
type GitlabPipeline struct {
*gogitlab.PipelineInfo
}
func (*GitlabPipeline) GetID ¶
func (gP *GitlabPipeline) GetID() int
func (*GitlabPipeline) GetSource ¶
func (gP *GitlabPipeline) GetSource() string
type RunStatusUpdater ¶
type RunStatusUpdater struct {
// contains filtered or unexported fields
}
func NewRunStatusProcessor ¶
func NewRunStatusProcessor(client *GitlabClient, rs runstream.StreamClient, tfc tfc_api.ApiClient) *RunStatusUpdater
func (*RunStatusUpdater) Close ¶
func (p *RunStatusUpdater) Close()