tasks

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const RAW_CHILDREN_ON_PIPELINE_TABLE = "gitlab_api_children_on_pipeline"
View Source
const RAW_COMMIT_TABLE = "gitlab_api_commit"
View Source
const RAW_MERGE_REQUEST_COMMITS_TABLE = "gitlab_api_merge_request_commits"
View Source
const RAW_MERGE_REQUEST_NOTES_TABLE = "gitlab_api_merge_request_notes"
View Source
const RAW_MERGE_REQUEST_TABLE = "gitlab_api_merge_requests"
View Source
const RAW_PIPELINE_TABLE = "gitlab_api_pipeline"
View Source
const RAW_PROJECT_TABLE = "gitlab_api_project"
View Source
const RAW_TAG_TABLE = "gitlab_api_tag"

Variables

View Source
var CollectApiChildrenOnPipelinesMeta = core.SubTaskMeta{
	Name:             "collectApiChildrenOnPipelines",
	EntryPoint:       CollectApiChildrenOnPipelines,
	EnabledByDefault: true,
	Description:      "Collect pipline child data from gitlab api",
}
View Source
var CollectApiMergeRequestsCommitsMeta = core.SubTaskMeta{
	Name:             "collectApiMergeRequestsCommits",
	EntryPoint:       CollectApiMergeRequestsCommits,
	EnabledByDefault: true,
	Description:      "Collect merge requests commits data from gitlab api",
}
View Source
var CollectApiMergeRequestsMeta = core.SubTaskMeta{
	Name:             "collectApiMergeRequests",
	EntryPoint:       CollectApiMergeRequests,
	EnabledByDefault: true,
	Description:      "Collect merge requests data from gitlab api",
}
View Source
var CollectApiMergeRequestsNotesMeta = core.SubTaskMeta{
	Name:             "collectApiMergeRequestsNotes",
	EntryPoint:       CollectApiMergeRequestsNotes,
	EnabledByDefault: true,
	Description:      "Collect merge requests notes data from gitlab api",
}
View Source
var CollectApiPipelinesMeta = core.SubTaskMeta{
	Name:             "collectApiPipelines",
	EntryPoint:       CollectApiPipelines,
	EnabledByDefault: true,
	Description:      "Collect pipeline data from gitlab api",
}
View Source
var CollectCommitsMeta = core.SubTaskMeta{
	Name:             "collectApiCommits",
	EntryPoint:       CollectApiCommits,
	EnabledByDefault: true,
	Description:      "Collect commit data from gitlab api",
}
View Source
var CollectProjectMeta = core.SubTaskMeta{
	Name:             "collectApiProject",
	EntryPoint:       CollectApiProject,
	EnabledByDefault: true,
	Description:      "Collect project data from gitlab api",
}
View Source
var CollectTagMeta = core.SubTaskMeta{
	Name:             "collectApiTag",
	EntryPoint:       CollectApiTag,
	EnabledByDefault: true,
	Description:      "Collect tag data from gitlab api",
}
View Source
var ConvertApiCommitsMeta = core.SubTaskMeta{
	Name:             "convertApiCommits",
	EntryPoint:       ConvertApiCommits,
	EnabledByDefault: true,
	Description:      "Update domain layer commit according to GitlabCommit",
}
View Source
var ConvertApiMergeRequestsCommitsMeta = core.SubTaskMeta{
	Name:             "convertApiMergeRequestsCommits",
	EntryPoint:       ConvertApiMergeRequestsCommits,
	EnabledByDefault: true,
	Description:      "Update domain layer PullRequestCommit according to GitlabMergeRequestCommit",
}
View Source
var ConvertApiMergeRequestsMeta = core.SubTaskMeta{
	Name:             "convertApiMergeRequests",
	EntryPoint:       ConvertApiMergeRequests,
	EnabledByDefault: true,
	Description:      "Update domain layer PullRequest according to GitlabMergeRequest",
}
View Source
var ConvertApiNotesMeta = core.SubTaskMeta{
	Name:             "convertApiNotes",
	EntryPoint:       ConvertApiNotes,
	EnabledByDefault: true,
	Description:      "Update domain layer Note according to GitlabMergeRequestNote",
}
View Source
var ConvertMergeRequestCommentMeta = core.SubTaskMeta{
	Name:             "convertMergeRequestComment",
	EntryPoint:       ConvertMergeRequestComment,
	EnabledByDefault: true,
	Description:      "Update domain layer Comment according to GitlabMergeRequestComment",
}
View Source
var ConvertProjectMeta = core.SubTaskMeta{
	Name:             "convertApiProject",
	EntryPoint:       ConvertApiProjects,
	EnabledByDefault: true,
	Description:      "Update domain layer Repo according to GitlabProject",
}
View Source
var EnrichMergeRequestsMeta = core.SubTaskMeta{
	Name:             "enrichMrs",
	EntryPoint:       EnrichMergeRequests,
	EnabledByDefault: true,
	Description:      "Enrich merge requests data from GitlabCommit, GitlabMergeRequestNote and GitlabMergeRequest",
}
View Source
var ExtractApiChildrenOnPipelinesMeta = core.SubTaskMeta{
	Name:             "extractApiChildrenOnPipelines",
	EntryPoint:       ExtractApiChildrenOnPipelines,
	EnabledByDefault: true,
	Description:      "Extract raw pipelines data into tool layer table GitlabPipeline",
}
View Source
var ExtractApiMergeRequestsCommitsMeta = core.SubTaskMeta{
	Name:             "extractApiMergeRequestsCommits",
	EntryPoint:       ExtractApiMergeRequestsCommits,
	EnabledByDefault: true,
	Description:      "Extract raw merge requests commit data into tool layer table GitlabMergeRequestCommit and GitlabCommit",
}
View Source
var ExtractApiMergeRequestsMeta = core.SubTaskMeta{
	Name:             "extractApiMergeRequests",
	EntryPoint:       ExtractApiMergeRequests,
	EnabledByDefault: true,
	Description:      "Extract raw merge requests data into tool layer table GitlabMergeRequest and GitlabReviewer",
}
View Source
var ExtractApiMergeRequestsNotesMeta = core.SubTaskMeta{
	Name:             "extractApiMergeRequestsNotes",
	EntryPoint:       ExtractApiMergeRequestsNotes,
	EnabledByDefault: true,
	Description:      "Extract raw merge requests notes data into tool layer table GitlabMergeRequestNote",
}
View Source
var ExtractApiPipelinesMeta = core.SubTaskMeta{
	Name:             "extractApiPipelines",
	EntryPoint:       ExtractApiPipelines,
	EnabledByDefault: true,
	Description:      "Extract raw pipelines data into tool layer table GitlabPipeline",
}
View Source
var ExtractCommitsMeta = core.SubTaskMeta{
	Name:             "extractApiCommits",
	EntryPoint:       ExtractApiCommits,
	EnabledByDefault: true,
	Description:      "Extract raw commit data into tool layer table GitlabCommit,GitlabUser and GitlabProjectCommit",
}
View Source
var ExtractProjectMeta = core.SubTaskMeta{
	Name:             "extractApiProject",
	EntryPoint:       ExtractApiProject,
	EnabledByDefault: true,
	Description:      "Extract raw project data into tool layer table GitlabProject",
}
View Source
var ExtractTagMeta = core.SubTaskMeta{
	Name:             "extractApiTag",
	EntryPoint:       ExtractApiTag,
	EnabledByDefault: true,
	Description:      "Extract raw tag data into tool layer table GitlabTag",
}

Functions

func CollectApiChildrenOnPipelines added in v0.10.0

func CollectApiChildrenOnPipelines(taskCtx core.SubTaskContext) error

func CollectApiCommits added in v0.10.0

func CollectApiCommits(taskCtx core.SubTaskContext) error

func CollectApiMergeRequests added in v0.10.0

func CollectApiMergeRequests(taskCtx core.SubTaskContext) error

func CollectApiMergeRequestsCommits added in v0.10.0

func CollectApiMergeRequestsCommits(taskCtx core.SubTaskContext) error

func CollectApiMergeRequestsNotes added in v0.10.0

func CollectApiMergeRequestsNotes(taskCtx core.SubTaskContext) error

func CollectApiPipelines added in v0.10.0

func CollectApiPipelines(taskCtx core.SubTaskContext) error

func CollectApiProject added in v0.10.0

func CollectApiProject(taskCtx core.SubTaskContext) error

func CollectApiTag added in v0.10.0

func CollectApiTag(taskCtx core.SubTaskContext) error

func ConvertApiCommits added in v0.10.0

func ConvertApiCommits(taskCtx core.SubTaskContext) error

func ConvertApiMergeRequests added in v0.10.0

func ConvertApiMergeRequests(taskCtx core.SubTaskContext) error

func ConvertApiMergeRequestsCommits added in v0.10.0

func ConvertApiMergeRequestsCommits(taskCtx core.SubTaskContext) error

func ConvertApiNotes added in v0.10.0

func ConvertApiNotes(taskCtx core.SubTaskContext) error

func ConvertApiProjects added in v0.10.0

func ConvertApiProjects(taskCtx core.SubTaskContext) error

func ConvertCommit added in v0.9.0

func ConvertCommit(commit *GitlabApiCommit) (*models.GitlabCommit, error)

Convert the API response to our DB model instance

func ConvertMergeRequestComment added in v0.10.0

func ConvertMergeRequestComment(taskCtx core.SubTaskContext) error

func EnrichMergeRequests

func EnrichMergeRequests(taskCtx core.SubTaskContext) error

func ExtractApiChildrenOnPipelines added in v0.10.0

func ExtractApiChildrenOnPipelines(taskCtx core.SubTaskContext) error

func ExtractApiCommits added in v0.10.0

func ExtractApiCommits(taskCtx core.SubTaskContext) error

func ExtractApiMergeRequests added in v0.10.0

func ExtractApiMergeRequests(taskCtx core.SubTaskContext) error

func ExtractApiMergeRequestsCommits added in v0.10.0

func ExtractApiMergeRequestsCommits(taskCtx core.SubTaskContext) error

func ExtractApiMergeRequestsNotes added in v0.10.0

func ExtractApiMergeRequestsNotes(taskCtx core.SubTaskContext) error

func ExtractApiPipelines added in v0.10.0

func ExtractApiPipelines(taskCtx core.SubTaskContext) error

func ExtractApiProject added in v0.10.0

func ExtractApiProject(taskCtx core.SubTaskContext) error

func ExtractApiTag added in v0.10.0

func ExtractApiTag(taskCtx core.SubTaskContext) error

func GetMergeRequestsIterator added in v0.10.0

func GetMergeRequestsIterator(taskCtx core.SubTaskContext) (*helper.CursorIterator, error)

func GetPipelinesIterator added in v0.10.0

func GetPipelinesIterator(taskCtx core.SubTaskContext) (*helper.CursorIterator, error)

func GetQuery added in v0.10.0

func GetQuery(reqData *helper.RequestData) (url.Values, error)

func GetQueryOrder added in v0.10.0

func GetQueryOrder(reqData *helper.RequestData) (url.Values, error)

func GetRawMessageFromResponse added in v0.10.0

func GetRawMessageFromResponse(res *http.Response) ([]json.RawMessage, error)

func GetTotalPagesFromResponse added in v0.10.0

func GetTotalPagesFromResponse(res *http.Response, args *helper.ApiCollectorArgs) (int, error)

func NewGitlabApiClient added in v0.10.0

func NewGitlabApiClient(taskCtx core.TaskContext) (*helper.ApiAsyncClient, error)

Types

type ApiPipeline added in v0.4.0

type ApiPipeline struct {
	GitlabId        int               `json:"id"`
	ProjectId       int               `json:"project_id"`
	GitlabCreatedAt *core.Iso8601Time `json:"created_at"`
	UpdatedAt       *core.Iso8601Time `json:"updated_at"`
	Ref             string
	Sha             string
	Duration        int
	WebUrl          string `json:"web_url"`
	Status          string
}

type ApiSinglePipelineResponse

type ApiSinglePipelineResponse struct {
	GitlabId        int               `json:"id"`
	ProjectId       int               `json:"project_id"`
	GitlabCreatedAt *core.Iso8601Time `json:"created_at"`
	Ref             string
	Sha             string
	WebUrl          string `json:"web_url"`
	Duration        int
	UpdatedAt       *core.Iso8601Time `json:"updated_at"`
	Coverage        string
	Status          string
}

type GitlabApiCommit added in v0.4.0

type GitlabApiCommit 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   core.Iso8601Time `json:"authored_date"`
	CommitterName  string           `json:"committer_name"`
	CommitterEmail string           `json:"committer_email"`
	CommittedDate  core.Iso8601Time `json:"committed_date"`
	WebUrl         string           `json:"web_url"`
	Stats          struct {
		Additions int
		Deletions int
		Total     int
	}
}

type GitlabApiParams added in v0.10.0

type GitlabApiParams struct {
	ProjectId int
}

type GitlabApiProject added in v0.6.0

type GitlabApiProject struct {
	GitlabId          int    `json:"id"`
	Name              string `josn:"name"`
	Description       string `json:"description"`
	DefaultBranch     string `json:"default_branch"`
	PathWithNamespace string `json:"path_with_namespace"`
	WebUrl            string `json:"web_url"`
	CreatorId         int
	Visibility        string            `json:"visibility"`
	OpenIssuesCount   int               `json:"open_issues_count"`
	StarCount         int               `json:"star_count"`
	ForkedFromProject *GitlabApiProject `json:"forked_from_project"`
	CreatedAt         core.Iso8601Time  `json:"created_at"`
	LastActivityAt    *core.Iso8601Time `json:"last_activity_at"`
}

type GitlabApiTag added in v0.9.0

type GitlabApiTag struct {
	Name      string
	Message   string
	Target    string
	Protected bool
	Release   struct {
		TagName     string
		Description string
	}
}

type GitlabInput added in v0.10.0

type GitlabInput struct {
	GitlabId int
	Iid      int
}

type GitlabOptions added in v0.10.0

type GitlabOptions struct {
	SourceId  uint64   `json:"sourceId"`
	ProjectId int      `json:"projectId"`
	Tasks     []string `json:"tasks,omitempty"`
}

type GitlabTaskData added in v0.10.0

type GitlabTaskData struct {
	Options       *GitlabOptions
	ApiClient     *helper.ApiAsyncClient
	ProjectCommit *models.GitlabProjectCommit
	Since         *time.Time
}

func CreateRawDataSubTaskArgs added in v0.10.0

func CreateRawDataSubTaskArgs(taskCtx core.SubTaskContext, Table string) (*helper.RawDataSubTaskArgs, *GitlabTaskData)

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 core.Iso8601Time `json:"created_at"`
	Confidential    bool
	Resolvable      bool `json:"resolvable"`
	System          bool `json:"system"`
	Author          struct {
		Username string `json:"username"`
	}
}

type MergeRequestRes

type MergeRequestRes struct {
	GitlabId        int `json:"id"`
	Iid             int
	ProjectId       int `json:"project_id"`
	SourceProjectId int `json:"source_project_id"`
	TargetProjectId int `json:"target_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"`
	TargetBranch    string            `json:"target_branch"`
	GitlabCreatedAt core.Iso8601Time  `json:"created_at"`
	MergedAt        *core.Iso8601Time `json:"merged_at"`
	ClosedAt        *core.Iso8601Time `json:"closed_at"`
	MergeCommitSha  string            `json:"merge_commit_sha"`
	MergedBy        struct {
		Username string `json:"username"`
	} `json:"merged_by"`
	Author struct {
		Id       int    `json:"id"`
		Username string `json:"username"`
	}
	Reviewers        []Reviewer
	FirstCommentTime core.Iso8601Time
}

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