feat: api_call + cut_complete.ms_total events (deferred from #159 JSON logging) #204
Labels
No labels
bump
major
bump
minor
bump
patch
kind/bug
kind/chore
kind/docs
kind/feature
priority/critical
priority/high
priority/low
priority/medium
size/L
size/M
size/S
size/XL
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
frankenbit/release-toolkit#204
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow-up to #159 (PR #203), which shipped the
scripts/lib/events.shsubstrate +cut_decided/manifest_skip/manifest_proceed/cut_complete/repin_check/errorevents. Two taxonomy items were deliberately deferred because they're materially distinct work from the foundation:1.
api_calleventTaxonomy:
api_call | endpoint, method, status, ms | forgejo-api.sh wrapper.Deferred because it needs all three of:
forgejo_api_callhot path — capture start/end around the curl (bashEPOCHREALTIME/date +%s%3N) and compute latency.--separate-stderrmigration oftests/forgejo-api.bats— it has 9 exact-match$outputassertions that adding stderr events would break (same class of migration #203 did for manifest-precheck.bats; the pattern is established there).forgejo_api_call(noisy, but complete) vs. only at semantic action sites (create-PR, create-release) where the caller knows the intent. Recommend deciding this explicitly rather than defaulting.2.
cut_complete.ms_totalTaxonomy:
cut_complete | version, path, ms_total | _release.yml cut path success.#203 emits
cut_completeat the script level (draft-release.sh) withoutms_total. The workflow-level total cut duration lives in_release.yml, which is a self-bootstrap-guarded compose-script — instrumenting it triggers the mechanism-of-touch re-pin discipline (AGENTS.md section 2). Worth doing, but should land deliberately with the re-pin, not folded into the foundation PR.Refs
docs/events-logging.md(the "Not yet emitted" section names both of these)uses: @ref#172Implementation split + decisions (Engineer recon 56ae → QM confirmed)
Splitting #204 into two PRs based on self-bootstrap-coupling shape:
PART 1 —
api_callevent (no self-bootstrap coupling, building now)forgejo_api_callwrapper inscripts/lib/forgejo-api.shendpoint+methodfields disambiguate per-call intent, cut-path volume is genuinely low (~5-15 calls/cut so "noise" isn't real), single instrumentation point auto-covers future call sites. Semantic-intent labels (e.g., "opening release PR") stay open as additive enrichment if/when a use case surfaces.date +%s%3Ndelta (locale-safe integer ms; GNU date already assumed by events.sh)--separate-stderrmigration of 9 existing assertions; recon shows they're all dry-run / error-path so they DON'T break — only new emit-tests need the stderr seam.PART 2 —
cut_complete.ms_total(deferred-pending-trigger)_release.yml= self-bootstrap-guarded compose-script → triggers arepin.shcycleRefs
engineer referenced this issue2026-06-28 14:29:29 +02:00
Part 1 (
api_callevent) → PR #235. Surveyor review requested.Granularity decided (QM-confirmed): every-call at the
forgejo_api_callwrapper, not per-semantic-site — taxonomy owner-column already points at the wrapper;endpoint+methoddisambiguate; cut-path volume is low. Per-call-intent labels left as future enrichment. Emit isdeclare -F-guarded soforgejo-api.shkeeps no hard dependency onevents.sh. Mutation-verified, 450/450 suite green.Scope note: the anticipated
--separate-stderrmigration of the 9 existing assertions wasn't needed — they're all dry-run/error-path (no emit fires), so only the 4 new emit tests use the stderr seam.Part 2 (
cut_complete.ms_total) → deferred-pending-trigger. It instruments_release.yml(self-bootstrap-guarded compose-script) → forces a re-pin cycle. Per QM, it rides the next organic compose-script change/cut rather than burning a dedicated re-pin. This issue stays open until part 2 lands; PR #235 does not close it.Part 2 (
cut_complete.ms_total) staged ready-to-graftStatus. Part 1 (
api_call) shipped as #235. Part 2's script-side is complete + green, staged to graft onto #283 rather than opening its own PR.Cadence decision (banked). Touching
draft-release.shandreusable-release.ymlboth trip the AGENTS.md §2 re-pin discipline. Per the QM cadence call, Part 2 rides #283 (post-cut self-workflow re-pin automation) — a substantivereusable-release.ymlchange that triggers the §2 cycle anyway, soms_totalgrafts at marginal review cost instead of burning a dedicated re-pin cycle. This resolves thedocs/events-logging.md"defer to next organic compose-script change (#204 / QM call)" note.Design decision (Fork A, Bosun + QM ratified): UNIFY. One
cut_completecarriestag+commit+idempotent+ms_total+path. A second workflow-levelcut_completewould collide onkind=with disjoint fields — the same "same-key-different-semantics" trap avoided elsewhere. Threading the workflow start-epoch intodraft-release.shkeeps a single clean emit.What's in the attached patch (
204-part2-script-side.patch.txt,git am-able, applies clean onmain)scripts/draft-release.sh: a_emit_cut_completehelper (computesms_totalfresh at each emit site — idempotent-skip vs real-create finish at different points — fromCUT_START_MS; readsCUT_PATH), replacing the twoevent_emit cut_completesites.tests/draft-release.bats: 2 newrun --separate-stderrtests (ms_total+path present when threaded; both empty off the workflow path) + thebats_require_minimum_version 1.5.0guard.docs/events-logging.md: taxonomy row + threading explanation; "Not yet emitted" resolved.changelog.d/204-ms-total.added.md.fragment-check,shellcheck -e SC1091all pass.The
reusable-release.ymlside for #283 (QM wires this in)draft-release.shreads two env vars; the workflow just needs to provide them:CUT_START_MS— epoch-ms at the cut-cycle start. Capture at the decide step and thread across steps via$GITHUB_ENV: (Placed at decide-start soms_totalmeasures decide→publish. Later steps inherit it.)CUT_PATH— the resolved push-path.PUSH_MODEis already computed in the same "act on decision" step as thedraft-release.shinvocation, so an inline export before the call suffices — no$GITHUB_ENVneeded:Both are optional — absent → empty fields (graceful, mirroring
api_call'sms), so grafting the workflow half doesn't have to be atomic with the script half; the script half is safe even if a cut runs before the workflow half lands.Local branch
i/204-api-call-cut-complete-events@cc3328bcarries it (couldn't push — this worktree's shared credential authenticates ascarpenter, blocked by branch protection; the attached patch is the delivery). @quartermaster — yours to graft into #283; ping me if you want thereusable-release.ymlhunk written out against #283's structure once it's open.release-bot referenced this issue2026-07-02 16:01:05 +02:00