Documentation
¶
Index ¶
- func GetToken(hostname string) (string, error)
- type Client
- func (c *Client) CreatePullRequest(ctx context.Context, title, body, head, base string, draft bool) (number int, url string, err error)
- func (c *Client) GetLatestRunForBranch(ctx context.Context, branch string) (*remote.Workflow, error)
- func (c *Client) GetLatestWorkflow(ctx context.Context, branch string) (*remote.Workflow, error)
- func (c *Client) GetPullRequestByBranch(ctx context.Context, branch string) (number int, url string, err error)
- func (c *Client) GetPullRequestChecks(ctx context.Context, prNumber int) (*remote.PRChecks, error)
- func (c *Client) GetWorkflowRun(ctx context.Context, runID string) (*remote.Workflow, error)
- func (c *Client) MarkPullRequestReady(ctx context.Context, prNumber int) error
- func (c *Client) MergePullRequest(ctx context.Context, prNumber int, method string) error
- func (c *Client) WaitForChecksToStart(ctx context.Context, prNumber int, timeout time.Duration) (headSHA string, checks *remote.PRChecks, err error)
- func (c *Client) WatchPullRequestChecks(ctx context.Context, prNumber int) (<-chan remote.PRChecksUpdate, error)
- func (c *Client) WatchWorkflow(ctx context.Context, workflowID string) (<-chan remote.WorkflowUpdate, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client implements remote.Provider for GitLab
func NewClientWithBaseURL ¶
NewClientWithBaseURL creates a new GitLab client for self-hosted instances
func (*Client) CreatePullRequest ¶
func (c *Client) CreatePullRequest(ctx context.Context, title, body, head, base string, draft bool) (number int, url string, err error)
CreatePullRequest creates a new merge request
func (*Client) GetLatestRunForBranch ¶ added in v1.7.0
func (c *Client) GetLatestRunForBranch(ctx context.Context, branch string) (*remote.Workflow, error)
GetLatestRunForBranch returns the most recent pipeline for the given branch. On GitLab, all pipelines on a branch share the same .gitlab-ci.yml, so this is equivalent to GetLatestWorkflow.
func (*Client) GetLatestWorkflow ¶
GetLatestWorkflow returns the latest pipeline for the given branch
func (*Client) GetPullRequestByBranch ¶
func (c *Client) GetPullRequestByBranch(ctx context.Context, branch string) (number int, url string, err error)
GetPullRequestByBranch finds an open MR for the given source branch
func (*Client) GetPullRequestChecks ¶
GetPullRequestChecks returns pipeline status for an MR
func (*Client) GetWorkflowRun ¶ added in v1.7.0
GetWorkflowRun returns a pipeline by its ID.
func (*Client) MarkPullRequestReady ¶
MarkPullRequestReady marks a draft MR as ready for review
func (*Client) MergePullRequest ¶
MergePullRequest merges a merge request
func (*Client) WaitForChecksToStart ¶
func (c *Client) WaitForChecksToStart(ctx context.Context, prNumber int, timeout time.Duration) (headSHA string, checks *remote.PRChecks, err error)
WaitForChecksToStart waits for pipeline to be created on the MR
func (*Client) WatchPullRequestChecks ¶
func (c *Client) WatchPullRequestChecks(ctx context.Context, prNumber int) (<-chan remote.PRChecksUpdate, error)
WatchPullRequestChecks watches pipeline status for an MR
func (*Client) WatchWorkflow ¶
func (c *Client) WatchWorkflow(ctx context.Context, workflowID string) (<-chan remote.WorkflowUpdate, error)
WatchWorkflow watches a pipeline and sends updates