Documentation
¶
Overview ¶
Package standup collects one identity's recent work for a daily standup: GitHub activity, the sprint board and vault notes. It only reads; the /ki-recap skill turns the report into prose.
Index ¶
- Constants
- Variables
- func Allowed(cfg *projects.Config) []string
- func SelectIdentity(cfg *projects.Config, flag string, current *projects.Identity) (projects.Identity, error)
- func Since(now time.Time, flag string) (time.Time, error)
- type Board
- type BoardItem
- type Client
- type Item
- type Note
- type Report
- type Scope
Constants ¶
const DefaultEndpoint = "https://api.github.com/graphql"
DefaultEndpoint is GitHub's GraphQL API.
Variables ¶
var ErrBadSince = errors.New("invalid --since")
ErrBadSince is returned for a --since value that is not a past date.
var ErrIdentity = errors.New("no recap identity")
ErrIdentity is returned when no identity can be used for a standup.
Functions ¶
func SelectIdentity ¶
func SelectIdentity(cfg *projects.Config, flag string, current *projects.Identity) (projects.Identity, error)
SelectIdentity picks the identity named by flag, else the current repo's. Identities marked vault: false are refused: their work never meets the vault or the knowledge base, so a standup could not stay inside it.
Types ¶
type BoardItem ¶
type BoardItem struct {
Item
Board string `json:"board"`
Labels []string `json:"labels,omitempty"`
Status string `json:"status,omitempty"`
// StatusChangedAt is when the Status field was last set.
StatusChangedAt *time.Time `json:"status_changed_at,omitempty"`
Iteration string `json:"iteration,omitempty"`
// Fields holds the card's other single-select and text values by field
// name, such as Priority or a blocker reason.
Fields map[string]string `json:"fields,omitempty"`
ChangedInWindow bool `json:"changed_in_window"`
}
BoardItem is one card assigned to the user on a project board.
type Client ¶
type Client struct {
Endpoint string
// Token belongs to the identity the standup is for; it is sent only as a
// header and never appears in errors.
Token string
HTTP *http.Client
}
Client queries GitHub's GraphQL API as one account. It only reads.
type Item ¶
type Item struct {
Kind string `json:"kind"` // pr, issue or draft (a board-only note)
Repo string `json:"repo,omitempty"`
Number int `json:"number,omitempty"`
Title string `json:"title"`
URL string `json:"url,omitempty"`
State string `json:"state"` // open, draft, merged or closed
Actions []string `json:"actions,omitempty"`
// At is the latest action in the window, or the last update of an open item.
At time.Time `json:"at"`
}
Item is one pull request or issue and what the user did to it.
type Note ¶
type Note struct {
Path string `json:"path"` // relative to the vault
Modified time.Time `json:"modified"`
}
Note is a vault note changed in the window.
type Report ¶
type Report struct {
Identity string `json:"identity"`
GitHubUser string `json:"github_user"`
Since time.Time `json:"since"`
Until time.Time `json:"until"`
Done []Item `json:"done"`
Open []Item `json:"open"`
Board []BoardItem `json:"board"`
VaultNotes []Note `json:"vault_notes"`
// Dropped counts items from repos that belong to other identities.
Dropped int `json:"dropped"`
Warnings []string `json:"warnings"`
}
Report is everything one identity's standup is drafted from.
type Scope ¶
type Scope struct {
Identity projects.Identity
Boards []Board
// VaultFolders are folder names under the vault's projects/ that belong
// to this identity and to no other.
VaultFolders []string
// contains filtered or unexported fields
}
Scope is what one identity's standup may read.