gitlab

package
v0.31.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Overview

Package gitlab provides automatic migration tools from GitLab to Harness.

Index

Constants

View Source
const CheckpointKeyUsers = "users"

Variables

This section is empty.

Functions

This section is empty.

Types

type Error added in v0.24.0

type Error struct {
	Code    string `json:"code"`
	Message string `json:"message"`
}

func (*Error) Error added in v0.24.0

func (e *Error) Error() string

type Export added in v0.24.0

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

func New added in v0.24.0

func New(
	client *scm.Client,
	group string,
	project string,
	checkpointer *checkpoint.CheckpointManager,
	logger *gitexporter.FileLogger,
	tracer tracer.Tracer,
	report map[string]*report.Report,
) *Export

func (*Export) FindEmailByUserID added in v0.26.0

func (e *Export) FindEmailByUserID(ctx context.Context, id int) (string, error)

func (*Export) FindEmailByUsername added in v0.24.0

func (e *Export) FindEmailByUsername(ctx context.Context, username string) (string, error)

func (*Export) FindPR added in v0.24.0

func (e *Export) FindPR(
	ctx context.Context,
	repoSlug string,
	prNumber int,
) (*types.PRResponse, *scm.Response, error)

func (*Export) GetMergeRequestRules added in v0.26.0

func (e *Export) GetMergeRequestRules(ctx context.Context, repoSlug string) (*types.BranchRule, error)

func (*Export) GetPRCounts added in v0.24.0

func (e *Export) GetPRCounts(
	ctx context.Context,
	repoSlug string,
) (int, error)

func (*Export) GetUserByID added in v0.26.0

func (e *Export) GetUserByID(
	ctx context.Context,
	userID int,
) (*user, *scm.Response, error)

func (*Export) GetUserByUserName added in v0.24.0

func (e *Export) GetUserByUserName(
	ctx context.Context,
	userName string,
) (*types.User, *scm.Response, error)

func (*Export) ListBranchRules added in v0.24.0

func (e *Export) ListBranchRules(
	ctx context.Context,
	repoSlug string,
	opts types.ListOptions,
) ([]*types.BranchRule, error)

func (*Export) ListBranchRulesInternal added in v0.26.0

func (e *Export) ListBranchRulesInternal(ctx context.Context,
	repoSlug string,
	opts types.ListOptions,
) ([]*types.BranchRule, *scm.Response, error)

func (*Export) ListLabels added in v0.24.0

func (e *Export) ListLabels(
	ctx context.Context,
	repoSlug string,
	opts types.ListOptions,
) (map[string]externalTypes.Label, error)

func (*Export) ListPRComments added in v0.24.0

func (e *Export) ListPRComments(
	ctx context.Context,
	repoSlug string,
	prNumber int,
	opts types.ListOptions,
) ([]*types.PRComment, *scm.Response, error)

func (*Export) ListPullRequestComments added in v0.24.0

func (e *Export) ListPullRequestComments(
	ctx context.Context,
	repoSlug string,
	prNumber int,
	opts types.ListOptions,
) ([]*types.PRComment, error)

func (*Export) ListPullRequests added in v0.24.0

func (e *Export) ListPullRequests(
	ctx context.Context,
	repoSlug string,
	opt types.PullRequestListOptions,
) ([]types.PRResponse, error)

func (*Export) ListRepoLabels added in v0.24.0

func (e *Export) ListRepoLabels(
	ctx context.Context,
	repoSlug string,
	opts types.ListOptions,
) ([]externalTypes.Label, *scm.Response, error)

func (*Export) ListRepositories added in v0.24.0

func (e *Export) ListRepositories(
	ctx context.Context,
	params types.ListOptions,
) ([]types.RepoResponse, error)

func (*Export) ListWebhooks added in v0.24.0

func (e *Export) ListWebhooks(
	ctx context.Context,
	repoSlug string,
	options types.ListOptions,
) (types.WebhookData, error)

func (*Export) PullRequestRefs added in v0.24.0

func (e *Export) PullRequestRefs() []config.RefSpec

func (*Export) PullRequestReviewers added in v0.24.0

func (e *Export) PullRequestReviewers(ctx context.Context, prNumber int) error

PullRequestReviewers implements gitexporter.Interface.

type Exporter

type Exporter struct {
	Gitlab    *scm.Client
	GitlabOrg string

	Tracer tracer.Tracer
}

Exporter exports data from Circle.

func (*Exporter) Export

func (m *Exporter) Export(ctx context.Context) (*types.Org, error)

Export exports gitlab data.

type Importer

type Importer struct {
	Harness      harness.Client
	HarnessOrg   string
	HarnessToken string

	ScmType  string // github, gitlab, bitbucket
	ScmLogin string
	ScmToken string

	Tracer tracer.Tracer
}

Importer imports data from gitlab to Harness.

func (*Importer) Import

func (m *Importer) Import(ctx context.Context, data *types.Org) error

Jump to

Keyboard shortcuts

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