checks
Schema reference for the checks and checks_latest SQL views — every policy check evaluation with status, enforcement, component, and PR context.
checks
checks_latestThe checks view is a time series representation of the collection of checks that Lunar ran on components.
A subset of this data is available in the checks_latest view, which contains only the checks for the latest git_sha in each pr, in each component. To get the latest row for the default branch, you can filter this view by pr IS NULL.
Schema
component_id
TEXT
The identifier for the component - e.g. github.com/foo/bar/buz
committed_at
TIMESTAMP
The "committed at" UTC timestamp of the git_sha
git_sha
TEXT
The Git commit SHA of the component JSON
pr
BIGINT
The pull request number if the commit is part of a pull request. Set to NULL for the default branch
name
TEXT
The name of the check that was run
description
TEXT
The description of the check that was run
initiative_id
TEXT
The identifier of the initiative this check's policy belongs to
policy_id
TEXT
The identifier of the policy this check is part of
enforcement
TEXT
The enforcement level of the check. Can be one of draft, score, block-pr, block-release, block-pr-and-release
status
TEXT
The status of the check. Can be one of pass, fail, pending, error, skipped
failure_reasons
TEXT[]
Array of human-readable reasons the check failed. Set to NULL if the check passed.
staleness
INTERVAL
The time since the check was last evaluated. Set to NULL if the check is not stale.
manifest_version
TEXT
The version of the manifest used for this check
Notes
To get the set of checks for a given component version, you need to filter by
component_id, andgit_sha.The
committed_atis guaranteed to be the same for a givengit_shaof acomponent_id. This timestamp will also match entries in other views such ascomponentsandcomponent_deltas.While a certain
git_shafor a component is being evaluated, the row may use a stale result from a previous version of the code. In such cases, thestalenesscolumn will be set to the time since the check was last evaluated.
Usage examples
Retrieve the checks associated with the latest git_sha for a given component, ordered by status.
Retrieve time series data of the number of checks that passed, failed, had no data, or errored out over time.
Retrieve the checks that are failing for all components with the tag soc2.
Retrieve the checks that are blocking PRs right now.
Count the number of PRs that are blocked by checks for each domain.
Total blocking checks for the domain payments over time.
All blocking failing checks of all PRs authored by Jane.
Last updated
