tasks

package
v0.9.1-test3 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2022 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const BatchSize = 100

Variables

This section is empty.

Functions

func CollectCommit

func CollectCommit(
	owner string,
	repo string,
	repoId int,
	commit *models.GithubCommit,
	apiClient *GithubApiClient,
	ctx context.Context,
) error

for addtions and deletions

func CollectCommits

func CollectCommits(owner string, repo string, repoId int, apiClient *GithubApiClient) error

func CollectCommitsStat added in v0.7.0

func CollectCommitsStat(
	owner string,
	repo string,
	repoId int,
	apiClient *GithubApiClient,
	rateLimitPerSecondInt int,
	ctx context.Context,
) error

func CollectIssueComments added in v0.3.0

func CollectIssueComments(owner string, repo string, apiClient *GithubApiClient) error

CollectIssueComments will collect both issue and pr comments

func CollectIssueEvents added in v0.3.0

func CollectIssueEvents(owner string, repo string, apiClient *GithubApiClient) error

func CollectIssues

func CollectIssues(owner string, repo string, repoId int, apiClient *GithubApiClient) error

func CollectPullRequestCommits

func CollectPullRequestCommits(ctx context.Context, owner string, repo string, repoId int, rateLimitPerSecondInt int, apiClient *GithubApiClient) error

func CollectPullRequestReviews

func CollectPullRequestReviews(ctx context.Context, owner string, repo string, repoId int, apiClient *GithubApiClient, rateLimitPerSecondInt int) error

func CollectPullRequests added in v0.7.0

func CollectPullRequests(
	owner string,
	repo string,
	repoId int,
	apiClient *GithubApiClient,
) error

func CollectRepository

func CollectRepository(owner string, repo string, apiClient *GithubApiClient) (int, error)

func ConvertCommits added in v0.6.0

func ConvertCommits(githubRepoId int, ctx context.Context) error

func ConvertIssueLabels added in v0.7.0

func ConvertIssueLabels(ctx context.Context, repoId int) error

func ConvertIssues added in v0.6.0

func ConvertIssues(ctx context.Context, repoId int) error

func ConvertNotes added in v0.6.0

func ConvertNotes(ctx context.Context, repoId int) error

func ConvertPullRequestIssues added in v0.9.0

func ConvertPullRequestIssues(ctx context.Context, repoId int) error

func ConvertPullRequestLabels added in v0.8.0

func ConvertPullRequestLabels(ctx context.Context, repoId int) error

func ConvertPullRequests added in v0.6.0

func ConvertPullRequests(ctx context.Context, repoId int) error

func ConvertRepos added in v0.6.0

func ConvertRepos(ctx context.Context) error

func ConvertUsers added in v0.6.0

func ConvertUsers(ctx context.Context) error

func EnrichComments added in v0.9.0

func EnrichComments(ctx context.Context, repoId int) error

EnrichComments will enrich issue comments with issue number also move pr comments to github_pull_request_comments

func EnrichIssues added in v0.4.0

func EnrichIssues(ctx context.Context, repoId int) (err error)

func EnrichPullRequestIssues added in v0.9.0

func EnrichPullRequestIssues(ctx context.Context, repoId int, owner string, repo string) (err error)

func EnrichPullRequests added in v0.9.0

func EnrichPullRequests(ctx context.Context, repoId int) (err error)

func PrCommitConvertor added in v0.7.0

func PrCommitConvertor(ctx context.Context, repoId int) (err error)

func ProcessCollection added in v0.7.0

func ProcessCollection(owner string, repo string, pr *models.GithubPullRequest, apiClient *GithubApiClient) error

Types

type ApiCommitsResponse

type ApiCommitsResponse []CommitsResponse

type ApiIssueCommentResponse added in v0.3.0

type ApiIssueCommentResponse []IssueComment

type ApiIssueEventResponse added in v0.3.0

type ApiIssueEventResponse []IssueEvent

type ApiIssuesResponse

type ApiIssuesResponse []IssuesResponse

type ApiPullRequestCommitResponse

type ApiPullRequestCommitResponse []PrCommitsResponse

type ApiPullRequestResponse added in v0.7.0

type ApiPullRequestResponse []GithubApiPullRequest

type ApiPullRequestReviewResponse

type ApiPullRequestReviewResponse []PullRequestReview

type ApiRepositoryResponse

type ApiRepositoryResponse GithubApiRepo

type ApiSingleCommitResponse

type ApiSingleCommitResponse struct {
	Stats struct {
		Additions int
		Deletions int
	}
}

type Commit

type Commit struct {
	Author struct {
		Name  string
		Email string
		Date  core.Iso8601Time
	}
	Committer struct {
		Name  string
		Email string
		Date  core.Iso8601Time
	}
	Message string
}

type CommitsResponse

type CommitsResponse struct {
	Sha       string `json:"sha"`
	Commit    Commit
	Url       string
	Author    *models.GithubUser
	Committer *models.GithubUser
}

type GithubApiClient

type GithubApiClient struct {
	core.ApiClient
	// contains filtered or unexported fields
}

func NewGithubApiClient added in v0.9.0

func NewGithubApiClient(endpoint string, tokens []string, ctx context.Context, scheduler *utils.WorkerScheduler) *GithubApiClient

func (*GithubApiClient) FetchPages added in v0.9.0

func (githubApiClient *GithubApiClient) FetchPages(path string, queryParams *url.Values, pageSize int, handler GithubPaginationHandler) error

run all requests in an Ants worker pool conc - number of concurent requests you want to run

type GithubApiPullRequest added in v0.7.0

type GithubApiPullRequest struct {
	GithubId int `json:"id"`
	Number   int
	State    string
	Title    string
	Body     string
	Labels   []struct {
		Name string `json:"name"`
	} `json:"labels"`
	Assignee *struct {
		Login string
		Id    int
	}
	ClosedAt        *core.Iso8601Time `json:"closed_at"`
	MergedAt        *core.Iso8601Time `json:"merged_at"`
	GithubCreatedAt core.Iso8601Time  `json:"created_at"`
	GithubUpdatedAt *core.Iso8601Time `json:"updated_at"`
	MergeCommitSha  string            `json:"merge_commit_sha"`
	Head            struct {
		Ref string
		Sha string
	}
	Base struct {
		Ref string
		Sha string
	}
}

type GithubApiRepo added in v0.6.0

type GithubApiRepo struct {
	Name        string `json:"name"`
	GithubId    int    `json:"id"`
	HTMLUrl     string `json:"html_url"`
	Language    string `json:"language"`
	Description string `json:"description"`
	Owner       models.GithubUser
	Parent      *GithubApiRepo    `json:"parent"`
	CreatedAt   core.Iso8601Time  `json:"created_at"`
	UpdatedAt   *core.Iso8601Time `json:"updated_at"`
}

type GithubPaginationHandler

type GithubPaginationHandler func(res *http.Response) error

type GithubSearchPaginationHandler added in v0.9.0

type GithubSearchPaginationHandler func(res *http.Response) (int, error)

type IssueComment added in v0.3.0

type IssueComment struct {
	GithubId int `json:"id"`
	Body     string
	User     struct {
		Login string
	}
	IssueUrl        string           `json:"issue_url"`
	GithubCreatedAt core.Iso8601Time `json:"created_at"`
}

type IssueEvent added in v0.3.0

type IssueEvent struct {
	GithubId int `json:"id"`
	Event    string
	Actor    struct {
		Login string
	}
	Issue struct {
		Id int
	}
	GithubCreatedAt core.Iso8601Time `json:"created_at"`
}

type IssuesResponse

type IssuesResponse struct {
	GithubId    int `json:"id"`
	Number      int
	State       string
	Title       string
	Body        string
	PullRequest struct {
		Url     string `json:"url"`
		HtmlUrl string `json:"html_url"`
	} `json:"pull_request"`
	Labels []struct {
		Name string `json:"name"`
	} `json:"labels"`

	Assignee *struct {
		Login string
		Id    int
	}
	ClosedAt        *core.Iso8601Time `json:"closed_at"`
	GithubCreatedAt core.Iso8601Time  `json:"created_at"`
	GithubUpdatedAt core.Iso8601Time  `json:"updated_at"`
}

type PrCommitsResponse

type PrCommitsResponse struct {
	Sha    string `json:"sha"`
	Commit PullRequestCommit
	Url    string
}

type PullRequestCommit added in v0.7.0

type PullRequestCommit struct {
	Author struct {
		Name  string
		Email string
		Date  core.Iso8601Time
	}
	Committer struct {
		Name  string
		Email string
		Date  core.Iso8601Time
	}
	Message string
}

type PullRequestReview

type PullRequestReview struct {
	GithubId int `json:"id"`
	User     struct {
		Id    int
		Login string
	}
	Body        string
	State       string
	SubmittedAt core.Iso8601Time `json:"submitted_at"`
}

Jump to

Keyboard shortcuts

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