common

package
v0.43.1 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultLimit              = 25
	RepoCheckpointPage        = "org/%s"
	RepoCheckpointData        = "org/%s/data"
	PullRequestCheckpointPage = "%s/pr"
	PullRequestCheckpointData = "%s/pr/data"
	PRCommentCheckpointPage   = "%s/%d/comment"
	PRCommentCheckpointData   = "%s/%d/comment/data"
	PRReviewerCheckpointPage  = "%s/%d/reviewer"
	PRReviewerCheckpointData  = "%s/%d/reviewer/data"
	LabelCheckpointPage       = "%s/labels"
	LabelCheckpointData       = "%s/labels/data"
	WebhookCheckpointPage     = "%s/webhook"
	WebhookCheckpointData     = "%s/webhook/data"
	RuleCheckpointPage        = "%s/rule"
	RuleCheckpointData        = "%s/rule/data"
	RuleSetCheckpointPage     = "%s/ruleset"
	RuleSetCheckpointData     = "%s/ruleset/data"
)
View Source
const (
	MsgStartExport               = "Starting export repo(s)."
	MsgCompleteExport            = "Finished export repo(s). Total repos: %d"
	MsgStartExportPRs            = "Starting export pull requests for repository %s."
	MsgCompleteExportPRs         = "Finished export %d pull requests for repository %s."
	MsgCheckpointLoadPr          = "Finished export %d pull requests for repository %s from checkpoint."
	MsgStartRepoList             = "Starting repositories listing for %s %s: %s."
	MsgCompleteRepoList          = "Finished repositories listing. Total repos: %d"
	MsgStartGitClone             = "Cloning git repository for %s."
	MsgRepoAlreadyExists         = "Cloned git repository for %s already exists."
	MsgCompleteGitClone          = "Finished clone for %s."
	MsgGitCloneEmptyRepo         = "Empty repo %s, skipping clone and other metadata."
	MsgStartExportWebhook        = "Starting webhooks export for repository %s."
	MsgCompleteExportWebhooks    = "Finished export %d webhooks for repository %s."
	MsgStartExportPrComments     = "Starting export comments for repository %s pull request number %d."
	MsgCompleteExportPrComments  = "Finished export %d comments for repository %s pull request number %d."
	MsgStartExportPrReviewers    = "Starting export reviewers for repository %s pull request number %d."
	MsgCompleteExportPrReviewers = "Finished export %d reviewers for repository %s pull request number %d."
	MsgStartCommentsFetch        = "Starting fetching comments for PRs in repo %s"
	MsgCompleteCommentsFetch     = "Finished fetching comments for PRs in repo %s"
	MsgCheckpointLoadPRComments  = "Finished export %d comments for repository %s pull request number %d from checkpoint."
	MsgCheckpointLoadPRReviewers = "Finished export %d reviewers for repository %s pull request number %d from checkpoint."
	MsgStartExportBranchRules    = "Starting export branch rules for repository %s."
	MsgFailedExportBranchRules   = "Could not export branch rules for repository %s."
	MsgCompleteExportBranchRules = "Finished export %d branch rules for repository %s."
	MsgStartExportLabels         = "Starting export labels for repository %s."
	MsgCompleteExportLabels      = "Finished export %d labels for repository %s."
	MsgStartRepoLFSEnabled       = "Starting check Git LFS is enabled for repository %s."
	MsgCompleteRepoLFSEnabled    = "Finished check Git LFS is enabled for repository %s."

	MsgStartImportFromFolders    = "Starting import repositories from folders: %v"
	MsgCompleteImport            = "Finished import repositories. Total repos: %d."
	MsgStartGetRepoSetting       = "Starting get repository settings for %s"
	MsgCompleteGetRepoSetting    = "Finished get repository settings for %s, push size limit is %d, Git LFS enabled is %v"
	MsgStartUpdateRepoSetting    = "Starting update repository setting for %s, push size limit to %d, Git LFS enabled to %v"
	MsgCompleteUpdateRepoSetting = "Finished update repository setting for %s, push size limit is %d, Git LFS enabled is %v."
	MsgStartImportCreateRepo     = "Starting create repository %s."
	MsgCompleteImportCreateRepo  = "Finished create repository %s on %s."
	MsgStartImportGit            = "Starting git push to '%s'."
	MsgCompleteImportGit         = "Finished git push to '%s'."
	MsgStartImportBranchRules    = "Starting importing branch rules for repository %s."
	MsgCompleteImportBranchRules = "Finished import %d branch rules for repository %s."
	MsgStartImportPRs            = "Starting importing pull requests and comments for repository %s."
	MsgCompleteImportPRs         = "Finished import %d pull requests with comments for repository %s."
	MsgStartImportLabels         = "Starting importing labels for %s."
	MsgCompleteImportLabels      = "Finished import %d labels for %s."
	MsgStartImportWebhooks       = "Starting importing webhooks for repository %s."
	MsgCompleteImportWebhooks    = "Finished import %d webhooks for repository %s."
	MsgStartRepoCleanup          = "Starting repo cleanup due to an incomplete import of %s"
	MsgCompleteRepoCleanup       = "Finished repo cleanup due to an incomplete import of %s"

	ErrGitClone                      = "cannot clone the git repository %q due to error: %w. output: %s"
	ErrGitFetch                      = "cannot fetch repository references for %s: %w. output: %s"
	ErrFetchLFSObjects               = "cannot pull LFS objects for repository %s: %w"
	ErrCreateRepo                    = "failed to create repository %q at %s due to: %w"
	ErrListWebhook                   = "cannot list webhooks for repository %s: %w"
	ErrListRepo                      = "cannot list repositories due to error :%w"
	ErrCheckpointDataRead            = "cannot read checkpoint data: %w"
	ErrCheckpointRepoDataSave        = "cannot save checkpoint repository data for %s: %w"
	ErrCheckpointRepoPageSave        = "cannot save checkpoint repository page for %s: %w"
	ErrCheckpointPrDataSave          = "cannot save checkpoint pr data: %w"
	ErrCheckpointPrPageSave          = "cannot save checkpoint pr page: %w"
	ErrCheckpointWebhooksDataSave    = "cannot save checkpoint webhook data for '%s': %w"
	ErrCheckpointWebhooksPageSave    = "cannot save checkpoint webhook page for '%s': %w"
	ErrCheckpointRulesDataSave       = "cannot save checkpoint rules data for '%s': %w"
	ErrCheckpointRulesPageSave       = "cannot save checkpoint rules page for '%s': %w"
	ErrCheckpointPrCommentsDataSave  = "cannot save checkpoint pr comments data: %w"
	ErrCheckpointPrCommentsPageSave  = "cannot save checkpoint pr comments page: %w"
	ErrCheckpointPrReviewersDataSave = "cannot save checkpoint pr reviewers data: %w"
	ErrCheckpointPrReviewersPageSave = "cannot save checkpoint pr reviewers page: %w"
	ErrCheckpointLabelsDataSave      = "cannot save checkpoint labels data: %w"
	ErrCheckpointLabelsPageSave      = "cannot save checkpoint labels page: %w"
	ErrListPr                        = "cannot list pr due to error: %w"
	ErrListComments                  = "cannot list comments for repository %s pull request %d: %w"
	ErrListReviewers                 = "cannot list reviewers for repository %s pull request %d: %w"
	ErrListBranchRules               = "cannot list branch rules for repository %s: %w"
	ErrListBranchRulesets            = "cannot list branch rulesets for repo %s: %w"
	ErrListBranchRuleset             = "cannot list branch ruleset %d for repo %s: %w"
	ErrListWebhooks                  = "cannot list webhooks for repo %s: %w"
	ErrListLabels                    = "cannot list labels for repo %s: %w"
	ErrGitPush                       = "cannot git push to '%s' due to %w. output:%s"
	ErrGitLFSPush                    = "cannot git push LFS objects to '%s' due to %w. output:%s"
	ErrImportBranchRules             = "cannot import branch rules for repository %s: %w"
	ErrImportPRs                     = "cannot import pull requests and comments for repository %s: %w"
	ErrImportWebhooks                = "cannot import webhooks for repository %s: %w"
	ErrImportLabels                  = "cannot import labels for %s: %w"
	ErrCleanupRepo                   = "cannot clean up the repo on server: %w"
	ErrSkipGitLFS                    = "Skipping Git LFS objects migration. If repository has LFS objects please install git and git-lfs to include them: %w"
	ErrGitRemoteAdd                  = "cannot add remote for repository %s: %w"
	ErrRepoLFSEnabled                = "cannot check if LFS is enabled for repository %s: %w"

	PanicCheckpointSaveErr = "error occurred in reading checkpoint data"
	ErrCannotCreateFolder  = "cannot create folder: %w"
	ErrFetchingFileData    = "error fetching data for file: %w"
	ErrWritingFileData     = "error writing data in file: %w"
	ErrGettingComments     = "encountered error in fetching comments: %v"
)

Variables

This section is empty.

Functions

func FormatHunkHeader

func FormatHunkHeader(source, sourceSpan, destination, destinationSpan int, sectionHeading string) string

func MapPRComment

func MapPRComment(comments []*scm.Comment) []*types.PRComment

func MapPRReviewer added in v0.43.1

func MapPRReviewer(reviews []*scm.Review) []*types.PRReview

func MapPullRequest

func MapPullRequest(prs []*scm.PullRequest) []types.PRResponse

func MapRepository

func MapRepository(repos []*scm.Repository) []types.RepoResponse

Types

This section is empty.

Jump to

Keyboard shortcuts

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