Documentation
¶
Overview ¶
Package progress evaluates raw contribution tallies against achievement tiers to determine milestone standing, floor thresholds, and remaining counts.
Package progress turns official tiers and live counts into one honest number.
The rule: a count may raise the shown tier (GitHub can lag) but a tier GitHub granted is never taken back, so a count below the tier's floor means part of the activity is invisible to the API, and the floor is shown instead.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TierFromCount ¶
TierFromCount is the highest tier whose threshold count reaches. An unknown threshold (0) is skipped, so a count past a known higher one still reaches that tier.
Types ¶
type Calibration ¶
type Calibration struct {
At int `json:"at"` // GitHub's ordinal, e.g. 16
PR string `json:"pr"` // the pull request GitHub names for it
Offset int `json:"offset"` // how many more GitHub counts than we can see
}
Calibration compares GitHub's count with ours at a milestone both can see.
type Standing ¶
type Standing struct {
Tier int `json:"tier"` // effective tier: max(official, implied by count)
Count int `json:"count"` // never below the floor of Tier
Floor int `json:"floor"` // threshold of Tier, 0 below x1
Target int `json:"target,omitempty"` // threshold of the next tier
Remaining int `json:"remaining,omitempty"`
IsMax bool `json:"isMax"`
// IsAhead is true when the count implies a higher tier than GitHub shows.
IsAhead bool `json:"isAhead"`
}
Standing is where a count sits between two tiers.