tasks

package
v0.5.0-test1 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2021 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Bug         = "Bug"
	Story       = "Story"
	Incident    = "Incident"
	Requirement = "Requirement"
)

issue types

View Source
const (
	BashSize = 100
)
View Source
const (
	BatchSize = 100
)
View Source
const (
	Resolved = "5"
)

jira changelog to

Variables

View Source
var (
	UTCLocation, _ = time.LoadLocation("UTC")
)

Functions

func CollectBoard

func CollectBoard(jiraApiClient *JiraApiClient, source *models.JiraSource, boardId uint64) error

func CollectChangelogs

func CollectChangelogs(
	jiraApiClient *JiraApiClient,
	source *models.JiraSource,
	boardId uint64,
	ctx context.Context,
) error

func CollectIssues

func CollectIssues(
	jiraApiClient *JiraApiClient,
	source *models.JiraSource,
	boardId uint64,
	since time.Time,
	ctx context.Context,
) error

func CollectProjects added in v0.4.0

func CollectProjects(
	jiraApiClient *JiraApiClient,
	sourceId uint64,
) error
func CollectRemoteLinks(
	jiraApiClient *JiraApiClient,
	source *models.JiraSource,
	boardId uint64,
	ctx context.Context,
) error

func CollectSprint added in v0.4.0

func CollectSprint(jiraApiClient *JiraApiClient, source *models.JiraSource, boardId uint64) error

func CollectUsers added in v0.4.0

func CollectUsers(jiraApiClient *JiraApiClient,
	sourceId uint64,
) error

func ConvertBoard added in v0.6.0

func ConvertBoard(sourceId uint64, boardId uint64) error

func ConvertChangelogs added in v0.6.0

func ConvertChangelogs(sourceId uint64, boardId uint64) error

func ConvertIssueCommits added in v0.6.0

func ConvertIssueCommits(sourceId uint64, boardId uint64) error

func ConvertIssues added in v0.6.0

func ConvertIssues(sourceId uint64, boardId uint64) error

func ConvertSprint added in v0.6.0

func ConvertSprint(sourceId uint64, boardId uint64) error

func ConvertUsers added in v0.6.0

func ConvertUsers(sourceId uint64) error

func ConvertWorklog added in v0.6.0

func ConvertWorklog(sourceId uint64, boardId uint64) error

func EnrichIssues

func EnrichIssues(source *models.JiraSource, boardId uint64) (err error)
func EnrichRemotelinks(source *models.JiraSource, boardId uint64) (err error)

Types

type ChangelogItemResult added in v0.6.0

type ChangelogItemResult struct {
	SourceId          uint64 `gorm:"primaryKey"`
	ChangelogId       uint64 `gorm:"primaryKey"`
	Field             string `gorm:"primaryKey"`
	FieldType         string
	FieldId           string
	From              string
	FromString        string
	To                string
	ToString          string
	IssueId           uint64 `gorm:"index"`
	AuthorAccountId   string
	AuthorDisplayName string
	Created           time.Time
}

type JiraApiAuthor

type JiraApiAuthor struct {
	Self        string `json:"self,omitempty"`
	AccountId   string `json:"accountId,omitempty"`
	DisplayName string `json:"displayName,omitempty"`
	Active      bool   `json:"active,omitempty"`
	TimeZone    string `json:"timeZone,omitempty"`
	AccountType string `json:"accountType,omitempty"`
}

type JiraApiBoard

type JiraApiBoard struct {
	Id       uint64 `json:"id"`
	Self     string `json:"self"`
	Name     string `json:"name"`
	Type     string `json:"type"`
	Location *JiraApiLocation
}

type JiraApiChangeLog

type JiraApiChangeLog struct {
	Id      string                 `json:"id,omitempty"`
	Author  JiraApiAuthor          `json:"author,omitempty"`
	Created core.Iso8601Time       `json:"created,omitempty"`
	Items   []JiraApiChangelogItem `json:"items,omitempty"`
}

type JiraApiChangelogItem

type JiraApiChangelogItem struct {
	Field      string `json:"field,omitempty"`
	FieldType  string `json:"fieldType,omitempty"`
	FieldId    string `json:"fieldId,omitempty"`
	From       string `json:"from,omitempty"`
	FromString string `json:"fromString,omitempty"`
	To         string `json:"to,omitempty"`
	ToString   string `json:"toString,omitempty"`
}

type JiraApiChangelogsResponse

type JiraApiChangelogsResponse struct {
	JiraPagination
	Values []JiraApiChangeLog `json:"values,omitempty"`
}

type JiraApiClient

type JiraApiClient struct {
	core.ApiClient
}

func NewJiraApiClient added in v0.4.0

func NewJiraApiClient(endpoint string, auth string) *JiraApiClient

func NewJiraApiClientBySourceId added in v0.4.0

func NewJiraApiClientBySourceId(sourceId uint64) (*JiraApiClient, error)

func (*JiraApiClient) FetchPages

func (jiraApiClient *JiraApiClient) FetchPages(scheduler *utils.WorkerScheduler, path string, query *url.Values, handler JiraPaginationHandler) error

func (*JiraApiClient) FetchWithoutPaginationHeaders added in v0.4.0

func (jiraApiClient *JiraApiClient) FetchWithoutPaginationHeaders(
	path string,
	query *url.Values,
	handler JiraSearchPaginationHandler,
) error

FetchWithoutPaginationHeaders uses pagination in a different way than FetchPages. We set the pagination params to what we want, and then we just keep making requests until the response array is empty. This is why we need to check the "next" variable on the handler, and the handler that is passed in needs to return a boolean to tell us whether or not to continue making requests. This is why we created JiraSearchPaginationHandler.

type JiraApiIssue

type JiraApiIssue struct {
	Id     string                 `json:"id"`
	Self   string                 `json:"self"`
	Key    string                 `json:"key"`
	Fields map[string]interface{} `json:"fields"`
}

type JiraApiIssueFields added in v0.6.0

type JiraApiIssueFields struct {
	Name                  string
	Summary               string
	IssueType             JiraApiIssueType
	Project               JiraApiProject
	Worklog               JiraApiWorklog
	Status                JiraApiStatus
	Creator               JiraApiUser
	Assignee              *JiraApiUser
	Priority              *JiraApiIssuePriority
	TimeTracking          JiraApiIssueTimeTracking
	AggregateTimeEstimate int64
	Parent                *JiraApiIssue
	Sprint                *JiraApiSprint
	ClosedSprints         []JiraApiSprint
	Created               core.Iso8601Time
	Updated               *core.Iso8601Time
	ResolutionDate        *core.Iso8601Time
}

type JiraApiIssuePriority added in v0.6.0

type JiraApiIssuePriority struct {
	Self    string
	IconUrl string
	Name    string
	Id      string
}

type JiraApiIssueTimeTracking added in v0.6.0

type JiraApiIssueTimeTracking struct {
	OriginalEstimate        string
	RemainingEstimate       string
	OriginalEstimateSeconds int64
	RemainingEstimatSeconds int64
}

type JiraApiIssueType added in v0.6.0

type JiraApiIssueType struct {
	Self           string
	Id             string
	Description    string
	IconUrl        string
	Name           string
	Subtask        bool
	AvatarId       int
	HierarchyLevel int
}

type JiraApiIssuesResponse

type JiraApiIssuesResponse struct {
	JiraPagination
	Issues []JiraApiIssue `json:"issues"`
}

type JiraApiLocation

type JiraApiLocation struct {
	ProjectId      uint   `json:"projectId"`
	DisplayName    string `json:"displayName"`
	ProjectName    string `json:"projectName"`
	ProjectKey     string `json:"projectKey"`
	ProjectTypeKey string `json:"projectTypeKey"`
	AvatarURI      string `json:"avatarURI"`
	Name           string `json:"name"`
}

type JiraApiProject added in v0.6.0

type JiraApiProject struct {
	Id   string `json:"id"`
	Key  string `json:"key"`
	Name string `json:"name"`
}
type JiraApiRemotelink struct {
	Id           uint64
	Self         string
	Application  json.RawMessage
	Relationship string
	Object       struct {
		Url    string
		Title  string
		Icon   json.RawMessage
		Status json.RawMessage
	}
}

type JiraApiRemotelinksResponse added in v0.6.0

type JiraApiRemotelinksResponse []json.RawMessage

need to store a origin json body into RawJson, by this approach, we dont need to Marshal it back to bytes

type JiraApiSprint added in v0.4.0

type JiraApiSprint struct {
	Id            uint64     `json:"id"`
	Self          string     `json:"self"`
	State         string     `json:"state"`
	Name          string     `json:"name"`
	StartDate     *time.Time `json:"startDate,omitempty"`
	EndDate       *time.Time `json:"endDate,omitempty"`
	CompleteDate  *time.Time `json:"completeDate,omitempty"`
	OriginBoardID uint64     `json:"originBoardId,omitempty"`
}

type JiraApiSprintsResponse added in v0.6.0

type JiraApiSprintsResponse struct {
	MaxResults int             `json:"maxResults"`
	StartAt    int             `json:"startAt"`
	Total      int             `json:"total"`
	IsLast     bool            `json:"isLast"`
	Values     []JiraApiSprint `json:"values"`
}

type JiraApiStatus added in v0.6.0

type JiraApiStatus struct {
	Self           string
	Description    string
	IconUrl        string
	Name           string
	Id             string
	StatusCategory JiraApiStatusCategory
}

type JiraApiStatusCategory added in v0.6.0

type JiraApiStatusCategory struct {
	Self      string
	Id        int
	Key       string
	ColorName string
	Name      string
}

type JiraApiUser added in v0.4.0

type JiraApiUser struct {
	AccountId   string `json:"accountId"`
	AccountType string `json:"accountType"`
	DisplayName string `json:"displayName"`
	Email       string `json:"emailAddress"`
	Timezone    string `json:"timeZone"`
	AvatarUrls  struct {
		Url string `json:"48x48"`
	} `json:"avatarUrls"`
}

type JiraApiWorklog added in v0.6.0

type JiraApiWorklog struct {
	StartAt    int `json:"startAt"`
	MaxResults int `json:"maxResults"`
	Total      int `json:"total"`
	Worklogs   []struct {
		Author struct {
			AccountID string `json:"accountId"`
		} `json:"author"`
		UpdateAuthor struct {
			AccountID string `json:"accountId"`
		} `json:"updateAuthor"`
		Updated          core.Iso8601Time `json:"updated"`
		Started          core.Iso8601Time `json:"started"`
		TimeSpent        string           `json:"timeSpent"`
		TimeSpentSeconds int              `json:"timeSpentSeconds"`
		ID               string           `json:"id"`
		IssueID          string           `json:"issueId"`
	} `json:"worklogs"`
}

type JiraPagination

type JiraPagination struct {
	StartAt    int `json:"startAt"`
	MaxResults int `json:"maxResults"`
	Total      int `json:"total"`
}

type JiraPaginationHandler

type JiraPaginationHandler func(res *http.Response) error

type JiraSearchPaginationHandler added in v0.4.0

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

type JiraUserApiRes added in v0.4.0

type JiraUserApiRes []JiraApiUser

type JiraUserProjectApiRes added in v0.4.0

type JiraUserProjectApiRes []JiraApiProject

This has to be called JiraUserProjects since it is a different api call than JiraProjects. This call retreives all projects that the user has access to

type SprintIssueBurndownConverter added in v0.6.0

type SprintIssueBurndownConverter struct {
	// contains filtered or unexported fields
}

func NewSprintIssueBurndownConverter added in v0.6.0

func NewSprintIssueBurndownConverter() *SprintIssueBurndownConverter

func (*SprintIssueBurndownConverter) FeedIn added in v0.6.0

func (*SprintIssueBurndownConverter) Save added in v0.6.0

func (*SprintIssueBurndownConverter) UpdateSprintIssue added in v0.6.0

func (c *SprintIssueBurndownConverter) UpdateSprintIssue() error

Jump to

Keyboard shortcuts

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