Skip to content

fix(plugin-gha): reset comment per run + tie status emoji to invocation lifecycle#129

Merged
raphaelvigee merged 1 commit into
masterfrom
fix/gha-comment-reset-status
Jun 25, 2026
Merged

fix(plugin-gha): reset comment per run + tie status emoji to invocation lifecycle#129
raphaelvigee merged 1 commit into
masterfrom
fix/gha-comment-reset-status

Conversation

@raphaelvigee

Copy link
Copy Markdown
Member

Problem

Two bugs in the GitHub Actions status hook (crates/plugin-gha):

  1. 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.

  2. Status stuck on ⏳. The heading emoji only flipped to ✅ when matched_complete && done == total. Matched transparent group targets emit no ResultEnd (they return before the memoizer that emits it), so done never reached total and the heading stayed on the hourglass even after the invocation finished — no ✅/❌ on exit.

Fix

  1. Embed a hidden run marker (<!-- heph-gha-run:<run_id>-<attempt> -->, from GITHUB_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.

  2. 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

  • New run_marker_round_trips_and_signals_new_run — marker round-trips; mismatched/missing run id resets stale sections.
  • New status_settles_to_success_when_stream_closes — ⏳ while open, ✅ on close, ❌ wins on failure.
  • Updated status_emoji_tracks_invocation_outcome, markdown_reports_counts_slow_and_failures, and assemble_body callers for the new semantics.

All 11 tests pass; clippy clean.

🤖 Generated with Claude Code

…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 raphaelvigee merged commit 7392b57 into master Jun 25, 2026
12 checks passed
@raphaelvigee raphaelvigee deleted the fix/gha-comment-reset-status branch June 25, 2026 08:49
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant