Files

75 lines
3.7 KiB
YAML

# ~7-line canonical caller — all real config lives in /hanzo.yml.
#
# This repo declared a gate and had nowhere to run it. `.github/workflows/cicd.yml`
# imports the same pipeline, but its default label `hanzo-build-linux-amd64` is
# served on github.com by nothing: the ARC pool that last ran it there
# (hanzo-build-linux-amd64-lfpvh-runner-vt7lh, hanzoai/finance, 133s) was retired,
# and every caller since has queued for 86402s — 24h exactly, GitHub's queue
# timeout — and reported "cancelled". A gate that cannot be scheduled is not a
# gate, and a red X that says "cancelled" reads like an infrastructure hiccup
# rather than what it is: the suite never ran, and has not run for weeks.
#
# The pool that DOES serve that label is the git-runner fleet on git.hanzo.ai
# (universe:infra/k8s/git-runner/statefulset.yaml), which is reachable only from
# this plane — the same plane sync-from-github.yml already mirrors every GitHub
# commit onto within ten minutes. So the gate belongs here, beside the publish
# it guards, and this file is the ~7 lines that ask for it.
name: CI/CD
on:
push:
branches: [main]
tags: ['v*']
pull_request:
# THE RELEASE POKES THE PROJECTION, and workflow_dispatch is how, because it
# is the dispatch verb Hanzo Git HAS. Two shapes were tried and neither could
# work: cloud posted `repository_dispatch: spec-update` at api.github.com,
# where these callers ask for a label github.com has no runner for, so twelve
# accepted events ran nothing; then this file grew a nightly `schedule:`,
# which does move the projection but decides WHEN by a clock rather than by a
# release, so a client is a day stale on average and nothing anywhere records
# which release it is a projection of.
#
# Measured instead of assumed: POST /v1/repos/<o>/<r>/actions/workflows/
# cicd.yml/dispatches on git.hanzo.ai answers 204, a git-runner picks the run
# up in seconds, and it reaches its first step. So the release dispatches this
# directly, on the side that has the runners.
#
# A DISPATCH THAT NAMES NO DOCUMENT MOVES NOTHING, and for months this file
# claimed otherwise — that the lane's no-payload path took cloud's newest tag.
# ci v1.0.54 removed exactly that ("AND IT NO LONGER GOES LOOKING"), so a bare
# poke re-read the LOCKED ref, asserted its digest and exited before any write.
# Every release could poke this forever and the projection would never move;
# measured, it sat 254 commits behind while PyPI matched its newest tag, because
# publishing was never the broken half.
#
# So the ref travels WITH the poke. ci v1.0.75 takes it as an input, which is
# the same fact `repository_dispatch` carried as `client_payload.sha` — a verb
# Hanzo Git does not serve. Omitted, both inputs are empty and this behaves
# exactly as before: a check that writes nothing.
workflow_dispatch:
inputs:
spec-ref:
description: "cloud commit to move .spec-lock to. Empty = check the locked ref, write nothing."
required: false
default: ''
spec-version:
description: "Version to cut this projection at. Empty = derive the next patch."
required: false
default: ''
spec-sha256:
description: "Expected sha256 of openapi.yaml at that ref. Empty = do not verify."
required: false
default: ''
jobs:
cicd:
uses: hanzoai/ci/.github/workflows/build.yml@v2
permissions:
contents: write
packages: write
id-token: write
with:
spec-ref: ${{ github.event.inputs.spec-ref || '' }}
spec-version: ${{ github.event.inputs.spec-version || '' }}
spec-sha256: ${{ github.event.inputs.spec-sha256 || '' }}
secrets: inherit