standup

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2026 License: Apache-2.0 Imports: 15 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
const DefaultEndpoint = "https://api.github.com/graphql"

DefaultEndpoint is GitHub's GraphQL API.

Variables

View Source
var ErrBadSince = errors.New("invalid --since")

ErrBadSince is returned for a --since value that is not a past date.

View Source
var ErrIdentity = errors.New("no recap identity")

ErrIdentity is returned when no identity can be used for a standup.

Functions

func Allowed

func Allowed(cfg *projects.Config) []string

Allowed lists the identities a standup may be drafted for.

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.

func Since

func Since(now time.Time, flag string) (time.Time, error)

Since returns the start of the standup window: 00:00 local on the previous working day, so Monday starts on Friday. A YYYY-MM-DD flag overrides it.

Types

type Board

type Board struct {
	Owner string
	Title string
}

Board is a GitHub Project named on one of the identity's projects.

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.

func NewClient

func NewClient(endpoint, token string) *Client

NewClient returns a client for endpoint (DefaultEndpoint when empty).

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.

func Collect

func Collect(ctx context.Context, c *Client, s Scope, vault string, since, until time.Time) (*Report, error)

Collect reads the activity, boards and vault notes of the scope's identity. Only the activity is required; a board or vault that cannot be read becomes a warning.

func (*Report) WriteText

func (r *Report) WriteText(w io.Writer) error

WriteText prints the report for a person; skills use the JSON form.

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.

func NewScope

func NewScope(cfg *projects.Config, id projects.Identity) Scope

NewScope derives the boards, vault folders and foreign owners for id.

func (Scope) Allows

func (s Scope) Allows(nameWithOwner string) bool

Allows reports whether an "owner/name" repo may appear in this standup: owners projects.yaml gives only to other identities never do.

Jump to

Keyboard shortcuts

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