Help us shape the future of Go! Take the 2026 Go Developer Survey

gitlab

package
v0.50.2 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddGitLabProjectMember added in v0.44.0

func AddGitLabProjectMember(client *gitlab.Client, projectID int, userID int64, accessLevel gitlab.AccessLevelValue, logger *zap.SugaredLogger) error

func CleanTag added in v0.28.1

func CleanTag(client *gitlab2.Client, pid int, tagName string)

CleanTag a wrapper function on DeleteTag to ignore errors in cleaning.

func CreateCRD

func CreateCRD(ctx context.Context, topts *TestOpts) error

func CreateGitLabProject added in v0.43.0

func CreateGitLabProject(client *gitlab.Client, groupPath, projectName, hookURL, webhookSecret string, isPrivate bool, logger *zap.SugaredLogger) (*gitlab.Project, error)

CreateGitLabProject creates a new GitLab project inside a group and adds a webhook pointing to the given hookURL (for example, a smee channel URL used to forward events to the controller). The project is initialised with a README on the "main" branch.

func CreateMR

func CreateMR(client *gitlab.Client, pid int, sourceBranch, targetBranch, title string) (int, error)

func CreateTag added in v0.28.1

func CreateTag(client *gitlab.Client, pid int, tagName string) error

func DeleteTag added in v0.28.1

func DeleteTag(client *gitlab.Client, pid int, tagName string) error

func ForkGitLabProject added in v0.44.0

func ForkGitLabProject(client *gitlab.Client, projectID int, namespacePath string, isPrivate bool, logger *zap.SugaredLogger) (*gitlab.Project, error)

func HasSecondIdentity added in v0.44.0

func HasSecondIdentity() bool

func Setup

func SetupSecond added in v0.44.0

func SetupSecond(ctx context.Context, run *params.Run) (options.E2E, *gitlab.Provider, error)

func SetupSecondIdentity added in v0.44.0

func SetupSecondIdentity(ctx context.Context, topts *TestOpts) error

func TearDown

func TearDown(ctx context.Context, t *testing.T, topts *TestOpts)

func TestMR added in v0.43.0

func TestMR(t *testing.T, topts *TestOpts) (context.Context, func())

TestMR is the unified lifecycle function for GitLab E2E tests. It creates a fresh project, sets up the CRD, pushes files, creates a merge request, and returns a cleanup function.

func WaitForGitLabCommitStatusCount added in v0.46.0

func WaitForGitLabCommitStatusCount(ctx context.Context, client *clientGitlab.Client, logger *zap.SugaredLogger, projectID int, sha, targetStatus string, minCount int) (int, error)

Types

type TestOpts added in v0.43.0

type TestOpts struct {
	TargetNS             string
	TargetRefName        string
	TargetEvent          string
	DefaultBranch        string
	ProjectID            int
	ProjectInfo          *gitlab.Project
	MRNumber             int
	GitCloneURL          string
	GitHTMLURL           string
	SHA                  string
	ParamsRun            *params.Run
	GLProvider           *gitlab2.Provider
	SecondGLProvider     *gitlab2.Provider
	Opts                 options.E2E
	SecondOpts           options.E2E
	YAMLFiles            map[string]string
	ExtraArgs            map[string]string
	Regexp               *regexp.Regexp
	CheckForStatus       string
	CheckForNumberStatus int
	Settings             *v1alpha1.Settings
	Incomings            *[]v1alpha1.Incoming
	NoMRCreation         bool
	SkipEventsCheck      bool
	ExpectEvents         bool
}

Jump to

Keyboard shortcuts

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