progress

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: MIT Imports: 2 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 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 Ordinal

func Ordinal(n int) string

Ordinal formats 1 → 1st, 2 → 2nd, 11 → 11th, 23 → 23rd.

func TierFromCount

func TierFromCount(tiers []int, count int) int

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.

func Calibrate

func Calibrate(refs []string, milestones []official.Milestone) *Calibration

Calibrate uses the highest milestone whose pull request appears in refs (oldest first). If GitHub says PR X was its Nth and X is the i-th in our list, GitHub counts N - i pull requests we cannot see.

type Source

type Source string

Source says how far a number can be trusted.

const (
	Official   Source = "official"   // read from GitHub's own pages
	Calibrated Source = "calibrated" // counted, then checked against an official milestone
	Counted    Source = "counted"    // counted, nothing public to check it against
)

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.

func Stand

func Stand(tiers []int, officialTier, count int) Standing

Stand places count against the tiers, given the tier GitHub shows (0 if none or hidden).

Jump to

Keyboard shortcuts

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