Flake records: webhook-pull ingestion, no CI credential
Status summary: Replaces the just-merged push-lane (CI holds the project API key, POSTs to /flakes via itx) with a pull-lane: CI only uploads a workflow artifact, and the platform ingests it when GitHub's workflow_run: completed webhook arrives. Kills the FLAKE_REPORT_* secrets entirely.
Why#
The push lane made CI hold the project API key — the project's root credential — when all these jobs should be able to affect is what GitHub already lets them affect. The platform already receives signed GitHub webhooks as events.iterate.com/github/webhook-received events on /integrations/github/<connection> streams (verified empirically on prd: workflow_run deliveries are already flowing), and the App's installation token has Actions read (verified: can list workflow runs + artifacts). So the trust statement shrinks to "GitHub said this run produced these records", authenticated entirely platform-side.
Design#
- CI (test.yml): keep
FLAKE_RECORD_DIR; replace the doppler reporter post-step withactions/upload-artifactof the record dir, artifact nameflake-records-<suite>(if-no-files-found: ignore). Deletepackages/iterate/scripts/report-flake-records.ts. - Mapper (flake-dashboard starter app, config-worker side): on
github/webhook-receivedwithdelivery.name === "workflow_run"andaction === "completed", list the run's artifacts; for eachflake-records-*artifact, download the zip (App installation token), unzip (fflate), parse.jsonllines against theFlakeRecordschema (bad lines skipped), and append oneflakes/run-recordedper artifact with idempotency keyflakes/run:<run_id>-<run_attempt>:<suite>— webhook redeliveries and event-delivery retries dedupe. Branch/commit come from the webhook'sworkflow_runpayload; birth certificate offered from the webhook's repository (+ itsdefault_branch). - No changes to the processor, contract events, or dashboard render.
Checklist#
- Mapper in the flake-dashboard app +
fflatebundled into the configured worker - Unit tests: real zip bytes (fflate zipSync) through a fake octokit → appended run-recorded; non-matching webhooks ignored; bad lines skipped; idempotency key shape
- test.yml: upload-artifact step replaces the doppler reporter step; reporter script deleted
- Task/docs updates (
tasks/flake-dashboard.mdops list: FLAKE_REPORT_* secrets no longer needed — unset from_shared/prd)
Post-merge ops#
Superseded by
tasks/flake-checkrun-ingestion.md: the confirmation steps below can never pass — Depot CI jobs are check runs, soworkflow_runwebhooks never fire for the test suites. The check_run + Depot-artifact-pull design replaces this lane's trigger; the CI-side artifact upload steps remain correct.
- Unset
FLAKE_REPORT_*in_shared/prdDoppler (push-lane reporter is gone) — and consider rotating the project API key (a fragment echoed into a local session transcript during setup) - Update the live iterate project's config worker to the new package build (the mount is already live; the mapper rides the same
iterate@mainbump) - Confirm ingestion on a real CI run:
flakes/run-recordedappears after the workflow_run webhook, issue updates