Documentation
¶
Overview ¶
Package gate holds the gate of the bench: the gate file, which names what the gate's numbers were recorded on — the commits of the libraries, the pinned packages, the versions the workspace chose and the go lines — and the bands; the gate's cells and numbers; the checks of a run against the file; and the recording of the bands anew.
Index ¶
- Constants
- Variables
- func Cells() []string
- func Config(part bench.Part, commits map[string]string) bench.Config
- func ModulesConfig(part bench.Part, commits map[string]string, packages []bench.Package) bench.Config
- func Numbers(population string) []string
- func ReadPackages(packages []Package) ([]bench.Package, error)
- func Verify(f *File, info *debug.BuildInfo, goVersion string, modules []Module) []string
- type Band
- type Bands
- type Change
- type File
- type Held
- type Library
- type Module
- type Modules
- type Package
- type Report
- type Row
- type State
- type ThresholdReport
- type Value
Constants ¶
const Learners = 250
Learners are the learners of each cell of the gate: the first of the working set. The slowest job of the gate, at a caller that keeps no cache of Go, is to take at most twelve minutes, three short of the job's budget of fifteen, with a margin beyond that for the runner's spread; the gate keeps the budget by a change of sim, not of the time.
Variables ¶
var ErrModules = errors.New("gate: modules")
ErrModules is a comparison or a run of the gate of modules the bench refuses.
var Populations = []string{"G0", "G1", "G2", "G2-half", "G3", "F-model", "W-shock", "A-linked", "E-base", population.GoalTwin, "T-area", "T-skill"}
Populations are the populations of the gate, each on every graph it runs on, in the order of population. A-linked runs on the two published maths together, since olympiad maths rests skills on school maths, and so do the populations of the goal for the tutor: T-none with the empty goal, T-area and T-skill its learners with one item set.
Functions ¶
func Cells ¶
func Cells() []string
Cells gives the cells of the gate: every population on each of its graphs.
func Config ¶
Config gives the run of the gate, or a part of it: its learners under the engine, each run twice for I1, the libraries named by the commits the recipe gives.
func ModulesConfig ¶
func ModulesConfig(part bench.Part, commits map[string]string, packages []bench.Package) bench.Config
ModulesConfig gives the run of the gate of modules, or a part of it: the gate's run, on the packages of a pull request in place of the pinned ones, so on the graphs they cover alone.
func Numbers ¶
Numbers gives the numbers of the gate of a population: its own, then the share of learners stuck and the share of the choices of nothing while the pool has a task to give.
func ReadPackages ¶
ReadPackages reads the packages of a pull request as a run takes them, in place of the pinned ones: each checked against its inventory and translated.
func Verify ¶
Verify gives every way the build of the gate departs from the gate file: a library not built from the workspace, a shared dependency the workspace chose at another version, a module whose go line is another than the recorded or newer than the Go that built the gate, sim's go.mod requiring a library at another point than the file names — the tag of its release, or the pseudo-version of its commit while it is in none —, and packages other than those the bench embeds.
Types ¶
type Band ¶
type Band struct {
Cell string `json:"cell"`
Number string `json:"number"`
Read bool `json:"read"`
Value float64 `json:"value"`
Half float64 `json:"half"`
}
Band is the band of one number of the gate on one cell: its recorded value and the half-width of its 95 % interval; a number the recording could not read is recorded as not read.
type Change ¶
type Change struct {
State State
Module, Version string
Against string
Folder string
Read *bench.Package
// With is, for a package that did not change, the module that changed and brings it into the run:
// a graph of a population of the gate holds the two together (Runs).
With string
}
Change is a package of a pull request and what it is: its module and version, and the published version it was compared with, if any. Read is the package read, when the bench reads its format.
func Changes ¶
func Changes(idx *formatv0.ModuleIndex, pub, packages []Package) ([]Change, error)
Changes tells, for each package of a pull request, whether what the bench reads of it changed against the newest published version of its module that is not withdrawn — the one api gives —, by their canonical texts (pack.Module.Text). idx is the index of the newest release of modules, which release-verify has accepted, and pub the packages of its versions, each checked by the chain of digests from it; with no index, there is no release yet, and every package is new. A package of another version of the format than that version is a transition, whose content the bench does not compare across the formats, and of whose published version it reads only the version of the format its entry names; a package of a version of the format the bench does not read, which is no transition, is refused: a newer one wants a newer tag of sim, and one older than pack.Format, which module-kit no longer builds, is refused against any release. A package that is broken is refused: a server part apart from its inventory, a transition too, since the inventory keeps server_part in every version, and a manifest of another module in a version the bench reads.
func Runs ¶ added in v0.1.2
Runs gives the packages of a pull request the gate of modules runs on, in their order: the changed and new ones, or with all every one but a transition of the format; and with them each package that did not change but shares a graph of a population of the gate with one that runs, so that the graph runs on the packages of the pull request — A-linked on both maths when either changed. Such a package names in With the module that brings it.
type File ¶
type File struct {
Libraries map[string]Library `json:"libraries"`
Modules Modules `json:"modules"`
Dependencies map[string]string `json:"dependencies"`
Go map[string]string `json:"go"`
Bands Bands `json:"bands"`
}
File is the gate file: the libraries by module path, the packages, the versions of the shared dependencies the workspace chose, the go line of each module by its path, and the bands.
type Library ¶
type Library struct {
Repository string `json:"repository"`
Commit string `json:"commit"`
Version string `json:"version"`
}
Library is a library the gate builds the bench on: its repository, the full SHA of its commit, and the tag of the release on that commit, empty while it is in none.
type Module ¶
Module is a module of the gate's workspace as its go.mod says: its path, its go line, and the versions it requires, by path.
func ParseGoMod ¶
ParseGoMod reads the module path, the go line and the requirements of a go.mod.
type Modules ¶
type Modules struct {
Release string `json:"release"`
Index string `json:"index"`
Packages []published.Package `json:"packages"`
}
Modules are the packages the gate runs on: the release of modules and the digest of its index, and each package by its module, version and package digest.
type Package ¶
Package is a package as a folder holds it: the folder, and its inventory.json and server.json.
type Report ¶
type Report struct {
Rows []Row
Reasons []string
Exact bool // the numbers are held to the last bit, not to their bands
}
Report is the gate's verdict: every number against its band, and why it is red, if it is.
func Check ¶
Check checks a run of the gate against the gate file: the run is the gate's whole run, no learner breaks an invariant, and every number is within its band — two half-widths of the recorded value, the edges included —, or, held exactly, the recorded value to the last bit. A number the recording could not read is held as not read. The populations with no published graph are not run, and the report names them.
type Row ¶
type Row struct {
Cell, Number string
Band *Band // nil: the gate file has no band for it
Now Value
InBand bool
Exact bool // the number is the recorded one to the last bit
}
Row is one number of the gate against its band.
type State ¶
type State string
State is what a package of a pull request is against the published versions of its module.
const ( // New is a module with no published version, or with none to compare when there is no release // yet: it changed whole. New State = "new" // Changed is a package whose canonical text differs from that of the newest published version. Changed State = "changed" // Same is a package the bench reads the same of as the newest published version. Same State = "same" // Transition is a package of another version of the format than the newest published version: // a transition of the format, where the bench does not run. Transition State = "transition" )
type ThresholdReport ¶
type ThresholdReport struct {
Packages []published.Package
Rows []Held
Reasons []string
Uncovered []string
// Partial are the cells of the gate on a module of the run that did not run, for want of a package
// of another module of their graph: each with the modules it wanted.
Partial []string
}
ThresholdReport is the verdict of the gate of modules: every number against its threshold, why it is red, if it is, and the modules on which no cell of the gate runs.
func Thresholds ¶
func Thresholds(f *File, results *bench.File) (*ThresholdReport, error)
Thresholds checks a run of the gate of modules against the thresholds, their limits from the gate file: the run is the gate's on packages, on the commits of the libraries the file names, with every cell the packages cover and all its learners; no learner breaks an invariant; every number with a threshold is within it, the edges included, and a number the run could not read is not. A package on which no cell of the gate runs — a module the bench has no population on — is named, not red: populations on a new graph are a change of sim. So is a cell of the gate on a module of the run that did not run because the run has no package of another module of its graph: the CI of modules gives every module it builds, and so a module it does not give is one it does not build, or a transition of the format.
func (*ThresholdReport) OK ¶
func (r *ThresholdReport) OK() bool
OK tells whether the gate of modules is green.