tasks

package
v0.13.0-alpha1 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2022 License: Apache-2.0 Imports: 19 Imported by: 2

Documentation

Index

Constants

View Source
const RAW_ACCOUNT_TABLE = "bitbucket_api_accounts"
View Source
const RAW_COMMIT_TABLE = "bitbucket_api_commits"
View Source
const RAW_ISSUE_COMMENTS_TABLE = "bitbucket_api_issue_comments"
View Source
const RAW_ISSUE_TABLE = "bitbucket_api_issues"
View Source
const RAW_PULL_REQUEST_COMMENTS_TABLE = "bitbucket_api_pull_request_comments"
View Source
const RAW_PULL_REQUEST_TABLE = "bitbucket_api_pull_requests"
View Source
const RAW_REPOSITORIES_TABLE = "bitbucket_api_repositories"

Variables

View Source
var CollectApiCommitsMeta = core.SubTaskMeta{
	Name:             "collectApiCommits",
	EntryPoint:       CollectApiCommits,
	EnabledByDefault: false,
	Required:         false,
	Description:      "Collect commits data from Bitbucket api",
	DomainTypes:      []string{core.DOMAIN_TYPE_CODE},
}
View Source
var CollectApiIssueCommentsMeta = core.SubTaskMeta{
	Name:             "collectApiIssueComments",
	EntryPoint:       CollectApiIssueComments,
	EnabledByDefault: true,
	Required:         true,
	Description:      "Collect issue comments data from bitbucket api",
	DomainTypes:      []string{core.DOMAIN_TYPE_CODE},
}
View Source
var CollectApiIssuesMeta = core.SubTaskMeta{
	Name:             "collectApiIssues",
	EntryPoint:       CollectApiIssues,
	EnabledByDefault: true,
	Description:      "Collect issues data from Bitbucket api",
	DomainTypes:      []string{core.DOMAIN_TYPE_TICKET},
}
View Source
var CollectApiPrCommentsMeta = core.SubTaskMeta{
	Name:             "collectApiPullRequestsComments",
	EntryPoint:       CollectApiPullRequestsComments,
	EnabledByDefault: true,
	Required:         true,
	Description:      "Collect pull requests comments data from bitbucket api",
	DomainTypes:      []string{core.DOMAIN_TYPE_CODE},
}
View Source
var CollectApiPullRequestsMeta = core.SubTaskMeta{
	Name:             "collectApiPullRequests",
	EntryPoint:       CollectApiPullRequests,
	EnabledByDefault: true,
	Required:         true,
	Description:      "Collect PullRequests data from Bitbucket api",
	DomainTypes:      []string{core.DOMAIN_TYPE_CODE},
}
View Source
var CollectApiRepoMeta = core.SubTaskMeta{
	Name:        "collectApiRepo",
	EntryPoint:  CollectApiRepositories,
	Required:    true,
	Description: "Collect repositories data from Bitbucket api",
	DomainTypes: core.DOMAIN_TYPES,
}
View Source
var ConvertAccountsMeta = core.SubTaskMeta{
	Name:             "convertAccounts",
	EntryPoint:       ConvertAccounts,
	EnabledByDefault: true,
	Required:         true,
	Description:      "Convert tool layer table bitbucket_accounts into  domain layer table accounts",
	DomainTypes:      []string{core.DOMAIN_TYPE_CROSS},
}
View Source
var ConvertCommitsMeta = core.SubTaskMeta{
	Name:             "convertCommits",
	EntryPoint:       ConvertCommits,
	EnabledByDefault: false,
	Required:         false,
	Description:      "Convert tool layer table bitbucket_commits into  domain layer table commits",
	DomainTypes:      []string{core.DOMAIN_TYPE_CODE},
}
View Source
var ConvertIssueCommentsMeta = core.SubTaskMeta{
	Name:             "convertIssueComments",
	EntryPoint:       ConvertIssueComments,
	EnabledByDefault: true,
	Description:      "ConvertIssueComments data from Bitbucket api",
	DomainTypes:      []string{core.DOMAIN_TYPE_CODE},
}
View Source
var ConvertIssuesMeta = core.SubTaskMeta{
	Name:             "convertIssues",
	EntryPoint:       ConvertIssues,
	EnabledByDefault: true,
	Description:      "Convert tool layer table bitbucket_issues into  domain layer table issues",
	DomainTypes:      []string{core.DOMAIN_TYPE_TICKET},
}
View Source
var ConvertPrCommentsMeta = core.SubTaskMeta{
	Name:             "convertPullRequestComments",
	EntryPoint:       ConvertPullRequestComments,
	EnabledByDefault: true,
	Description:      "ConvertPullRequestComments data from Bitbucket api",
	DomainTypes:      []string{core.DOMAIN_TYPE_CODE},
}
View Source
var ConvertPullRequestsMeta = core.SubTaskMeta{
	Name:             "convertPullRequests",
	EntryPoint:       ConvertPullRequests,
	EnabledByDefault: true,
	Required:         true,
	Description:      "ConvertPullRequests data from Bitbucket api",
	DomainTypes:      []string{core.DOMAIN_TYPE_CODE},
}
View Source
var ConvertRepoMeta = core.SubTaskMeta{
	Name:             "convertRepo",
	EntryPoint:       ConvertRepo,
	EnabledByDefault: true,
	Description:      "Convert tool layer table bitbucket_repos into  domain layer table repos and boards",
	DomainTypes:      core.DOMAIN_TYPES,
}
View Source
var ExtractApiCommitsMeta = core.SubTaskMeta{
	Name:             "extractApiCommits",
	EntryPoint:       ExtractApiCommits,
	EnabledByDefault: false,
	Required:         false,
	Description:      "Extract raw commit data into tool layer table bitbucket_commits",
	DomainTypes:      []string{core.DOMAIN_TYPE_CODE},
}
View Source
var ExtractApiIssueCommentsMeta = core.SubTaskMeta{
	Name:             "extractApiIssueComments",
	EntryPoint:       ExtractApiIssueComments,
	EnabledByDefault: true,
	Required:         true,
	Description:      "Extract raw issue comments data into tool layer table BitbucketIssueComments",
	DomainTypes:      []string{core.DOMAIN_TYPE_CODE},
}
View Source
var ExtractApiIssuesMeta = core.SubTaskMeta{
	Name:             "extractApiIssues",
	EntryPoint:       ExtractApiIssues,
	EnabledByDefault: true,
	Description:      "Extract raw Issues data into tool layer table bitbucket_issues",
	DomainTypes:      []string{core.DOMAIN_TYPE_TICKET},
}
View Source
var ExtractApiPrCommentsMeta = core.SubTaskMeta{
	Name:             "extractApiPullRequestsComments",
	EntryPoint:       ExtractApiPullRequestsComments,
	EnabledByDefault: true,
	Required:         true,
	Description:      "Extract raw pull requests comments data into tool layer table BitbucketPrComments",
	DomainTypes:      []string{core.DOMAIN_TYPE_CODE},
}
View Source
var ExtractApiPullRequestsMeta = core.SubTaskMeta{
	Name:             "extractApiPullRequests",
	EntryPoint:       ExtractApiPullRequests,
	EnabledByDefault: true,
	Required:         true,
	Description:      "Extract raw PullRequests data into tool layer table bitbucket_pull_requests",
	DomainTypes:      []string{core.DOMAIN_TYPE_CODE},
}
View Source
var ExtractApiRepoMeta = core.SubTaskMeta{
	Name:        "extractApiRepo",
	EntryPoint:  ExtractApiRepositories,
	Required:    true,
	Description: "Extract raw Repositories data into tool layer table bitbucket_repos",
	DomainTypes: core.DOMAIN_TYPES,
}

Functions

func CollectApiCommits

func CollectApiCommits(taskCtx core.SubTaskContext) error

func CollectApiIssueComments

func CollectApiIssueComments(taskCtx core.SubTaskContext) error

func CollectApiIssues

func CollectApiIssues(taskCtx core.SubTaskContext) error

func CollectApiPullRequests

func CollectApiPullRequests(taskCtx core.SubTaskContext) error

func CollectApiPullRequestsComments

func CollectApiPullRequestsComments(taskCtx core.SubTaskContext) error

func CollectApiRepositories

func CollectApiRepositories(taskCtx core.SubTaskContext) error

func ConvertAccounts

func ConvertAccounts(taskCtx core.SubTaskContext) error

func ConvertCommits

func ConvertCommits(taskCtx core.SubTaskContext) error

func ConvertIssueComments

func ConvertIssueComments(taskCtx core.SubTaskContext) error

func ConvertIssues

func ConvertIssues(taskCtx core.SubTaskContext) error

func ConvertPullRequestComments

func ConvertPullRequestComments(taskCtx core.SubTaskContext) error

func ConvertPullRequests

func ConvertPullRequests(taskCtx core.SubTaskContext) error

func ConvertRepo

func ConvertRepo(taskCtx core.SubTaskContext) error

func CreateApiClient

func CreateApiClient(taskCtx core.TaskContext, connection *models.BitbucketConnection) (*helper.ApiAsyncClient, error)

func ExtractApiCommits

func ExtractApiCommits(taskCtx core.SubTaskContext) error

func ExtractApiIssueComments

func ExtractApiIssueComments(taskCtx core.SubTaskContext) error

func ExtractApiIssues

func ExtractApiIssues(taskCtx core.SubTaskContext) error

func ExtractApiPullRequests

func ExtractApiPullRequests(taskCtx core.SubTaskContext) error

func ExtractApiPullRequestsComments

func ExtractApiPullRequestsComments(taskCtx core.SubTaskContext) error

func ExtractApiRepositories

func ExtractApiRepositories(taskCtx core.SubTaskContext) error

func GetIssuesIterator

func GetIssuesIterator(taskCtx core.SubTaskContext) (*helper.DalCursorIterator, error)

func GetPullRequestsIterator

func GetPullRequestsIterator(taskCtx core.SubTaskContext) (*helper.DalCursorIterator, error)

func GetQuery

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

func GetRawMessageFromResponse

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

func GetTotalPagesFromResponse

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

Types

type ApiRepoResponse

type ApiRepoResponse BitbucketApiRepo

type BitbucketAccountResponse

type BitbucketAccountResponse struct {
	UserName      string    `json:"username"`
	DisplayName   string    `json:"display_name"`
	AccountId     string    `json:"account_id"`
	AccountStatus string    `json:"account_status"`
	CreateOn      time.Time `json:"create_on"`
	Links         struct {
		Self       struct{ Href string } `json:"self"`
		Html       struct{ Href string } `json:"html"`
		Avatar     struct{ Href string } `json:"avatar"`
		Followers  struct{ Href string } `json:"followers"`
		Following  struct{ Href string } `json:"following"`
		Repository struct{ Href string } `json:"repository"`
	}
}

type BitbucketApiParams

type BitbucketApiParams struct {
	ConnectionId uint64
	Owner        string
	Repo         string
}

type BitbucketApiPullRequest

type BitbucketApiPullRequest struct {
	BitbucketId  int    `json:"id"`
	CommentCount int    `json:"comment_count"`
	TaskCount    int    `json:"task_count"`
	Type         string `json:"type"`
	State        string `json:"state"`
	Title        string `json:"title"`
	Description  string `json:"description"`
	MergeCommit  *struct {
		Type  string
		Hash  string `json:"hash"`
		Links *struct {
			Self struct{ Href string }
			Html struct{ Href string }
		}
	} `json:"merge_commit"`
	Links *struct {
		Self struct{ Href string }
		Html struct{ Href string }
	}
	ClosedBy           *BitbucketAccountResponse `json:"closed_by"`
	Author             *BitbucketAccountResponse `json:"author"`
	BitbucketCreatedAt time.Time                 `json:"created_on"`
	BitbucketUpdatedAt time.Time                 `json:"updated_on"`
	BaseRef            *struct {
		Branch struct {
			Name string
		} `json:"branch"`
		Commit struct {
			Type string
			Hash string
		} `json:"commit"`
		Repo *BitbucketApiRepo `json:"repository"`
	} `json:"destination"`
	HeadRef *struct {
		Branch struct {
			Name string
		} `json:"branch"`
		Commit struct {
			Type string
			Hash string
		} `json:"commit"`
		Repo *BitbucketApiRepo `json:"repository"`
	} `json:"source"`
	Reviewers    []BitbucketAccountResponse `json:"reviewers"`
	Participants []BitbucketAccountResponse `json:"participants"`
}

type BitbucketApiRepo

type BitbucketApiRepo struct {
	BitbucketId string
	Scm         string `json:"scm"`
	HasWiki     bool   `json:"has_wiki"`
	Links       struct {
		Clone []struct {
			Href string
			Name string
		} `json:"clone"`
		Self struct {
			Href string
		} `json:"self"`

		Html struct {
			Href string
		} `json:"html"`
	} `json:"links"`
	Uuid        string `json:"uuid"`
	FullName    string `json:"full_name"`
	Language    string `json:"language"`
	Description string `json:"description"`
	Type        string `json:"type"`
	HasIssue    bool   `json:"has_issue"`
	ForkPolicy  string `json:"fork_policy"`
	Owner       models.BitbucketUser
	CreatedAt   time.Time  `json:"created_on"`
	UpdatedAt   *time.Time `json:"updated_on"`
}

type BitbucketInput

type BitbucketInput struct {
	BitbucketId int
}

type BitbucketIssueCommentsResponse

type BitbucketIssueCommentsResponse struct {
	Type        string     `json:"type"`
	BitbucketId int        `json:"id"`
	CreatedOn   time.Time  `json:"created_on"`
	UpdatedOn   *time.Time `json:"updated_on"`
	Content     struct {
		Type string
		Raw  string `json:"raw"`
	} `json:"content"`
	User  *BitbucketAccountResponse
	Issue struct {
		Type       string
		Id         int
		Repository *BitbucketApiRepo
		Links      struct {
			Self struct {
				Href string
			}
		}
		Title string
	}
	Links struct {
		Self struct {
			Href string
		} `json:"self"`
		Html struct {
			Href string
		} `json:"html"`
	} `json:"links"`
}

type BitbucketOptions

type BitbucketOptions struct {
	ConnectionId               uint64   `json:"connectionId"`
	Tasks                      []string `json:"tasks,omitempty"`
	Since                      string
	Owner                      string
	Repo                       string
	models.TransformationRules `mapstructure:"transformationRules" json:"transformationRules"`
}

func DecodeAndValidateTaskOptions

func DecodeAndValidateTaskOptions(options map[string]interface{}) (*BitbucketOptions, error)

type BitbucketPagination

type BitbucketPagination struct {
	Values  []interface{} `json:"values"`
	PageLen int           `json:"pagelen"`
	Size    int           `json:"size"`
	Page    int           `json:"page"`
	Next    string        `json:"next"`
}

type BitbucketPrCommentsResponse

type BitbucketPrCommentsResponse struct {
	BitbucketId int        `json:"id"`
	CreatedOn   time.Time  `json:"created_on"`
	UpdatedOn   *time.Time `json:"updated_on"`
	Content     struct {
		Type string
		Raw  string
	} `json:"content"`
	User    *BitbucketAccountResponse
	Deleted bool
	Type    string `json:"type"`
	Links   struct {
		Self struct {
			Href string
		} `json:"self"`
		Html struct {
			Href string
		} `json:"html"`
	} `json:"links"`
	PullRequest struct {
		Type  string
		Id    int
		Title string
		Links struct {
			Self struct {
				Href string
			}
			Html struct {
				Href string
			}
		}
	}
}

type BitbucketTaskData

type BitbucketTaskData struct {
	Options   *BitbucketOptions
	ApiClient *helper.ApiAsyncClient
	Since     *time.Time
	Repo      *models.BitbucketRepo
}

func CreateRawDataSubTaskArgs

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

type CommitsResponse

type CommitsResponse struct {
	Type string    `json:"type"`
	Sha  string    `json:"hash"`
	Date time.Time `json:"date"`
	//Author *models.BitbucketAccount
	Message string `json:"message"`
	Links   struct {
		Self     struct{ Href string }
		Html     struct{ Href string }
		Diff     struct{ Href string }
		Approve  struct{ Href string }
		Comments struct{ Href string }
	} `json:"links"`
	Parents []struct {
		Type  string
		Hash  string
		Links struct {
			Self struct{ Href string }
			Html struct{ Href string }
		}
	} `json:"parents"`
}

type IssueRegexes

type IssueRegexes struct {
	SeverityRegex        *regexp.Regexp
	ComponentRegex       *regexp.Regexp
	PriorityRegex        *regexp.Regexp
	TypeBugRegex         *regexp.Regexp
	TypeRequirementRegex *regexp.Regexp
	TypeIncidentRegex    *regexp.Regexp
}

type IssuesResponse

type IssuesResponse struct {
	Type        string `json:"type"`
	BitbucketId int    `json:"id"`
	Repository  *BitbucketApiRepo
	Links       struct {
		Self struct {
			Href string
		} `json:"self"`
		Html struct {
			Href string
		} `json:"html"`
	} `json:"links"`
	Title   string `json:"title"`
	Content struct {
		Type string
		Raw  string
	} `json:"content"`
	Reporter  *BitbucketAccountResponse
	Assignee  *BitbucketAccountResponse
	State     string `json:"state"`
	Kind      string `json:"kind"`
	Milestone *struct {
		Id int
	} `json:"milestone"`
	Component          string    `json:"component"`
	Priority           string    `json:"priority"`
	Votes              int       `json:"votes"`
	Watches            int       `json:"watches"`
	BitbucketCreatedAt time.Time `json:"created_on"`
	BitbucketUpdatedAt time.Time `json:"updated_on"`
}

Jump to

Keyboard shortcuts

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