tasks

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddPagingQueryToUrl added in v0.3.0

func AddPagingQueryToUrl(url string) string

func CollectChildrenOnCommits

func CollectChildrenOnCommits(owner string, repositoryName string, repositoryId int, scheduler *utils.WorkerScheduler, githubApiClient *GithubApiClient)

func CollectChildrenOnIssues added in v0.3.0

func CollectChildrenOnIssues(owner string, repositoryName string, repositoryId int, scheduler *utils.WorkerScheduler, githubApiClient *GithubApiClient) error

func CollectChildrenOnPullRequests

func CollectChildrenOnPullRequests(owner string, repositoryName string, repositoryId int, scheduler *utils.WorkerScheduler, githubApiClient *GithubApiClient) error

func CollectCommit

func CollectCommit(owner string, repositoryName string, repositoryId int, commit *models.GithubCommit, githubApiClient *GithubApiClient) error

func CollectCommits

func CollectCommits(owner string, repositoryName string, repositoryId int, scheduler *utils.WorkerScheduler, githubApiClient *GithubApiClient) error

func CollectIssueComments added in v0.3.0

func CollectIssueComments(owner string, repositoryName string, issue *models.GithubIssue, scheduler *utils.WorkerScheduler, githubApiClient *GithubApiClient) error

func CollectIssueEvents added in v0.3.0

func CollectIssueEvents(owner string, repositoryName string, issue *models.GithubIssue, scheduler *utils.WorkerScheduler, githubApiClient *GithubApiClient) error

func CollectIssueLabelsForSingleIssue added in v0.3.0

func CollectIssueLabelsForSingleIssue(owner string, repositoryName string, issue *models.GithubIssue, scheduler *utils.WorkerScheduler, githubApiClient *GithubApiClient) error

func CollectIssueLabelsForSinglePullRequest added in v0.3.0

func CollectIssueLabelsForSinglePullRequest(owner string, repositoryName string, pr *models.GithubPullRequest, scheduler *utils.WorkerScheduler, githubApiClient *GithubApiClient) error

func CollectIssues

func CollectIssues(owner string, repositoryName string, repositoryId int, scheduler *utils.WorkerScheduler, githubApiClient *GithubApiClient) error

func CollectPullRequest

func CollectPullRequest(owner string, repositoryName string, repositoryId int, pr *models.GithubPullRequest, githubApiClient *GithubApiClient) error

func CollectPullRequestComments

func CollectPullRequestComments(owner string, repositoryName string, pull *models.GithubPullRequest, scheduler *utils.WorkerScheduler, githubApiClient *GithubApiClient) error

func CollectPullRequestCommits

func CollectPullRequestCommits(owner string, repositoryName string, pull *models.GithubPullRequest, scheduler *utils.WorkerScheduler, githubApiClient *GithubApiClient) error

func CollectPullRequestReviews

func CollectPullRequestReviews(owner string, repositoryName string, repositoryId int, pull *models.GithubPullRequest, scheduler *utils.WorkerScheduler, githubApiClient *GithubApiClient) error

func CollectRepository

func CollectRepository(owner string, repositoryName string, githubApiClient *GithubApiClient) (int, error)

func CollectRepositoryIssueLabels added in v0.3.0

func CollectRepositoryIssueLabels(owner string, repositoryName string, scheduler *utils.WorkerScheduler, githubApiClient *GithubApiClient) error

func EnrichIssues added in v0.4.0

func EnrichIssues() error

func SetPriority added in v0.4.0

func SetPriority(matches []string, value string) error

func SetType added in v0.4.0

func SetType(matches []string, value string) 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 ApiIssueLabelResponse added in v0.3.0

type ApiIssueLabelResponse []IssueLabel

type ApiIssuesResponse

type ApiIssuesResponse []IssuesResponse

type ApiPullRequestCommentResponse

type ApiPullRequestCommentResponse []PullRequestComment

type ApiPullRequestCommitResponse

type ApiPullRequestCommitResponse []PrCommitsResponse

type ApiPullRequestReviewResponse

type ApiPullRequestReviewResponse []PullRequestReview

type ApiRepositoryResponse

type ApiRepositoryResponse struct {
	Name     string `json:"name"`
	GithubId int    `json:"id"`
	HTMLUrl  string `json:"html_url"`
}

type ApiSingleCommitResponse

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

type ApiSinglePullResponse

type ApiSinglePullResponse struct {
	Additions      int
	Deletions      int
	Comments       int
	Commits        int
	ReviewComments int `json:"review_comments"`
	Merged         bool
	MergedAt       core.Iso8601Time `json:"merged_at"`
}

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
}

type GithubApiClient

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

func CreateApiClient

func CreateApiClient(endpoint string, tokens []string) *GithubApiClient

func (*GithubApiClient) FetchWithPaginationAnts

func (githubApiClient *GithubApiClient) FetchWithPaginationAnts(resourceUri string, pageSize int, conc int, scheduler *utils.WorkerScheduler, handler GithubPaginationHandler) error

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

func (*GithubApiClient) RunConcurrently added in v0.4.0

func (githubApiClient *GithubApiClient) RunConcurrently(resourceUriFormat string, pageSize int, conc int, scheduler *utils.WorkerScheduler, handler GithubPaginationHandler) error

This method exists in the case where we do not know how many pages of data we have to fetch This loops through the data in chunks of `conc` and if there is any request in there with no data returned, we assume we are at the end of the data required to fetch This is needed since we do not want to make a request to get the paging details first since the rate limit for github is so low

type GithubPaginationHandler

type GithubPaginationHandler func(res *http.Response) error

type IssueComment added in v0.3.0

type IssueComment struct {
	GithubId int `json:"id"`
	Body     string
	User     struct {
		Login string
	}
	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
	}
	GithubCreatedAt core.Iso8601Time `json:"created_at"`
}

type IssueLabel added in v0.3.0

type IssueLabel struct {
	GithubId    int `json:"id"`
	Name        string
	Description string
	Color       string
}

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"`
	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 PrCommit

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

type PrCommitsResponse

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

type PullRequestComment added in v0.3.0

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

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