gitlab

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetToken

func GetToken(hostname string) (string, error)

GetToken resolves GitLab token from environment or glab CLI Order: GITLAB_TOKEN → GITLAB_PRIVATE_TOKEN → GL_TOKEN → glab auth token

Types

type Client

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

Client implements remote.Provider for GitLab

func NewClient

func NewClient(token, owner, repo string) *Client

NewClient creates a new GitLab client for gitlab.com

func NewClientWithBaseURL

func NewClientWithBaseURL(token, owner, repo, baseURL string) (*Client, error)

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

func (c *Client) GetLatestWorkflow(ctx context.Context, branch string) (*remote.Workflow, error)

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

func (c *Client) GetPullRequestChecks(ctx context.Context, prNumber int) (*remote.PRChecks, error)

GetPullRequestChecks returns pipeline status for an MR

func (*Client) MarkPullRequestReady

func (c *Client) MarkPullRequestReady(ctx context.Context, prNumber int) error

MarkPullRequestReady marks a draft MR as ready for review

func (*Client) MergePullRequest

func (c *Client) MergePullRequest(ctx context.Context, prNumber int, method string) error

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

Jump to

Keyboard shortcuts

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