Documentation
¶
Overview ¶
Package jev is Jev's mechanical passes over one pull request (nova-tools #3631): lint (every typed body line present, once, in its one form), scope (every changed file inside PATHS) and base (the PR targets a trunk, the one its body names). No model and no judgement: a friend's attention goes to what a regular expression cannot decide, and these passes run first, on every PR, before any friend read.
The passes make ONE typed line, recorded on the PR record's reads (pr:<name>:<n>, internal/nsprint/land/stream) by `nova-sprint jev mech`:
JEV who=jev pass=mech head=<sha> gate=ok|fail lint=<w> scope=<w> base=<w> why=<one line>
where <w> is ok, fail or missing. missing is not fail: a pass with no evidence to decide on (the mirror has no head yet, the record names no base) says so and does not hold the PR.
A JEV line is never a read. It carries no SCORE, DISPOSITION or HOLD word, its who is jev and stream.ReadAt skips every who=jev* line, so only a friend's line at 8+ lands a PR. The stream lander reads the JEV line as a gate instead (Skip): a gate=fail line at head keeps the PR out of a batch, and cfg:land jev turns the gate off, on (the default) or to require.
Index ¶
Constants ¶
const Kind = "mech"
Kind is the pass field of the mechanical line. Other Jev lines (the nova-decide review JEV line) carry no pass=mech and are not this line.
const Who = "jev"
Who is the name on every JEV line. It is not a friend's name.
Variables ¶
var Passes = []string{"lint", "scope", "base"}
Passes are the passes in the order the line prints them.
var Trunks = map[string]bool{"dev": true, "main": true}
Trunks are the bases a PR may target; any other base is a stacked PR.
Functions ¶
func CanonPaths ¶
CanonPaths reads a PATHS line: parenthesised notes such as (new) go, and what is left is the one path list internal/nsprint/pr canonicalises.
func ParseGating ¶
ParseGating reads cfg:land jev_passes, a comma list of passes that gate; empty is every pass (nil). A pass whose measured precision falls is turned off here, by config, not by hand.
Types ¶
type Body ¶
Body is a PR body's key lines: each `KEY: value` line at the start of a line (markdown bullets and bold allowed), the key upper-cased, every value in order; and the issue references its Closes lines name.
type Check ¶
Check is one pass's answer and the reason it rests on.
func Base ¶
Base is the PR targeting a trunk, the base its body names, cut from the base-sha its record holds. recBase and recBaseSHA are the record's base and base_sha ("" unknown).
func Lint ¶
Lint is every typed body line present, once (a second line with another value is two forms), and in its one form; and a Closes #<n> line or an ORIGIN: line naming where the work came from.
type Input ¶
type Input struct {
Head, Base, BaseSHA, Paths string
Body string
Files []string
FilesKnown bool
FilesWhy string
}
Input is what the passes read: the record's head, base, base_sha and PATHS, the body, and the changed files at head (FilesKnown false when the mirror could not say, FilesWhy the reason).
type Line ¶
type Line struct {
Head string
Lint, Scope, Base Check
// Why is the why= text as parsed; Mech and String build it from the
// checks.
Why string
}
Line is one JEV mech line.
func At ¶
At is the last JEV mech line at head (its head a prefix of at least 7 hex digits of head, as stream.ReadAt counts a read).
func Parse ¶
Parse reads one JEV mech line. Any other line, a JEV line of another pass included, is not one.