Following a merge into production
A merged pull request used to be where Hephaisto lost an issue: Closes closes it, and nothing showed whether the build ran, the image was promoted, the pods run it, or the change works. With github.deployments on (#322), Hephaisto follows the commit from the CI to the running pods and then has the coding agent on the developer machine check the new version.
A merge is not done (v0.16.0-rc8). An agent's pull request says Part of owner/repo#n, so the issue stays open through the rollout. Meanwhile its merge is no merged, still open decision on the planner, and the agent that made the change keeps its session (closing or moving the issue to Done archives it only after the checks). When the settled check passed - it said works and took not verified off - the today page shows ready to close, and a person's mark done closes the issue with Status Done. Hephaisto does not close it itself.
Only deployed services. A repository is followed when it is named in services or its image (image) has a container anywhere the metrics see; asked once an hour. Another repository's CI events - dev-context, a docs repository - are answered and dropped. A build said again for a commit already followed adds nothing.
CI build -> POST /webhooks/deployments {stage: build}
promote -> POST /webhooks/deployments {stage: promoted | failed}
Hephaisto commit -> merged pull request -> the board issue it is for -> a line on its activity comment
kube_pod_container_info: every running container of the image on the commit -> rolled out
+ startupAfter: startup check, as a message for the coding agent on the issue
+ the service's settleFor: settled check; the issue carries `not verified` until it worksWhat the CI sends
POST /webhooks/deployments on the webhook port, with the webhook token (secrets.webhookToken, the one Alertmanager sends). Any CI can call it:
{"repository": "TrueRelevance/CaitCsvExporter", "sha": "f32dc1d…", "stage": "build",
"url": "https://argo…/workflows/argo/ci-…", "at": "2026-12-02T09:29:00Z"}stage is build (started), failed (with step, where) or promoted (with deployCommit, the deploy repository's commit). It answers 202 at once and reads nothing while the request is open: a CI step never waits on GitHub or the metrics, and a call that fails must not fail the build.
What Hephaisto does with it
Finds the issue. GitHub's
commits/{sha}/pullsnames the merged pull request; the issue is the board issue that lists it, or that its description names with a closing keyword orPart of.Writes every stage on the issue's activity comment - CI builds, failed, promoted, rolled out, each check asked - under the name Hephaisto deployments.
Sees the rollout in the metrics, in every cluster the Prometheus datasource holds: the running containers of the image (
image,{repo}is the repository's name in lower case) on the commit's tag against all of them. Rolled out is all of them. Apromotedthat never came does not leave a commit stuck: afterpromotedWithinthe metrics are read anyway; aftergiveUpAfterthe issue says it was not rolled out and the commit is no longer followed.Asks for two checks, as messages for the coding agent on the issue - the runner hands each to the issue's session, or starts one with it; the merge usually closed the issue, and it stays the agent's work for a day after the last check:
- the startup check,
startupAfterafter the rollout: restarts, CrashLoopBackOff, OOMKilled, readiness, errors in the first minutes of logs, the first unit of work done; - the settled check, the service's
settleForafter the rollout: its metrics against the time before, what the change should move, errors, memory and disk, alerts since the rollout.
Both are read only - Grafana metrics, Loki, traces; never kubectl or a write in production - and start from the service's dashboard (
dashboard;{service}is the repository's name withoutCaitin kebab case:tr-svc-csv-exporter), running its panels' queries before and after the rollout. Each leaves a comment on the issue that begins works, looks wrong or too early to tell, with the queries and numbers; looks wrong is a bug on the board. The startup check putsverifyLabel(not verified) on the issue; the settled check takes it off when the change works.- the startup check,
The agents & PRs page (/agents) lists every commit followed, and the issue's card in the planner shows its own. Each shows its timeline in one line (v0.16.0-rc9), in the browser's time zone:
CI 13:43 → promoted 13:44 → rolled out 13:50 → startup check asked 13:55, answered 14:04 "works" → settled check due 14:35 (in 11 min)A step shows once it happened. The next check is due the rollout plus startupAfter, or plus the service's settleFor; it reads overdue when that time passed by more than one pass of the tracker (checkEvery plus a minute) and it was not asked - nobody took the message, or the tracker is not running. A failed CI ends the line with its step; a restore that found no Cait of the version asked for reads Cait 53.14.0 not published at build time - when the CI's step text names it. get_planner_issue answers the same timeline and nextCheck with its due time.
Configuration
webhookPort: 8081
networkPolicy:
webhookFromNamespaces: [argo] # the CI's namespace, to the webhook port only
github:
deployments:
enabled: true
image: "{repo}"
dashboard: "tr-svc-{service}"
startupAfter: "00:05:00"
settleFor: "00:20:00" # a request service; exporters set their own below
verifyLabel: not verified
services:
- repository: TrueRelevance/CaitCsvExporter
settleFor: "00:45:00" # one prex upload cycle
checks:
- the prex upload after the rollout finished, with a row count near the one before
- repository: TrueRelevance/CaitWebsite3
dashboard: tr-svc-website-3It needs the planner (the issue is found on its board); the checks need coding agents. What it follows is kept in Postgres (followed_deployments, v0.16.0-rc9): a restart - Hephaisto's own rollout - takes every commit back where it was, its checks asked or not, and asks a check whose time passed meanwhile on its first pass. A finished commit's row goes after a week.
What it does not do (yet)
- No incident is opened when a check looks wrong: a bug on the board, and the comment's first line says when production is hurt now.
- The checks run on the developer machine, as coding-agent sessions, not as a read-only Job in the cluster.
- The EU cluster's Kubernetes watcher is not used for the rollout: the metrics cover every cluster alike.
cait_build_info{commit}is named to the checks, not used for the rollout. - No merged pull request without a CI event is followed: the CI's first event starts it.