Documentation
¶
Overview ¶
Package issues keeps every repository's open issues and says for each where it stands (design/issues.md, P-69).
Index ¶
- Constants
- Variables
- func Counts(refs []Ref, by By) oapi.IssueCounts
- func Feeds() snapshot.Indexer
- func IssueOf(r Ref) oapi.Issue
- func Summary(e *snapshot.RepoEntry) (open, triage int)
- type API
- type By
- type Fetcher
- type Issue
- type IssueKind
- type Issues
- type Label
- type Listed
- type Options
- type REST
- type Ref
- type Set
- type State
Constants ¶
const ConfirmAfter = 30 * time.Second
Events are the webhook deliveries that re-read a repository's issues (webhook.Normalise passes them by their names). Not issue_comment: anyone may comment, and a comment changes an issue's idle time and count, not where it stands. ConfirmAfter is when a run caused by an event reads again: GitHub's listing can be a few seconds behind the event.
const Kind = "issues"
Kind is the job kind that reads a repository's open issues.
Variables ¶
var Events = []sync.Event{"issues", sync.EventOpen} //nolint:gochecknoglobals // a constant list
var Kinds = []IssueKind{KindBug, KindFeature, KindQuestion, KindOther} //nolint:gochecknoglobals // a constant list
Kinds are the kinds in the order the lists tell them.
var States = []State{StateTriage, StateUnassigned, StateAssigned} //nolint:gochecknoglobals // a constant list
States are the states in the order the lists tell them: what waits first.
Functions ¶
func Counts ¶
func Counts(refs []Ref, by By) oapi.IssueCounts
Counts are the open issues of refs that by keeps.
Types ¶
type API ¶
type API struct {
Current func(context.Context) *snapshot.Snapshot // the viewer's view
Off bool // switched off (features.issues): every request is answered 404
}
API serves the open issues from the current snapshot. It implements the issues method of the strict server.
func (API) ListIssues ¶
func (a API) ListIssues(ctx context.Context, req oapi.ListIssuesRequestObject) (oapi.ListIssuesResponseObject, error)
type Fetcher ¶
type Fetcher interface {
// Open lists up to maxIssues open issues, the most recently updated first; exact reports that every one was listed.
Open(ctx context.Context, owner, name string) (issues []Listed, exact bool, err error)
}
Fetcher reads a repository's open issues.
type Issue ¶
type Issue struct {
Number int `json:"n"`
Title string `json:"title"`
URL string `json:"url"`
Author string `json:"author"`
Bot bool `json:"bot,omitempty"`
Created time.Time `json:"created"`
Updated time.Time `json:"updated"`
Labels []Label `json:"labels,omitempty"`
Assignees []string `json:"assignees,omitempty"` // the first maxPeople
Assigned int `json:"assigned,omitempty"` // every assignee counted
Comments int `json:"comments,omitempty"`
Milestone string `json:"milestone,omitempty"`
Type string `json:"type,omitempty"` // GitHub's issue type
}
Issue is an open issue as the listing gives it, cleaned.
type Issues ¶
type Issues struct {
// contains filtered or unexported fields
}
Issues is the issues feature.
type Listed ¶
type Listed struct {
Number int
Title, URL, Author string
AuthorBot bool // the author's account type is Bot
Created, Updated time.Time
Labels []Label
Assignees []string // the first maxListed logins
Assigned int // every assignee counted
Comments int
Milestone, Type string
// contains filtered or unexported fields
}
Listed is an open issue as GitHub's REST listing gives it.
type Options ¶
type Options struct {
// Repo is the catalogued repository at a key: an archived one is read once.
Repo func(snapshot.RepoKey) (snapshot.Repo, bool)
}
Options are what the job reads of the catalogue.
type Ref ¶
Ref is an open issue of a repository with where it stands.
type Set ¶
type Set struct {
Total int `json:"total"` // open issues on GitHub when Exact, else at least len(Issues)
Exact bool `json:"exact,omitempty"` // every page was read
Issues []Issue `json:"issues"`
}
Set is a repository's open issues, the most recently updated first.