fix(plugin-gha): reset comment per run + tie status emoji to invocation lifecycle#129
Merged
Merged
Conversation
…on lifecycle Two bugs in the GitHub Actions status hook: 1. The sticky per-job comment was reused across workflow runs by its container marker, but the previous build's step sections were never cleared — a new build's first step adopted the old comment and merely upserted, so sections piled up across builds. Embed a hidden run marker (`GITHUB_RUN_ID`+`GITHUB_RUN_ATTEMPT`) in the body; on adopt, reset the sections when the stored run differs from the current one (or is absent, for pre-marker comments). Same-run later steps still preserve siblings; local runs (no run id) keep reusing the comment. 2. The status emoji only flipped to ✅ on `matched_complete && done == total`. Matched transparent groups emit no `ResultEnd`, so `done` never reached `total` and the heading stayed ⏳ forever. The emoji should reflect whether the invocation is running, so drive it off the stream lifecycle: ⏳ until `on_close`, then ✅ (or ❌ if anything failed). Progress counts still drive the targets line. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
raphaelvigee
added a commit
to hephbuild/hephbuild.github.io
that referenced
this pull request
Jun 25, 2026
Two behavioral corrections from hephbuild/heph#129: 1. The heading emoji is now driven by the invocation's stream lifecycle (closed = done), not by "every matched target finished." The old phrasing was wrong for transparent-group targets that never emit ResultEnd — the emoji is now ✅ when the command exits, not when done == total. 2. Each new workflow run (GITHUB_RUN_ID + GITHUB_RUN_ATTEMPT) resets the comment's sections. The previous "reused across reruns, never duplicated" text didn't capture this: stale sections from a prior build are now cleared when the first step of a new run writes.
raphaelvigee
added a commit
to hephbuild/hephbuild.github.io
that referenced
this pull request
Jun 25, 2026
…ent reset (#49) Two behavioral corrections from hephbuild/heph#129: 1. The heading emoji is now driven by the invocation's stream lifecycle (closed = done), not by "every matched target finished." The old phrasing was wrong for transparent-group targets that never emit ResultEnd — the emoji is now ✅ when the command exits, not when done == total. 2. Each new workflow run (GITHUB_RUN_ID + GITHUB_RUN_ATTEMPT) resets the comment's sections. The previous "reused across reruns, never duplicated" text didn't capture this: stale sections from a prior build are now cleared when the first step of a new run writes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Two bugs in the GitHub Actions status hook (
crates/plugin-gha):Sections pile up across builds. The sticky per-job comment is reused across workflow runs (found by its container marker), but the previous build's step sections were never cleared. A new build's first step adopted the old comment and merely upserted its section, so a multi-invocation job stacked the new run's sections on top of the old run's.
Status stuck on ⏳. The heading emoji only flipped to ✅ when
matched_complete && done == total. Matched transparent group targets emit noResultEnd(they return before the memoizer that emits it), sodonenever reachedtotaland the heading stayed on the hourglass even after the invocation finished — no ✅/❌ on exit.Fix
Embed a hidden run marker (
<!-- heph-gha-run:<run_id>-<attempt> -->, fromGITHUB_RUN_ID+GITHUB_RUN_ATTEMPT) in the comment body. On adopt, reset the sections when the stored run differs from the current one — or is absent (pre-marker comments). Same-run later steps still preserve siblings; local runs (no run id) keep reusing the comment as before.Drive the emoji off the stream lifecycle, since it should reflect whether this invocation is running: ⏳ until
on_close, then ✅ (or ❌ if anything failed). Progress counts still drive the targets line.Tests
run_marker_round_trips_and_signals_new_run— marker round-trips; mismatched/missing run id resets stale sections.status_settles_to_success_when_stream_closes— ⏳ while open, ✅ on close, ❌ wins on failure.status_emoji_tracks_invocation_outcome,markdown_reports_counts_slow_and_failures, andassemble_bodycallers for the new semantics.All 11 tests pass; clippy clean.
🤖 Generated with Claude Code