jira

package
v0.0.0-...-5f61a36 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PerformIncrementalSync

func PerformIncrementalSync(c Client, store store.Store, poolSize int, m Mapper)

PerformIncrementalSync fetches only newly updated issues and performs the same processing as `PerformSync` on each issue.

### Implementation

  • Updated issue are fetched by performing a JQL query where `updated` is greater than the max of `jira_issues_states.issue_updated_at`.
  • For each updated issue, the records already in the store are dropped (e.g. the issue's state and events) so they can be recreated.

func PerformSync

func PerformSync(c Client, store store.Store, poolSize int, m Mapper)

PerformSync fetches issue identifiers from the attached Jira instance (using the Jira _searchIssues_ endpoint) and then fetches all issues (using the _get_ endpoint).

Each fetched issue is then processed to generate `IssueState` and `IssueEvent` records that are stored in the application's store.

func PerformSyncForIssueKey

func PerformSyncForIssueKey(c Client, store store.Store, issueKey string, m Mapper)

PerformSyncForIssueKey is the same as `PerformSync` but for a single issue specified by its key.

Types

type Client

type Client interface {
	SearchIssues(query string, issueKeys chan string)
	GetIssue(issueKey string) *jira.Issue
}

Client is the interface for Jira clients used by the application.

It currently has two implementations:

  • `jira/client.APIClient`, which wraps `go-jira`'s client
  • `jira/client.MockClient`, a mock for tests

type Mapper

type Mapper interface {
	IssueEventsFromIssue(i *extJira.Issue) []store.IssueEvent
	IssueStateFromIssue(i *extJira.Issue) store.IssueState
}

Mapper transforms Jira issues into states and events records.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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