Documentation
¶
Overview ¶
Package gitmeta collects pull-request cost-attribution metadata from local git, for Goei's cost-per-PR view. It is opt-in (budgetclaw prs on) and content-free: it reads only branch names, merge/squash commit subjects (for the PR number), commit counts, and numstat diff sizes. It never reads commit message bodies, code, or diffs content. Every git invocation is read-only, time-bounded, and non-fatal: a directory that is not a git repo, or a machine without git, simply yields nothing.
The join back to spend is by (project, branch): budgetclaw already sends spend keyed by project (basename of the working directory) and git branch, so a PR record tagged with the same (project, branch) lets Goei sum that branch's local spend as the PR's cost.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PRRecord ¶
type PRRecord struct {
Project string `json:"project"`
Branch string `json:"branch,omitempty"`
PR int `json:"pr,omitempty"`
Base string `json:"base,omitempty"`
State string `json:"state"`
MergedAt string `json:"mergedAt,omitempty"`
Commits int `json:"commits"`
Additions int `json:"additions"`
Deletions int `json:"deletions"`
}
PRRecord is one pull request (or in-flight branch) with the metadata needed to attribute cost to it. State is "merged" (a merge commit named the branch and PR), "squashed" (a squash-merge commit on the base branch carried the PR number, but the head branch is gone so cost cannot be joined by branch), or "open" (a local branch with spend that is not yet merged).