tasks

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CollectAllPipelines

func CollectAllPipelines(projectId int, scheduler *utils.WorkerScheduler) error

func CollectChildrenOnPipelines

func CollectChildrenOnPipelines(projectIdInt int, scheduler *utils.WorkerScheduler)

func CollectCommits

func CollectCommits(projectId int, scheduler *utils.WorkerScheduler) error

func CollectMergeRequestCommits

func CollectMergeRequestCommits(projectId int, mr *models.GitlabMergeRequest) error

func CollectMergeRequestNotes

func CollectMergeRequestNotes(projectId int, mr *models.GitlabMergeRequest) error

func CollectMergeRequests

func CollectMergeRequests(projectId int, scheduler *utils.WorkerScheduler) error

func CollectProject

func CollectProject(projectId int) error

func CreateReviewers

func CreateReviewers(projectId int, mergeRequestId int, reviewers []Reviewer)

func EnrichMergeRequests

func EnrichMergeRequests() error

Types

type ApiCommitResponse

type ApiCommitResponse []struct {
	GitlabId       string `json:"id"`
	Title          string
	Message        string
	ProjectId      int
	ShortId        string `json:"short_id"`
	AuthorName     string `json:"author_name"`
	AuthorEmail    string `json:"author_email"`
	AuthoredDate   string `json:"authored_date"`
	CommitterName  string `json:"committer_name"`
	CommitterEmail string `json:"committer_email"`
	CommittedDate  string `json:"committed_date"`
	WebUrl         string `json:"web_url"`
	Stats          struct {
		Additions int
		Deletions int
		Total     int
	}
}

type ApiMergeRequestCommitResponse

type ApiMergeRequestCommitResponse []struct {
	CommitId       string `json:"id"`
	Title          string
	Message        string
	ProjectId      int
	ShortId        string `json:"short_id"`
	AuthorName     string `json:"author_name"`
	AuthorEmail    string `json:"author_email"`
	AuthoredDate   string `json:"authored_date"`
	CommitterName  string `json:"committer_name"`
	CommitterEmail string `json:"committer_email"`
	CommittedDate  string `json:"committed_date"`
	WebUrl         string `json:"web_url"`
	Stats          struct {
		Additions int
		Deletions int
		Total     int
	}
}

type ApiMergeRequestNoteResponse

type ApiMergeRequestNoteResponse []MergeRequestNote

type ApiMergeRequestResponse

type ApiMergeRequestResponse []MergeRequestRes

type ApiPipelineResponse

type ApiPipelineResponse []struct {
	GitlabId        int    `json:"id"`
	ProjectId       int    `json:"project_id"`
	GitlabCreatedAt string `json:"created_at"`
	Ref             string
	Sha             string
	WebUrl          string `json:"web_url"`
	Status          string
}

type ApiProjectResponse

type ApiProjectResponse struct {
	Name              string
	GitlabId          int    `json:"id"`
	PathWithNamespace string `json:"path_with_namespace"`
	WebUrl            string `json:"web_url"`
	Visibility        string `json:"visibility"`
	OpenIssuesCount   int    `json:"open_issues_count"`
	StarCount         int    `json:"star_count"`
}

type ApiSinglePipelineResponse

type ApiSinglePipelineResponse struct {
	GitlabId        int    `json:"id"`
	ProjectId       int    `json:"project_id"`
	GitlabCreatedAt string `json:"created_at"`
	Ref             string
	Sha             string
	WebUrl          string `json:"web_url"`
	Duration        int
	StartedAt       string `json:"started_at"`
	FinishedAt      string `json:"finished_at"`
	Coverage        string
	Status          string
}

type GitlabApiClient

type GitlabApiClient struct {
	core.ApiClient
}

func CreateApiClient

func CreateApiClient() *GitlabApiClient

func (*GitlabApiClient) FetchWithPagination

func (gitlabApiClient *GitlabApiClient) FetchWithPagination(resourceUri string, pageSize int, handler GitlabPaginationHandler) error

fetch paginated without ANTS worker pool

func (*GitlabApiClient) FetchWithPaginationAnts

func (gitlabApiClient *GitlabApiClient) FetchWithPaginationAnts(scheduler *utils.WorkerScheduler, resourceUri string, pageSize int, handler GitlabPaginationHandler) error

run all requests in an Ants worker pool

type GitlabPaginationHandler

type GitlabPaginationHandler func(res *http.Response) error

type MergeRequestNote

type MergeRequestNote struct {
	GitlabId        int    `json:"id"`
	MergeRequestId  int    `json:"noteable_id"`
	MergeRequestIid int    `json:"noteable_iid"`
	NoteableType    string `json:"noteable_type"`
	Body            string
	GitlabCreatedAt string `json:"created_at"`
	Confidential    bool
	Resolvable      bool `json:"resolvable"`
	System          bool `json:"system"`
	Author          struct {
		Username string `json:"username"`
	}
}

func FindEarliestNote

func FindEarliestNote(notes *ApiMergeRequestNoteResponse) (*MergeRequestNote, error)

type MergeRequestRes

type MergeRequestRes struct {
	GitlabId        int `json:"id"`
	Iid             int
	ProjectId       int `json:"project_id"`
	State           string
	Title           string
	Description     string
	WebUrl          string `json:"web_url"`
	UserNotesCount  int    `json:"user_notes_count"`
	WorkInProgress  bool   `json:"work_in_progress"`
	SourceBranch    string `json:"source_branch"`
	MergedAt        string `json:"merged_at"`
	GitlabCreatedAt string `json:"created_at"`
	ClosedAt        string `json:"closed_at"`
	MergedBy        struct {
		Username string `json:"username"`
	} `json:"merged_by"`
	Author struct {
		Username string `json:"username"`
	}
	Reviewers        []Reviewer
	FirstCommentTime string
}

type Reviewer

type Reviewer struct {
	GitlabId       int `json:"id"`
	MergeRequestId int
	Name           string
	Username       string
	State          string
	AvatarUrl      string `json:"avatar_url"`
	WebUrl         string `json:"web_url"`
}

Jump to

Keyboard shortcuts

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