gitlab

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: May 1, 2023 License: MPL-2.0 Imports: 21 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const DefaultMaxRetries = 3
View Source
const GITLAB_CLONE_DEPTH_ENV = "TFBUDDY_GITLAB_CLONE_DEPTH"
View Source
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(mrIID int, project, discussionID, comment string) (vcs.MRNote, error)

AddMergeRequestDiscussionReply creates a comment on the merge request.

func (*GitlabClient) CloneMergeRequest

func (c *GitlabClient) CloneMergeRequest(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(mrIID int, projectID, comment string) error

CreateMergeRequestComment creates a comment on the merge request.

func (*GitlabClient) CreateMergeRequestDiscussion

func (c *GitlabClient) CreateMergeRequestDiscussion(mrIID int, project, comment string) (vcs.MRDiscussionNotes, error)

func (*GitlabClient) GetCommitStatuses

func (c *GitlabClient) GetCommitStatuses(projectID, commitSHA string) []*gogitlab.CommitStatus

func (*GitlabClient) GetMergeRequest

func (g *GitlabClient) GetMergeRequest(mrIID int, project string) (vcs.DetailedMR, error)

func (*GitlabClient) GetMergeRequestApprovals

func (g *GitlabClient) GetMergeRequestApprovals(mrIID int, project string) (vcs.MRApproved, error)

func (*GitlabClient) GetMergeRequestModifiedFiles

func (g *GitlabClient) GetMergeRequestModifiedFiles(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) GetPipelinesForCommit

func (g *GitlabClient) GetPipelinesForCommit(project, commitSHA string) ([]vcs.ProjectPipeline, error)

func (*GitlabClient) GetRepoFile

func (g *GitlabClient) GetRepoFile(project, file, ref string) ([]byte, error)

GetRepoFile retrieves a single file from a Gitlab repository using the RepositoryFiles API

func (*GitlabClient) ResolveMergeRequestDiscussion

func (c *GitlabClient) ResolveMergeRequestDiscussion(projectWithNamespace string, mrIID int, discussionID string) error

func (*GitlabClient) ResolveMergeRequestDiscussionReply

func (c *GitlabClient) ResolveMergeRequestDiscussionReply(mrIID int, project, discussionID string, resolved bool) error

ResolveMergeRequestDiscussionReply marks a discussion thread as resolved / unresolved.

func (*GitlabClient) SetCommitStatus

func (c *GitlabClient) SetCommitStatus(projectWithNS string, commitSHA string, status vcs.CommitStatusOptions) (vcs.CommitStatus, error)

func (*GitlabClient) UpdateMergeRequestDiscussionNote

func (c *GitlabClient) UpdateMergeRequestDiscussionNote(mrIID, noteID int, project, discussionID, comment string) (vcs.MRNote, error)

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) GetAuthor

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

func (*GitlabMR) GetInternalID

func (gm *GitlabMR) GetInternalID() int

func (*GitlabMR) GetSourceBranch

func (gm *GitlabMR) GetSourceBranch() string

func (*GitlabMR) GetTargetBranch

func (gm *GitlabMR) GetTargetBranch() string

func (*GitlabMR) GetTitle

func (gm *GitlabMR) GetTitle() string

func (*GitlabMR) GetWebURL

func (gm *GitlabMR) GetWebURL() string

func (*GitlabMR) HasConflicts

func (gm *GitlabMR) HasConflicts() bool

type GitlabMRApproval

type GitlabMRApproval struct {
	*gogitlab.MergeRequestApprovals
}

func (*GitlabMRApproval) IsApproved

func (gm *GitlabMRApproval) IsApproved() bool

type GitlabMRAuthor

type GitlabMRAuthor struct {
	*gogitlab.BasicUser
}

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

type GitlabMRNote struct {
	*gogitlab.Note
}

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()

Jump to

Keyboard shortcuts

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