migration

package
v0.0.0-...-b6e965f Latest Latest
Warning

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

Go to latest
Published: May 7, 2026 License: MIT Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	GiteaOwner          string
	GiteaRepo           string
	GitHubOwner         string
	GitHubRepo          string
	Logger              hclog.Logger
	PRSuccessCount      int
	PRFailureCount      int
	IssueSuccessCount   int
	IssueFailureCount   int
	GitHubItemID        int64
	GitHubReleaseID     int64
	ReleaseSuccessCount int
	ReleaseFailureCount int
	GiteaRepository     *gitea.Repository
	GitRepo             *git.Repository

	Cache *cache.Cache
	// contains filtered or unexported fields
}

func NewEntry

func NewEntry(giteaSlug, githubSlug string, giteaClient *gitea.Client, githubClient *github.Client, logger hclog.Logger, appCache *cache.Cache) (*Entry, error)

func (*Entry) GetAllGiteaIssues

func (e *Entry) GetAllGiteaIssues(ctx context.Context, issueType gitea.IssueType, countMode bool) ([]*gitea.Issue, int, error)

GetAllGiteaIssues has two modes: "actual retrieval" and "count". In "actual retrieval" mode, it fetches all available items of the given type from Gitea. In "count" mode it fetches the first page and returns only the "x-total-count" header.

func (*Entry) GetAllGiteaPullRequests

func (e *Entry) GetAllGiteaPullRequests(ctx context.Context, countMode bool) ([]*gitea.PullRequest, int, error)

GetAllGiteaPullRequests has two modes: "actual retrieval" and "count". In "actual retrieval" mode, it fetches all available PRs from Gitea. In "count" mode it fetches the first page and returns only the "x-total-count" header.

func (*Entry) GetAllGiteaReleases

func (e *Entry) GetAllGiteaReleases(ctx context.Context, countMode bool) ([]*gitea.Release, int, error)

GetAllGiteaReleases has two modes: "actual retrieval" and "count". In "actual retrieval" mode, it fetches all available releases from Gitea. In "count" mode it fetches the first page and returns only the "x-total-count" header.

func (*Entry) GetAllPullRequestReviewComments

func (e *Entry) GetAllPullRequestReviewComments(ctx context.Context, giteaItemId int64, review *gitea.PullReview) ([]*gitea.PullReviewComment, error)

func (*Entry) GetAllPullRequestReviews

func (e *Entry) GetAllPullRequestReviews(ctx context.Context, giteaItemId int64) ([]*gitea.PullReview, error)

func (*Entry) GetCacheID

func (e *Entry) GetCacheID() string

func (*Entry) MigrateComments

func (e *Entry) MigrateComments(ctx context.Context, giteaItemId int64, githubItemId int64) (map[int64]cache.CommentCacheEntry, error)

MigrateComments migrates comments from a Gitea item to the corresponding GitHub item.

When non-empty (cache-file mode) each comment is compared by GiteaHash and GitHubHash and updated in-place via its cached GitHub ID, avoiding a full GitHub comment list fetch. When empty (non cache-file mode) the existing GitHub comments are fetched and matched by body content, populating the map for future runs.

The returned map is the updated commentEntries and must be persisted by the caller.

func (*Entry) MigratePullRequestReviews

func (e *Entry) MigratePullRequestReviews(ctx context.Context, giteaItemId int64, githubItemId int64) (map[int64]cache.ReviewCacheEntry, error)

Jump to

Keyboard shortcuts

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