singular-registry
LicenseApache-2.0
Safe HaskellNone
LanguageGHC2021

Singular.Registry.Candidate

Description

Resolves the candidate revision for the row runners (#91): the CANDIDATE_SHA override wins for smoke runs, else the invocation repository's git rev-parse HEAD, else the RELEASE-COMMIT file a published release archive carries at its root — the archive is not a git checkout, so the file is found by walking up from the working directory (the runners execute from offchain/ inside the extracted archive). A revision that cannot be established fails closed, never "unknown".

Synopsis

Documentation

data CandidateSource Source #

Where a resolved candidate revision came from.

Constructors

CandidateFromEnv

The CANDIDATE_SHA environment override.

CandidateFromGitHead

The invocation repository's git rev-parse HEAD.

CandidateFromReleaseCommit

The RELEASE-COMMIT file of a published release archive.

Instances

Instances details
Show CandidateSource Source # 
Instance details

Defined in Singular.Registry.Candidate

Methods

showsPrec :: Int -> CandidateSource -> ShowS Source #

show :: CandidateSource -> String Source #

showList :: [CandidateSource] -> ShowS Source #

Eq CandidateSource Source # 
Instance details

Defined in Singular.Registry.Candidate

Methods

(==) :: CandidateSource -> CandidateSource -> Bool Source #

(/=) :: CandidateSource -> CandidateSource -> Bool Source #

resolveCandidate :: IO (Either String (String, Bool, CandidateSource)) Source #

Candidate revision, derived not told: an explicit override wins for smoke runs, else the invocation repository's HEAD, else the RELEASE-COMMIT file of the release archive the working directory sits in. A revision that cannot be established fails closed — never "unknown". Worktree cleanliness rides along as before: a git status that cannot be read counts as dirty.

sourceName :: CandidateSource -> String Source #

Stable name for the source, as recorded in a run's meta.json.