morca · API · views

orca.views.code

Where a pipeline's code is: each step's line at the commit a run, or the registration, was built from (CodeLinks), for the link beside every step a page shows.

Structs

CodeRef

struct CodeRef

A line of a version's code on its host: its URL, where it is (file.mojo:26), and the commit.

Implements Copyable, Defaultable, Movable

Fields
url: String
at: String
commit: String

__init__

def __init__(out self)

__bool__

def __bool__(self) -> Bool

RunCode

struct RunCode

What a runs table shows of a run's code, at the commit the run ran: its pipeline's declaration, and its failed step and that step's function.

Implements Copyable, Movable

Fields
pipeline: CodeRef
failed: String: The first step that failed, or empty.
step: CodeRef: failed's function, or an empty one.

Functions

code_of

def code_of(mut db: State, mut cache: Dict[String, CodeLinks], pipeline: String, run: Int = Int(0)) -> CodeLinks

The code of the version run ran or, if it recorded none or there's no run, of the version pipeline is registered with; each version's worked out once per cache.

runs_code

def runs_code(mut db: State, runs: List[RunRow]) -> Dict[Int, RunCode]

Each run's RunCode, by id: one query for the runs' versions and failed steps, then each version's code (code_links) once.

pipeline_srcs

def pipeline_srcs(mut db: State, names: List[String]) -> Dict[String, String]

Each pipeline's declaration at the version it's registered with, as the URL of its line (CodeLinks.pipeline), for those that have one.