Documentation
¶
Overview ¶
Package testgrid maps a recipe's canonical coordinate to the AICR evidence dashboard (validation.aicr.run) and answers "does this coordinate have a dashboard presence?" — the two facts RQ1 (#1283) and RQ2 (#1284) share.
It is deliberately thin and owns no mapping of its own: the recipe → coordinate mapping is pkg/recipe.CoordinateFor (the single shared function consumed by GP4/GP5/TG2/RQ1). testgrid only adds the dashboard host, the hash-routed deep-link scheme built around Coordinate.Path, and the committed presence manifest.
Two presence sources, one spelling of a coordinate path:
- Committed (hermetic): presence.yaml, embedded here and read offline by the recipe-health generator so link *construction* never touches the network. LoadPresence exposes it as a Presence set.
- Live: the published data/index.json the dashboard renderer boots from. LivePaths extracts the present coordinate paths from a parsed index so the warning-only link-check bot can compare the committed links against what the dashboard actually serves.
Index ¶
Constants ¶
const DataURL = Origin + "/data/index.json"
DataURL is the published boot payload the dashboard renderer fetches on load (index.json under the site's data/ directory). It is the same-origin data source the warning-only link-check bot reads to learn which coordinates the live dashboard actually serves — the hash fragment in a deep-link is client side only, so a GET on the fragment URL cannot reveal coordinate presence.
const Origin = "https://validation.aicr.run"
Origin is the AICR evidence dashboard's public origin. It is the single pinned host every consumer builds links against and the link-check bot pins its resolution to; a coordinate path is appended to it, never interpolated from recipe/overlay content, so the target can never be steered off-origin.
Variables ¶
This section is empty.
Functions ¶
func LinkFor ¶
func LinkFor(co recipe.Coordinate) string
LinkFor returns the dashboard deep-link for a coordinate: the pinned Origin plus the hash route for the coordinate's canonical path. Construction is pure and offline — the same coordinate always yields the same byte-stable link — so the recipe-health generator stays hermetic.
func LivePaths ¶
func LivePaths(idx *corroborate.Index) map[string]struct{}
LivePaths extracts the set of coordinate paths present in a parsed dashboard index. It reuses pkg/recipe.CoordinateFor as the single source of truth for how a coordinate path is spelled, so the live and committed sides can never drift on path formatting. A tab whose coordinate does not resolve to a concrete path (an "any"/empty required dimension the dashboard should never emit) is skipped rather than mis-placed.
Types ¶
type Presence ¶
type Presence struct {
// contains filtered or unexported fields
}
Presence is the committed set of coordinate paths that currently carry a dashboard presence. It answers Has(coordinate) for the generator and exposes its Paths for the link-check bot.
func LoadPresence ¶
LoadPresence parses the embedded presence manifest. It fails closed on a malformed manifest or a malformed coordinate path rather than silently treating a broken file as "nothing is present", which would drop every Evidence link without warning. The decoder is strict (KnownFields) and an absent or empty `coordinates` list is rejected, so a typo such as `coordinate:` cannot load an empty presence set and make the whole matrix fall back to `pending`.