Documentation
¶
Index ¶
- type Entry
- func (e *Entry) GetAllGiteaIssues(ctx context.Context, issueType gitea.IssueType, countMode bool) ([]*gitea.Issue, int, error)
- func (e *Entry) GetAllGiteaPullRequests(ctx context.Context, countMode bool) ([]*gitea.PullRequest, int, error)
- func (e *Entry) GetAllGiteaReleases(ctx context.Context, countMode bool) ([]*gitea.Release, int, error)
- func (e *Entry) GetAllPullRequestReviewComments(ctx context.Context, giteaItemId int64, review *gitea.PullReview) ([]*gitea.PullReviewComment, error)
- func (e *Entry) GetAllPullRequestReviews(ctx context.Context, giteaItemId int64) ([]*gitea.PullReview, error)
- func (e *Entry) GetCacheID() string
- func (e *Entry) MigrateComments(ctx context.Context, giteaItemId int64, githubItemId int64) (map[int64]cache.CommentCacheEntry, error)
- func (e *Entry) MigratePullRequestReviews(ctx context.Context, giteaItemId int64, githubItemId int64) (map[int64]cache.ReviewCacheEntry, error)
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 (*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 (*Entry) GetCacheID ¶
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.