livery.workshop._points¶
livery.workshop._points ¶
CI as points: what each point is, what it runs, and the verb that runs it.
A consumer never thinks about CI. They reason about a named point in
the process and attach a task to it. The four points are gate
(a pull request, or a dispatch by hand), merge (main after a
merge), nightly (the clock), and release (dispatched by the
merge point). A point is a declaration, livery.workshop._points.Point:
its workflow file, its events, and its jobs, each job stating what it
needs in the workshop's words (livery.workshop._points.Job); each
forge's renderer says those in its own. The emitted workflow is a
static shell, one fm ci.run --point=<p> --job=<j> per job, with
--shard=<i>of<n> on a check leg the contract splits, and what a
job does is data: the builtin schedule below, plus the
[[ci.schedule]] entries a workspace declares in workshop.toml.
The matrix shape belongs to a point's job, never to a task.
Reach for livery.workshop._points.run_point to run a job's
entries, and schedule to see them. Every entry runs as a child of
the runner's own command, so a scheduled task is any task the
workspace mounts, and the child's exit is the entry's.
The merge point inherits the gate's jobs: a push to main runs the
same checks, plus the jobs only a merge has (the docs deploy, the
governance reconcile). A shell spells --point=gate on the shared
jobs and the verb promotes the point on a push, so the YAML carries
no decision.
A package contributes a point of its own through [[ci.point]] in
its workshop.toml: a scheduled point with a dispatch entry, one
job on the runners and Pythons it names, running the task it names
with the job token and nothing more. points is every point a
workspace has, the builtin four first; every reader takes that set.
Classes:
| Name | Description |
|---|---|
Input |
One input a dispatched point takes, as the forge prompts for it. |
Job |
One job of a point's shell, in the workshop's words. |
Point |
One point: its workflow file, its events, and its jobs. |
Contribution |
A point a package contributes, and the entry that runs it. |
JobContribution |
One job a mounted extension adds to a builtin point, with its entries. |
Entry |
One scheduled task: at which point and job, which task, which arguments. |
Functions:
| Name | Description |
|---|---|
verify_points |
Refuse a set of declarations a shell cannot be rendered from. |
contributed |
The |
point_has_job |
Whether the builtin point has the job name, declared, inherited or added. |
verdict_jobs |
Each builtin point that declares a verdict job of its own, with the job's name. |
judges_refusal |
Why judges may not join job of point; empty when they may. |
contribute_job |
Add job to the builtin point on behalf of extension, or join one. |
snapshot |
The jobs the extensions added and joined, and the kept task tree, for restore. |
restore |
Put the added jobs, the joins and the kept task tree back to state. |
contributed_jobs |
The jobs the extensions contributed to point, in contribution order. |
joined_jobs |
The joins the extensions made to point's jobs, in contribution order. |
contributor_of |
The extension that contributed job to point; the base for its own jobs. |
verdict_needs |
What point's verdict waits for: its declared needs, then the gating jobs. |
composed_points |
The builtin points with the extensions' contributed jobs in place. |
points |
Every point root has: the builtin four, then the ones its packages contribute. |
emitted_points |
|
inherited_jobs |
The jobs point runs before its own, from the point it inherits. |
point_by_name |
|
jobs_reading |
The jobs whose declared inputs read path, each |
unread_by_the_job |
The line that skips job of point when nothing it reads changed, or empty. |
job_installs |
What each job installs before it enters, by its point and its name. |
job_seams |
The seam each deploying job publishes through, by its point and its name. |
job_runners |
The runner labels each job's |
events_of |
The events that start point's runs; refuses a name that is not a point. |
dispatchable |
The points a person starts by hand: a dispatch entry and no input to supply. |
profile_box |
The job's drop box, where every entry leaves its own timeline. |
trace_file |
The file an entry's own trace is written to, named after the task. |
due |
Whether a cadence runs on on, and the day it runs next. |
last_verdict_sha |
The commit SHA, verdict and run id of point's latest finished row on ref. |
entry_due |
Whether entry is due to run now, and the reason when skipped. |
due_jobs |
Which jobs of point have a due task; prints reasons and writes output. |
declared |
The |
builtin_schedule |
The builtin entries with the extensions' contributed jobs' entries in place. |
schedule |
Every entry: the builtin ones, the packages' contributed ones, the contract's. |
recording |
The record ending every job of each point of root with no verdict job. |
half_writers |
The jobs of point that put a half of the run's row, by their schedule names. |
workflow_of |
The workflow file point's shell is; refuses a name that is not a point. |
jobs_of |
The jobs point has: declared ones, inherited first, then any an entry names. |
first_leg |
The first leg of job at point: its first runner and its first Python. |
entries_for |
The entries job of point runs, in order; refuses an unknown job. |
scheduled_tasks |
Every task point runs, across its jobs, in schedule order, once each. |
asked_tasks |
The tasks a dispatch's only names, judged against what point runs. |
pull_request_runners |
The runners a pull request's check legs fan out to. |
pull_request_listed |
Name the list a pull request's runners come from, for a shard refusal. |
pull_request_legs |
Name the check legs a pull request's run produces, |
check_legs |
Name the check legs the gate produces, |
shards_max |
The most shards a runner may take: |
shard_counts |
The shards per runner |
check_shards |
Name the shard legs the gate produces, split as |
pull_request_shards |
Name the shard legs a pull request's run produces, split as the contract says. |
sharded_legs |
The platform legs the contract splits into shards, on any event. |
effective_point |
The point a shell's |
run_point |
Run every entry of job at point, in order; a red entry fails the job. |
Attributes:
| Name | Type | Description |
|---|---|---|
EVENT_NAMES |
|
|
ONLY |
|
|
CLOCK |
|
|
DECLARED |
tuple[Point, ...]
|
|
POINT_BY_NAME |
dict[str, Point]
|
|
POINTS |
|
|
POINT_NAME |
|
|
MOUNTED |
Tasks | None
|
|
EVENTS |
|
|
DISPATCHABLE |
|
|
INHERITS |
|
|
TRACE |
|
|
CADENCES |
|
|
VERDICTS |
|
|
today |
Callable[[], date]
|
The day a run judges a cadence on, UTC as the runners keep it. |
COLLECT |
|
|
DROP_TASK |
|
|
RECORD_TASK |
|
|
BUILTIN |
tuple[Entry, ...]
|
|
EVERY_RUNNER_LABEL |
|
|
SHARDS_MAX |
|
EVENT_NAMES
module-attribute
¶
DECLARED
module-attribute
¶
DECLARED: tuple[Point, ...] = (Point('gate', 'ci.yml', ('pull_request', 'workflow_dispatch'), note='A pull request, a push to main, and a dispatch by hand. A dispatched run pays the full gate: the check verb reads the event and narrows on a pull request alone, so every event spells the same call.', jobs=(Job('check', matrix='legs', fetch='full', publishes='run-legs', paths=('.workshop/run-legs',), upload_always=True, retention_days=1, note="The check legs: each runs the gate read-only and uploads its timing row and spooled leg files as an ephemeral artifact for the gate job, even when a leg is red. The scoped gate measures from the proved tree nearest the checkout's, an earlier push's merge rebuilt from its two commits among them, or from the merge base with the pull request's base branch; each needs history a shallow clone lacks."), Job('gate', needs=('check',), always=True, fetch='full', token='job', writes=True, collects='run-legs', dispatches=True, step='Verdict', note="The one required context. Branch protection points here, so the matrix can grow or shrink without touching repository settings. Its entries run the judges the extensions add, collect the run's timing rows, ask the forge for the jobs it needs, and stamp the tree a green run proved; a red run is judged too. The stamp composes a narrowed run with the record of the tree its legs measured from, and names the two commits a merge checkout joined. On a push to main the same job then dispatches the release wave, runs what the extensions add to the merge point, and runs the janitor."))), Point('merge', 'ci.yml', ('push',), inherits='gate', jobs=(Job('govern', fetch='2', token='admin', environment='govern', isolated='livery.workshop._govern_entry', note="The repository settings reconciled when the merge changed a contract or the owners file. The commit's own file list decides whether anything is governed; a depth of one would read a squash as a root."),)), Point('nightly', 'nightly.yml', ('schedule', 'workflow_dispatch'), inputs=(Input(ONLY, 'the scheduled tasks to run, comma-separated; empty runs the whole schedule'),), cron=CLOCK, note="The nightly point: the clock and a dispatch entry, one call per Python. What runs is the workshop's builtin schedule plus [[ci.schedule]] in workshop.toml, and the tests that declare the nightly point are selected in.", jobs=(Job('nightly', matrix='pythons', fetch='full', token='repository', writes=True, pushes=True, environment='bot', note="A verification checks the tree out at a release tag. A pull request a scheduled task opens with the job token starts no workflow and cannot push a workflow file, so the repository's token carries the checkout and the nightly where there is one. The job's profile trace rides the state store at its end, which needs the write grant as the check legs' puts do."), Job('suite', matrix='legs', fetch='full', token='job', writes=True, conan_cache=True, note='The scheduled full run of every test across every platform. Skipped by the due job when the head has not moved since the last verdict.'))), Point('release', 'release.yml', ('workflow_dispatch',), inputs=(Input('ref', 'the release squash to publish', required=True), Input('workshop', "a released livery-workshop version to drive the wave; empty runs the squash's own")), ref_input='ref', note="The train: a workflow.release PR merges, this publishes its squash, and the receipt tags are cut only after the index confirms each member. A tag is a receipt, never a trigger: the merge point's dispatch job starts the wave at the release squash, and a hand dispatch with --ref is the recovery entry when a publish died mid-wave; --workshop names a released driver for a wave whose own workshop was the fault.", jobs=(Job('build', fetch='full', publishes='dists', paths=('packages/*/dist/*', 'packages/*/*/dist/*', 'packages/.release-dists.json'), retention_days=1, step='Build release distributions', note="Build the release's distributions in an unprivileged job with no publishing credentials, record their SHA-256 digests, and hand them to the isolated publish job as an artifact."), Job('publish', needs=('build',), collects='dists', fetch='full', token='repository', writes=True, pushes=True, publishes_index=True, environment='pypi', isolated='livery.workshop._publish_entry', step='Publish the wave', note="The wave: verify prebuilt distributions in isolation, publish the ref, and cut the receipt tags after the index confirms each member. The receipt push carries the repository's token where there is one: the job token may not push a ref whose commit carries a workflow file that differs from the tip's."))))
POINT_BY_NAME
module-attribute
¶
DISPATCHABLE
module-attribute
¶
DISPATCHABLE = tuple(point.name for point in DECLARED if 'workflow_dispatch' in point.events and not any(item.required for item in point.inputs))
INHERITS
module-attribute
¶
INHERITS = {point.name: point.inherits for point in DECLARED if point.inherits}
today
module-attribute
¶
The day a run judges a cadence on, UTC as the runners keep it.
A variable, not a function, so a test fixes the day instead of waiting for a Monday.
BUILTIN
module-attribute
¶
BUILTIN: tuple[Entry, ...] = (Entry('gate', 'check', 'check', sharded=True), Entry('gate', 'check', 'ci.leg', ('--job={display}',), last=True), Entry('gate', 'gate', 'workflow.release.check-title'), Entry('gate', 'gate', 'ci.fold'), Entry('gate', 'gate', COLLECT), Entry('gate', 'gate', 'speed.judge'), Entry('gate', 'gate', 'ci.verdict', ('--needs=check',)), Entry('gate', 'gate', 'workflow.release.check-fresh'), Entry('gate', 'gate', DROP_TASK, ('--point=gate', '--job={display}'), last=True), Entry('merge', 'govern', 'workflow.configure', ('--if-changed',)), Entry('merge', 'gate', 'workflow.release.dispatch'), Entry('merge', 'gate', 'janitor', last=True), Entry('nightly', 'nightly', 'doctor', ('--fix',), if_changed=True), Entry('nightly', 'nightly', 'check', if_changed=True), Entry('nightly', 'suite', 'check', sharded=True, if_changed=True), Entry('release', 'build', 'workflow.release.build', ('--ref={ref}',)), Entry('release', 'publish', 'workflow.release.publish', ('--ref={ref}',)))
Input
dataclass
¶
One input a dispatched point takes, as the forge prompts for it.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
The input's name, as the dispatch passes it. |
description |
str
|
What the input is, for the person dispatching. |
required |
bool
|
Whether a dispatch without it is refused. |
default |
str
|
The value an absent optional input takes. |
Job
dataclass
¶
Job(name: str, matrix: str = '', runners: tuple[str, ...] = (), pythons: tuple[str, ...] = (), labels: Callable[[Path], Sequence[str]] | None = None, needs: tuple[str, ...] = (), always: bool = False, fetch: str = '', token: str = '', writes: bool = False, pushes: bool = False, publishes_index: bool = False, installs: Callable[[Path], Sequence[str]] | None = None, conan_cache: bool = False, cache_dir: str = '', deploy: Callable[[Path], str] | None = None, publishes: str = '', paths: tuple[str, ...] = (), upload_always: bool = False, retention_days: int = 0, collects: str = '', environment: str = '', isolated: str = '', dispatches: bool = False, inputs: Inputs | None = None, step: str = '', note: str = '', joins: bool = False)
One job of a point's shell, in the workshop's words.
Each forge's renderer says these in that forge's words: a grant, a step, an action, an image. Nothing here is forge-shaped.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
The job's name, and the |
matrix |
str
|
The legs the job fans out to: |
runners |
tuple[str, ...]
|
The runners a |
pythons |
tuple[str, ...]
|
The Pythons a |
labels |
Callable[[Path], Sequence[str]] | None
|
The function naming the runner labels a |
needs |
tuple[str, ...]
|
The jobs of the point this one waits for. |
always |
bool
|
Whether the job runs when a job it needs was red, the verdict job's shape. |
fetch |
str
|
How deep the checkout is: |
token |
str
|
The credential the verb sees as |
writes |
bool
|
Whether the job pushes to the repository (the state store, a receipt tag), which needs the write grant. |
pushes |
bool
|
Whether the job pushes through git itself, so the checkout carries the credential the push needs. |
publishes_index |
bool
|
Whether the job uploads to a package index,
so the index token reaches it as |
installs |
Callable[[Path], Sequence[str]] | None
|
The function naming the system packages the job installs before it enters, given the workspace's root; None for none. The extension that contributes the job names it, so the render installs them without knowing what they are for. |
conan_cache |
bool
|
Whether the job builds native packages, so the lane restores and saves conan's home around it. |
cache_dir |
str
|
Workspace-relative directory restored before the job
enters and saved after, keyed on the job name, runner,
|
deploy |
Callable[[Path], str] | None
|
The function naming the seam the job publishes a site
through after the call, given the workspace's root; None
for a job that publishes none. A |
publishes |
str
|
The artifact the job uploads, |
paths |
tuple[str, ...]
|
The paths the uploaded artifact carries, as the forge
globs them; |
upload_always |
bool
|
Whether the artifact upload runs even when a
previous step failed ( |
retention_days |
int
|
Days the forge retains the uploaded artifact
before automatic expiry; |
collects |
str
|
The artifact the job downloads first, |
environment |
str
|
The named deployment environment the job runs in,
|
isolated |
str
|
Module path of an isolated Tier 1 entry point (such
as |
dispatches |
bool
|
Whether the job starts another workflow through the
forge's API, which GitHub's workflow token may do only with
the |
inputs |
Inputs | None
|
The files the job's entries read, declared as a step declares its own: a pull request's run that changed none of them skips the entries. None for a job that always runs. |
step |
str
|
What the forge's run page calls the one call; the job's name capitalised when empty. |
note |
str
|
The comment the rendered shell prints above the job. |
joins |
bool
|
Whether the job is a contribution to a job the point already has, declared or inherited. It renders as no job of its own: its entries follow that job's, and its plumbing, what it collects and publishes, the seam it deploys through and the packages it installs, renders on that job under the contributing point's own event condition. |
installs
class-attribute
instance-attribute
¶
Point
dataclass
¶
Point(name: str, workflow: str, events: tuple[str, ...], jobs: tuple[Job, ...] = (), inherits: str = '', inputs: tuple[Input, ...] = (), ref_input: str = '', cron: str = '', note: str = '')
One point: its workflow file, its events, and its jobs.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
The point's name, and the |
workflow |
str
|
The workflow file the point's shell is, as GitHub and Gitea address a dispatch and name a run. Two points may share one, the gate and the merge point do, when their events do not overlap. GitLab has one pipeline document and names a dispatched pipeline after this. |
events |
tuple[str, ...]
|
The events that start the point's runs, from
|
jobs |
tuple[Job, ...]
|
The point's own jobs, in order. |
inherits |
str
|
A point whose jobs this one runs first, the gate's
for the merge point; |
inputs |
tuple[Input, ...]
|
The inputs a dispatch takes. A point with a required
one is dispatched by a verb that supplies it, never by
hand. Every job of a point that takes a |
ref_input |
str
|
The input naming the commit the jobs check out,
|
cron |
str
|
When the clock starts the point, for a point whose
events include |
note |
str
|
The comment the rendered shell prints under its name. |
Contribution
dataclass
¶
JobContribution
dataclass
¶
JobContribution(point: str, job: Job, entries: tuple[Entry, ...] = (), gates: bool = False, extension: str = '')
One job a mounted extension adds to a builtin point, with its entries.
Attributes:
| Name | Type | Description |
|---|---|---|
point |
str
|
The builtin point the job joins. |
job |
Job
|
The job, as the point would declare it. |
entries |
tuple[Entry, ...]
|
The tasks the job runs, each naming the point and the job. |
gates |
bool
|
Whether the point's verdict waits for the job. |
extension |
str
|
The extension that contributed it, for a refusal. |
Entry
dataclass
¶
Entry(point: str, job: str, task: str, args: tuple[str, ...] = (), source: str = 'builtin', every: str = '', if_changed: bool = False, once: bool = False, last: bool = False, judges: bool = False, sharded: bool = False)
One scheduled task: at which point and job, which task, which arguments.
Attributes:
| Name | Type | Description |
|---|---|---|
point |
str
|
One of |
job |
str
|
The job of the point the entry runs in. |
task |
str
|
The task's dotted address, as the workspace mounts it. |
args |
tuple[str, ...]
|
The arguments, each formatted with the run's facts:
|
source |
str
|
Where the entry was declared. |
every |
str
|
The cadence, |
if_changed |
bool
|
Whether the entry runs only when the ref's head has moved since the point last reached a verdict there, green or red; false when absent. A dispatch by hand runs regardless. |
once |
bool
|
Whether the entry runs on a matrix job's first leg alone, the first runner and the first Python, and on that leg's first shard alone; every leg and shard otherwise. |
sharded |
bool
|
Whether the entry takes the leg's shard,
|
last |
bool
|
Whether the entry runs after every entry an extension adds to the job, the janitor's shape; the added entries go before the first such entry. |
judges |
bool
|
Whether the entry judges the run before the verdict: a judge an extension adds to a point's verdict job runs before the job collects the run's rows, and a red one stops the job there, as a red builtin entry does. |
verify_points ¶
Refuse a set of declarations a shell cannot be rendered from.
A point name declared twice, an event outside EVENT_NAMES, a
point inheriting one that is not declared, two points sharing a
workflow file whose events overlap (a run would belong to both),
a job name declared twice in one point, a job needing a job the
point does not have, a job collecting an artifact no job of the
point publishes, and a job collecting an artifact from jobs it
does not wait for each refuse naming the point and the fault. A
job starts once the jobs it needs end, so a job it does not wait
for may not have uploaded the artifact yet. A join waits for what
the job it joins waits for.
Source code in packages/workshop/src/livery/workshop/_points.py
452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 | |
contributed ¶
contributed(root: Path, *, mounted: Callable[[str], bool] | None = None) -> tuple[Contribution, ...]
The [[ci.point]] declarations of root's packages, refusing bad ones.
Each table names a name (the point's, a workflow file name and
a job name at once), a task, and optionally args,
every (a cadence from CADENCES), runners (the root
contract's when absent) and pythons (the newest gate Python
when absent). A name that is a builtin point or that two packages
claim, a name POINT_NAME refuses, a cadence that is not one, a
task mounted does not know (the runner's own registry when
absent), and a permission, secret or environment key each refuse
at load, naming the package and the point.
Source code in packages/workshop/src/livery/workshop/_points.py
592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 | |
point_has_job ¶
Whether the builtin point has the job name, declared, inherited or added.
Source code in packages/workshop/src/livery/workshop/_points.py
verdict_jobs ¶
Each builtin point that declares a verdict job of its own, with the job's name.
A verdict job runs whatever the jobs it needs did; the judges an extension adds join one of these.
Source code in packages/workshop/src/livery/workshop/_points.py
judges_refusal ¶
Why judges may not join job of point; empty when they may.
Judges join a point's own verdict job alone: they run before it collects the run's rows, and a red one stops it before the verdict and the stamp.
Source code in packages/workshop/src/livery/workshop/_points.py
contribute_job ¶
contribute_job(point: str, job: Job, *, entries: tuple[Entry, ...] = (), gates: bool = False, extension: str) -> None
Add job to the builtin point on behalf of extension, or join one.
The job sits before the first job of the point that needs it, else
before the point's verdict job, else last (composed_points), so a
contributed job renders before the jobs that wait for it and where
a declared one would; a gating job joins the verdict's needs. A
job that joins names a job the point already has
(point_has_job): its entries follow that job's own, before any
the job runs last, its plumbing renders on that job, and its needs
join the needs of a job the point has of its own. Refuses a point
that is not builtin, a job name the point already has when the job
does not join, a join of a job the point does not have, a join that
gates, a name another extension contributed, an entry naming
another point or job, and a judge on a job that is not the point's
own verdict job (judges_refusal).
Source code in packages/workshop/src/livery/workshop/_points.py
snapshot ¶
snapshot(*, initial: bool = False) -> tuple[dict[tuple[str, str], JobContribution], dict[tuple[str, str, str], JobContribution], Tasks | None]
The jobs the extensions added and joined, and the kept task tree, for restore.
Judges ride their joins' entries. livery.workshop._points.restore puts all three back. With initial, the state a process starts with instead: no job added or joined, and no task tree kept.
Source code in packages/workshop/src/livery/workshop/_points.py
restore ¶
restore(state: tuple[dict[tuple[str, str], JobContribution], dict[tuple[str, str, str], JobContribution], Tasks | None]) -> None
Put the added jobs, the joins and the kept task tree back to state.
Source code in packages/workshop/src/livery/workshop/_points.py
contributed_jobs ¶
contributed_jobs(point: str) -> tuple[JobContribution, ...]
The jobs the extensions contributed to point, in contribution order.
joined_jobs ¶
joined_jobs(point: str) -> tuple[JobContribution, ...]
The joins the extensions made to point's jobs, in contribution order.
contributor_of ¶
The extension that contributed job to point; the base for its own jobs.
Source code in packages/workshop/src/livery/workshop/_points.py
verdict_needs ¶
What point's verdict waits for: its declared needs, then the gating jobs.
Source code in packages/workshop/src/livery/workshop/_points.py
composed_points ¶
The builtin points with the extensions' contributed jobs in place.
A contributed job sits before the first job of its point that needs
it, else before the point's verdict job, else last: a job renders
before the jobs that wait for it, and where a declared one would.
The verdict waits for what verdict_needs names. A join's needs
join the needs of the job it joins when the point has that job of
its own, declared or contributed; the read of a declaration refuses
needs on a join of a job the point inherits, whose needs are the
point's it inherits from.
Source code in packages/workshop/src/livery/workshop/_points.py
points ¶
Every point root has: the builtin four, then the ones its packages contribute.
None is a process outside any workspace, which has the builtin
four alone, with the jobs the mounted extensions contributed in place.
The whole set is verified as one: a contributed point cannot
share a file or a name with another.
Source code in packages/workshop/src/livery/workshop/_points.py
emitted_points ¶
points, plus a job for each name only the contract's entries give.
A [[ci.schedule]] entry in the root contract may name a job its
point does not declare (jobs_of lists it); the shell needs that
job to call it. The job runs on one runner, the newest gate
Python, with the checkout depth, token and write grant of the
point's first job: the root contract is where a grant is decided,
so this widens nothing a package could reach.
Source code in packages/workshop/src/livery/workshop/_points.py
inherited_jobs ¶
The jobs point runs before its own, from the point it inherits.
Source code in packages/workshop/src/livery/workshop/_points.py
point_by_name ¶
jobs_reading ¶
The jobs whose declared inputs read path, each <point>/<job>.
Source code in packages/workshop/src/livery/workshop/_points.py
unread_by_the_job ¶
The line that skips job of point when nothing it reads changed, or empty.
Only a job that declares inputs skips, and only on a pull
request's run in a workspace declaring [ci] affected-legs, the
terms the check legs narrow on: a push, a dispatch, the clock and a
person's own run always run every entry. The changes are the run's
own (livery.workshop.ci_changes), read the way the check legs
read them, and the inputs select as a step's do, so a change to
the sources of the extension that contributed the job runs it.
Source code in packages/workshop/src/livery/workshop/_points.py
job_installs ¶
job_installs(root: Path, everything: tuple[Point, ...] | None = None) -> dict[tuple[str, str], tuple[str, ...]]
What each job installs before it enters, by its point and its name.
Only a job that names an installs function has an entry. Its
packages are sorted and named once, so the rendered file is the
same on every run. everything is the points to read; root's
when absent.
Source code in packages/workshop/src/livery/workshop/_points.py
job_seams ¶
The seam each deploying job publishes through, by its point and its name.
Only a job that names a deploy function has an entry.
everything is the points to read; root's when absent.
Source code in packages/workshop/src/livery/workshop/_points.py
job_runners ¶
job_runners(root: Path, everything: tuple[Point, ...] | None = None) -> dict[tuple[str, str], tuple[str, ...]]
The runner labels each job's labels function names, by point and job.
Only a job that names a labels function has an entry: the
labels the function names for root, in its order and each once,
so the rendered file is the same on every run. An empty entry is a
runners job this workspace renders no job for. everything is
the points to read; root's when absent.
Source code in packages/workshop/src/livery/workshop/_points.py
events_of ¶
The events that start point's runs; refuses a name that is not a point.
Source code in packages/workshop/src/livery/workshop/_points.py
dispatchable ¶
The points a person starts by hand: a dispatch entry and no input to supply.
An optional input, the nightly's only, leaves a point
dispatchable; a required one, the release's ref, does not.
Source code in packages/workshop/src/livery/workshop/_points.py
profile_box ¶
profile_box() -> AbstractContextManager[Path]
The job's drop box, where every entry leaves its own timeline.
The plugin owns the directory and its sweeping; this names it to the entries through the environment the runner already builds for them, which is why nothing here writes this process's own.
Source code in packages/workshop/src/livery/workshop/_points.py
trace_file ¶
The file an entry's own trace is written to, named after the task.
One file per entry rather than one per job: the leg's timing row reads the gate's own file, and a person reading a runner's working directory can tell which entry a trace belongs to.
Source code in packages/workshop/src/livery/workshop/_points.py
due ¶
Whether a cadence runs on on, and the day it runs next.
A weekly entry runs on Mondays; a two-weekly entry on the Monday of an even ISO week, so every workspace agrees on the day without a record of the last run. An empty cadence is due on every run.
Source code in packages/workshop/src/livery/workshop/_points.py
last_verdict_sha ¶
last_verdict_sha(root: Path, *, point: str, ref: str = '', rows: Sequence[Row] | None = None) -> tuple[str, str, str]
The commit SHA, verdict and run id of point's latest finished row on ref.
A finished row carries verdict in VERDICTS (green or red).
A cancelled or incomplete row has no verdict and is skipped. Returns
("", "", "") when no finished row exists or the store cannot be read.
Source code in packages/workshop/src/livery/workshop/_points.py
entry_due ¶
entry_due(root: Path, entry: Entry, *, point: str, on: date | None = None, run: RunContext | None = None, head_sha: str | None = None, last_verdict: tuple[str, str, str] | None = None) -> tuple[bool, str]
Whether entry is due to run now, and the reason when skipped.
A dispatch by hand (workflow_dispatch) is always due. Otherwise
every checks the day (due) and if_changed checks whether
HEAD has moved since point last reached a verdict (VERDICTS)
on the run's ref.
Source code in packages/workshop/src/livery/workshop/_points.py
due_jobs ¶
due_jobs(root: Path, point: str, *, only: str = '', on: date | None = None, run: RunContext | None = None, output: Path | None = None) -> dict[str, bool]
Which jobs of point have a due task; prints reasons and writes output.
Used by a scheduled workflow's first job (fm ci.due) so a job with
no due task never starts a runner. Every entry other than RECORD_TASK
is judged with entry_due (and --only when given). When output is
given, writes <job>=true or <job>=false lines for GitHub / Gitea
job outputs.
Source code in packages/workshop/src/livery/workshop/_points.py
1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 | |
declared ¶
The [[ci.schedule]] entries of root's contract, refusing bad ones.
Each entry names a point (one of points), a task, and
optionally a job (the point's own name when absent), args
and every, a cadence from CADENCES. An unknown point, a
missing task, arguments that are not strings, or a cadence that
is not one refuse at load, naming the entry.
Source code in packages/workshop/src/livery/workshop/_points.py
builtin_schedule ¶
The builtin entries with the extensions' contributed jobs' entries in place.
A contributed job's entries follow the declared entries of its
point's jobs before the verdict, and the verdict's --needs
names the composed list.
Source code in packages/workshop/src/livery/workshop/_points.py
schedule ¶
Every entry: the builtin ones, the packages' contributed ones, the contract's.
Then the record each job of a point without a verdict job ends
with (recording), after every entry the contract gave the job.
Source code in packages/workshop/src/livery/workshop/_points.py
recording ¶
The record ending every job of each point of root with no verdict job.
A verdict job collects what its point's legs put; a point without
one (the nightly, the release, every point a package contributes)
would leave no row of its run, so each of its jobs ends with
RECORD_TASK, which puts the job's own half, collects the run's
row and drops the per-run refs when it is the run's last green
job. The jobs are the point's declared ones and any a
[[ci.schedule]] entry in scheduled names.
Source code in packages/workshop/src/livery/workshop/_points.py
half_writers ¶
The jobs of point that put a half of the run's row, by their schedule names.
The check legs of a point with a verdict job (ci.leg), and every
job of a point without one (RECORD_TASK). A forge lists a matrix
job's legs under the job's name with the leg in brackets, so a
reader matches by prefix.
Source code in packages/workshop/src/livery/workshop/_points.py
workflow_of ¶
The workflow file point's shell is; refuses a name that is not a point.
Source code in packages/workshop/src/livery/workshop/_points.py
jobs_of ¶
The jobs point has: declared ones, inherited first, then any an entry names.
A [[ci.schedule]] entry may name a job no declaration has; it
is listed after the declared jobs, in schedule order.
Source code in packages/workshop/src/livery/workshop/_points.py
first_leg ¶
The first leg of job at point: its first runner and its first Python.
An axis the job does not have is empty. The check legs fan out
over [ci] runners and the gate's Pythons, the nightly over every
Python on the first runner, a declared job over its own lists. A
runners job's call names no leg and a job with no matrix has
none, so neither has a leg to name.
Source code in packages/workshop/src/livery/workshop/_points.py
entries_for ¶
The entries job of point runs, in order; refuses an unknown job.
A point's own name is always a job of it, with nothing scheduled until an entry attaches: the nightly shell exists before its first entry, and runs green and empty until then.
Source code in packages/workshop/src/livery/workshop/_points.py
scheduled_tasks ¶
Every task point runs, across its jobs, in schedule order, once each.
Source code in packages/workshop/src/livery/workshop/_points.py
asked_tasks ¶
The tasks a dispatch's only names, judged against what point runs.
Empty for an empty only, which runs the whole schedule.
Raises:
| Type | Description |
|---|---|
Failed
|
when only names a task the point does not run, naming the ones it does. |
Source code in packages/workshop/src/livery/workshop/_points.py
pull_request_runners ¶
The runners a pull request's check legs fan out to.
[ci] pull-request-runners when the contract declares it, else
the first runner [ci] runners names (ubuntu-latest without
that key). A one-runner pull request carries the other legs'
coverage rows from main's record, so a package whose floor needs
the platform legs' fresh rows on a pull request lists every runner.
A label the runners list does not name refuses naming both lists,
since a pull request's legs run on runners every event runs on; an
empty list refuses too.
Source code in packages/workshop/src/livery/workshop/_points.py
pull_request_listed ¶
Name the list a pull request's runners come from, for a shard refusal.
[ci] pull-request-runners when the contract declares it. When
the key is absent the refusal names it and the first runner
[ci] runners names, which stands in for it.
Source code in packages/workshop/src/livery/workshop/_points.py
pull_request_legs ¶
Name the check legs a pull request's run produces, check-<os>-<python> each.
One per runner the root contract's [ci] pull-request-runners
names and Python the gate runs; the first runner's legs among those
livery.workshop.check_legs names when the key is absent. The
task fails, naming both lists, when the key names a runner
[ci] runners does not list, and when it is empty.
Source code in packages/workshop/src/livery/workshop/_points.py
check_legs ¶
Name the check legs the gate produces, check-<os>-<python> each.
One per runner the root contract names ([ci] runners,
ubuntu-latest without it) and Python the gate runs: the
contract's [ci] python-versions, or the newest Python of the
derived matrix. Each label is spelled as the job runner names the
leg it runs, the key of the leg's rows on the state store.
Source code in packages/workshop/src/livery/workshop/_points.py
shards_max ¶
The most shards a runner may take: [ci] shards-max, SHARDS_MAX when absent.
A value that is not a whole number, or is below 1, fails naming it.
Source code in packages/workshop/src/livery/workshop/_points.py
shard_counts ¶
shard_counts(ci: dict[str, Any], *, key: str, runners: Sequence[str], listed: str) -> dict[str, int]
The shards per runner [ci] <key> gives, one for a runner it does not name.
runners are the labels the legs fan out to and listed names the
key they came from, for the refusal. The task fails, naming the key
and the runner, when the table names a runner runners does not
hold, gives a count below 1 or above shards_max, or gives one
that is not a whole number.
Source code in packages/workshop/src/livery/workshop/_points.py
check_shards ¶
Name the shard legs the gate produces, split as [ci] shards says.
One leg per runner and Python livery.workshop.check_legs names,
spelled as that leg, check-<os>-<python>, for a count of one,
the count of every runner the table does not name; and
check-<os>-<python>-<i>of<n> for each of the n shards
otherwise, in order. [ci] shards-max caps a count, 4 when
absent. The task fails, naming the key and the runner, when the
table names a runner [ci] runners does not list, gives a count
below 1 or above the cap, or gives one that is not a whole number.
Source code in packages/workshop/src/livery/workshop/_points.py
pull_request_shards ¶
Name the shard legs a pull request's run produces, split as the contract says.
One leg per runner and Python livery.workshop.pull_request_legs
names, split as livery.workshop.check_shards splits the gate's:
by [ci] pull-request-shards, judged against the pull request's
runners, or by [ci] shards when that key is absent. The task
fails as check_shards fails, and as pull_request_legs fails.
Source code in packages/workshop/src/livery/workshop/_points.py
sharded_legs ¶
The platform legs the contract splits into shards, on any event.
Each platform leg once, in matrix order: one [ci] shards or
[ci] pull-request-shards gives above one
(livery.workshop.check_shards,
livery.workshop.pull_request_shards). Empty without a root
contract. The task fails as those fail, naming the key and the
runner.
Source code in packages/workshop/src/livery/workshop/_points.py
effective_point ¶
The point a shell's gate means on a push: the merge point.
The shared jobs spell --point=gate; inside CI, a push event
is the merge point, so the promotion happens here and never in
the YAML. Outside CI, and on every other event, the point stands.
Source code in packages/workshop/src/livery/workshop/_points.py
run_point ¶
run_point(root: Path, point: str, job: str, *, os_label: str = '', python: str = '', shard: str = '', spawn: Callable[[list[str], dict[str, str]], int] = _spawn) -> None
Run every entry of job at point, in order; a red entry fails the job.
A red builtin entry stops the job at once, since the entries after
it read its verdict, and so does a red judge an extension adds to
the verdict job; a red entry of the contract's schedule stands
on its own, so the scheduled entries after it still run, and the
job fails at the end naming each red one. A dispatch that names
tasks in the nightly's only input runs those alone, builtin or
scheduled, and says what it skipped.
os_label and python are the matrix facts the shell passes for
a matrix job; they format the entries' arguments and name the
leg. shard is the leg's shard, 2of4, on a check leg the
contract splits; empty runs as one shard of one. A count above
one ends the label and the display name
(check-windows-latest-3.14-2of4, check (windows-latest,
3.14, 2of4), and on GitLab check: [2of4], as it lists a job
run as parallel: matrix), and an entry declared sharded
takes --shard=2of4; one shard of one leaves the label, the
display name and every call as the unsplit leg's. A spelling outside
<i>of<n> fails naming it, before any entry runs. An entry
with once runs on the first leg's first shard alone, and the
skip line names the shard when the leg is the first. An entry
with a cadence runs only on its day, judged by
today, and says when it runs next otherwise. Every entry runs
under --profile, writing its own trace beside the others, and
the job's box collects them into one timeline, which the runner
pushes where [ci] profile asks; [ci] timing = false does
none of that. Every child's
environment names the leg in
livery.workshop._ci_context.LEG_VARIABLE, the key of the leg's rows
and stamps, and the resolved point in
livery.workshop.POINT_VARIABLE, which selects the tests a point
runs. A job that declares inputs runs no entry on
a pull request that changed nothing it reads (unread_by_the_job).
spawn runs one entry's command in that environment and returns
its exit code; the default is the runner's own child.
Source code in packages/workshop/src/livery/workshop/_points.py
2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 | |