gitlab

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2024 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PerPageMax        = 100
	PRStateOpen       = "opened"
	PRStateMerged     = "merged"
	PRStateEventClose = "close"

	EnvAPIToken = "GITLAB_TOKEN" // nolint:gosec // Not actually a hardcoded credential

	EnvAPIURL      = "CI_API_V4_URL"
	EnvProjectURL  = "CI_PROJECT_URL"
	EnvProjectPath = "CI_PROJECT_PATH"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type GitLab

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

func New

func New(log *slog.Logger, options *Options) (*GitLab, error)

func (*GitLab) CloneURL added in v0.4.0

func (g *GitLab) CloneURL() string

func (*GitLab) ClosePullRequest added in v0.4.0

func (g *GitLab) ClosePullRequest(ctx context.Context, pr *releasepr.ReleasePullRequest) error

func (*GitLab) CommitsSince added in v0.4.0

func (g *GitLab) CommitsSince(ctx context.Context, tag *git.Tag) ([]git.Commit, error)

func (*GitLab) CreatePullRequest added in v0.4.0

func (g *GitLab) CreatePullRequest(ctx context.Context, pr *releasepr.ReleasePullRequest) error

func (*GitLab) CreateRelease added in v0.4.0

func (g *GitLab) CreateRelease(ctx context.Context, commit git.Commit, title, changelog string, _, _ bool) error

func (*GitLab) EnsureLabelsExist added in v0.4.0

func (g *GitLab) EnsureLabelsExist(ctx context.Context, labels []releasepr.Label) error

func (*GitLab) GitAuth added in v0.4.0

func (g *GitLab) GitAuth() transport.AuthMethod

func (*GitLab) LatestTags added in v0.4.0

func (g *GitLab) LatestTags(ctx context.Context) (git.Releases, error)

func (*GitLab) PendingReleases added in v0.4.0

func (g *GitLab) PendingReleases(ctx context.Context, pendingLabel releasepr.Label) ([]*releasepr.ReleasePullRequest, error)

func (*GitLab) PullRequestForBranch added in v0.4.0

func (g *GitLab) PullRequestForBranch(ctx context.Context, branch string) (*releasepr.ReleasePullRequest, error)

func (*GitLab) PullRequestURL added in v0.4.0

func (g *GitLab) PullRequestURL(id int) string

func (*GitLab) ReleaseURL added in v0.4.0

func (g *GitLab) ReleaseURL(version string) string

func (*GitLab) RepoURL

func (g *GitLab) RepoURL() string

func (*GitLab) SetPullRequestLabels added in v0.4.0

func (g *GitLab) SetPullRequestLabels(ctx context.Context, pr *releasepr.ReleasePullRequest, remove, add []releasepr.Label) error

func (*GitLab) UpdatePullRequest added in v0.4.0

func (g *GitLab) UpdatePullRequest(ctx context.Context, pr *releasepr.ReleasePullRequest) error

type Options added in v0.4.0

type Options struct {
	forge.Options

	ProjectURL string
	Path       string

	APIURL   string
	APIToken string
}

func (*Options) ClientOptions added in v0.4.0

func (g *Options) ClientOptions() []gitlab.ClientOptionFunc

Jump to

Keyboard shortcuts

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