migrate

package
v0.0.0-...-4c964c4 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2025 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InfoCommentMessage = "This pull request has been imported. Non-existent users who were originally listed " +
		"as the pull request author or commenter have been replaced by the principal '%s' which performed the migration.\n" +
		"Unknown emails: %v"
	MaxNumberOfUnknownEmails = 500 // limit keeping unknown users to avoid info comment text exceed ~1000 characters
)
View Source
const ExternalRuleTypeBranch = migratetypes.RuleTypeBranch

Variables

Functions

This section is empty.

Types

type ExternalBranchPattern

type ExternalBranchPattern = migratetypes.BranchPattern

type ExternalComment

type ExternalComment = migratetypes.Comment

type ExternalDefinition

type ExternalDefinition = migratetypes.Definition

type ExternalLabel

type ExternalLabel = migratetypes.Label

type ExternalPullRequest

type ExternalPullRequest = migratetypes.PullRequestData

type ExternalRule

type ExternalRule = migratetypes.Rule

type ExternalRuleType

type ExternalRuleType = migratetypes.RuleType

type ExternalWebhook

type ExternalWebhook = migratetypes.Hook

type Label

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

Label is label migrate.

func NewLabel

func NewLabel(
	labelStore store.LabelStore,
	labelValueStore store.LabelValueStore,
	spaceStore store.SpaceStore,
	tx dbtx.Transactor,
) *Label

func ProvideLabelImporter

func ProvideLabelImporter(
	tx dbtx.Transactor,
	labelStore store.LabelStore,
	labelValueStore store.LabelValueStore,
	spaceStore store.SpaceStore,
) *Label

func (Label) Import

func (migrate Label) Import(
	ctx context.Context,
	migrator types.Principal,
	space *types.Space,
	extLabels []*ExternalLabel,
) ([]*types.Label, error)

type PullReq

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

PullReq is pull request migrate.

func NewPullReq

func NewPullReq(
	urlProvider url.Provider,
	git git.Interface,
	principalStore store.PrincipalStore,
	spaceStore store.SpaceStore,
	repoStore store.RepoStore,
	pullReqStore store.PullReqStore,
	pullReqActStore store.PullReqActivityStore,
	labelStore store.LabelStore,
	labelValueStore store.LabelValueStore,
	pullReqLabelAssignmentStore store.PullReqLabelAssignmentStore,
	tx dbtx.Transactor,
	mtxManager lock.MutexManager,
) *PullReq

func ProvidePullReqImporter

func ProvidePullReqImporter(
	urlProvider url.Provider,
	git git.Interface,
	principalStore store.PrincipalStore,
	spaceStore store.SpaceStore,
	repoStore store.RepoStore,
	pullReqStore store.PullReqStore,
	pullReqActStore store.PullReqActivityStore,
	labelStore store.LabelStore,
	labelValueStore store.LabelValueStore,
	pullReqLabelAssignmentStore store.PullReqLabelAssignmentStore,
	tx dbtx.Transactor,
	mtxManager lock.MutexManager,
) *PullReq

func (PullReq) Import

func (migrate PullReq) Import(
	ctx context.Context,
	migrator types.Principal,
	repo *types.Repository,
	extPullReqs []*ExternalPullRequest,
) ([]*types.PullReq, error)

Import load provided pull requests in go-scm format and imports them.

type Rule

type Rule struct {
	DefDeserializationMap     map[migratetypes.RuleType]definitionDeserializer
	PatternDeserializationMap map[migratetypes.RuleType]patternDeserializer
	// contains filtered or unexported fields
}

func NewRule

func NewRule(
	ruleStore store.RuleStore,
	tx dbtx.Transactor,
	principalStore store.PrincipalStore,
) *Rule

func ProvideRuleImporter

func ProvideRuleImporter(
	ruleStore store.RuleStore,
	tx dbtx.Transactor,
	principalStore store.PrincipalStore,
) *Rule

func (Rule) Import

func (migrate Rule) Import(
	ctx context.Context,
	migrator types.Principal,
	repo *types.Repository,
	typ ExternalRuleType,
	extRules []*ExternalRule,
) ([]*types.Rule, error)

type Webhook

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

Webhook is webhook migrate.

func NewWebhook

func NewWebhook(
	config webhook.Config,
	tx dbtx.Transactor,
	webhookStore store.WebhookStore,
) *Webhook

func ProvideWebhookImporter

func ProvideWebhookImporter(
	config webhook.Config,
	tx dbtx.Transactor,
	webhookStore store.WebhookStore,
) *Webhook

func (Webhook) Import

func (migrate Webhook) Import(
	ctx context.Context,
	migrator types.Principal,
	repo *types.Repository,
	extWebhooks []*ExternalWebhook,
) ([]*types.Webhook, error)

Jump to

Keyboard shortcuts

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