Skip to content

πŸ› Activity Monitor: author's force-push after a 071 ask reads pushed, not "no response" - #16022

Merged
clubanderson merged 2 commits into
v5from
fix/rework-push-response
Oct 31, 2026
Merged

clubanderson merged 2 commits into
v5from
fix/rework-push-response

Conversation

@clubanderson

Copy link
Copy Markdown
Member

Closes #16021

Root cause

  1. Every 071 entry wipes the push memory: notePushStageChange clears last_push_at/last_push_sha and restarts waiting_push_since; noteTrustedHuman071 β†’ MarkNudged(newHead) resets nudge_head/first_nudge_at.
  2. On ✨ Show online ClankeR IDs on the Contributors count pillΒ #15849 each pushed head bounced 071 β†’ 050 (required-check-pending) β†’ 071 (optional-check-failing:server-tests) within 12 s, so the record then said: ask issued just now for the current head, no push since. stageTrackerReworkFor only reports pushed when it.Head != rec.NudgeHead, which is never true after the re-ask.
  3. Nothing survived the bounce to say the author had already answered, so the chip fell back to requested Β· no response and the row kept the "Needs @author" decision / needs-human even while a push was pending CI.

Fix

  • stagelabels.Record gains rework_asked_at / rework_pushed_head / rework_pushed_at: opened on 071/072 entry, booked from the webhook push (notePushStageChange), the enumerate head change at 071 (NoteActivity) and a nudge for a different head (MarkNudged); cleared when the pushed head settles in the CI / Review column without a re-ask, or when the item leaves the column.
  • stageTrackerReworkFor: a remembered push on the current head reads pushed / evidence commit, since = push instant (the webhook-booked instant now also dates the existing head-moved branch), requested_at anchored to the original ask β€” unless the re-ask is a review verdict on that head (the re-review happened; a fresh requested is right). Commit dates are never consulted, so a rebase + force-push with old author dates behaves the same.
  • A row whose push field is pushed (new head not yet evaluated) returns no "Needs @author" decision and does not count as needs-human. A red new head keeps the ask; the chip still says pushed.

Tests

  • TestStoreReworkPushSurvivesReAsk (store, end-to-end bounce incl. enumerate-seen second push, settle, fresh ask, leaving the column).
  • TestStageTrackerReworkFor: re-asked on pushed head β†’ pushed from original ask; review verdict β†’ requested; other-head memory ignored; webhook-booked push dates the state.
  • TestDecisionNeededDropsWaitingOnAuthorAfterPush, TestStageTrackerNeedsHuman pushed cases.

No JS change (STAGE_TRACKER_REWORK_WORDS already carries the pushed wording).

… response

The stage record keeps the original ask and the head pushed after it
across the re-ask the sweep issues when the new head is red again, the
rework chip derives pushed from it (requested_at on the original ask), and
a row whose push field says pushed drops the Needs @author decision and
the needs-human count until CI / the re-review settle.

Fixes #16021

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 31, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign nicholasjackson for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 31, 2026
@github-actions

github-actions Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v5

Conflicts are checked with every PR merged onto the current tip of v5, so a PR that only needs a rebase is not reported as conflicting with its siblings.

PR Title Relation Files
#16011 πŸ› fix: explain human requirements and optional tracker actions CONFLICT src/pkg/dashboard/stage_tracker_build.go
src/pkg/dashboard/stage_tracker_push.go
src/pkg/dashboard/stage_tracker_rework.go
#16024 ✨ feature(spoke): publish bounded activity digest from heartbeat same files src/pkg/dashboard/stage_tracker_build.go

@github-actions github-actions Bot added the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Oct 31, 2026
@hivecommons-hive

hivecommons-hive Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Hive status β€” updated in place; edits do not notify. Full history is in the Activity Monitor.

@clubanderson this PR is held at stage/071-needs-author and the hive will not merge it yet.

Failing checks:

  • test (dashboard 4/4)
  • test (dashboard shuffle 3/3)

Next: the hive does not push to your branch. Push a new head (or reply here); CI and the review swarm re-run automatically and the PR returns to the normal path.

Review findings from reviewer-2 (folded here because this head already carries its hive review):

Read the diff against the tree at pr16022 (store, sweep and dashboard sides) β€” looks correct to me; no blocking findings.

What I verified:

  • Sweep ordering: automerge_stage_labels.go:1142 calls store.Observe (β†’ notePushStageChange) before NoteActivity at :1162, so the new clearRework at store.go:856-859 only fires once the record is already at the settled stage with WaitingOnHive=false. A 071 β†’ 050 (required-check-pending, WaitingOnHive=true via :709/:1155-1160) β†’ 071 bounce therefore keeps ReworkAskedAt/ReworkPushedHead, which is exactly what TestStoreReworkPushSurvivesReAsk exercises.
  • Dashboard: it.Push is populated at stage_tracker_build.go:207, before stageTrackerDecisionNeededWith (:356, :443) and stageTrackerNeedsHuman (:588) read stageTrackerPushPending (stage_tracker_push.go:184), so the "no Needs @author while pushed" gate sees a filled field.
  • stageTrackerReworkPushed (stage_tracker_rework.go:209) still honours the pre-existing it.Head != rec.NudgeHead branch first, so the pre-πŸ› Activity Monitor: author's force-push after a 071 ask still reads "no response" / Needs @authorΒ #16021 "pushed" path is unchanged; the new memory path is only consulted after the re-ask.
  • Leaving the column (store.go:904) clears all three fields, so stale ask memory cannot leak into a later unrelated 071 entry β€” covered by the tail of the store test.
  • PR body matches the diff; go build ./pkg/stagelabels/ ./pkg/dashboard/ is clean (go test is disabled on agent hosts, so I am reading CI for the suite).

One low-severity note, not a blocker: MarkNudged (store.go:1299) books the nudge instant now as the push time when the nudge moves to a new head. In the bounce flow this is harmless because notePushStageChange (store.go:889-895) has already booked the webhook's LastPushAt and noteReworkPush keeps the first instant for the same head. But if the sweep ever re-nudges for the new head without a stage change (071 β†’ 071 with only the reason changing), LastPushSha is still set and MarkNudged reaches noteReworkPush first, so rework.since would read as the nudge time rather than the push time. If that path is reachable, using r.LastPushAt when strings.EqualFold(r.LastPushSha, head) would keep the chip dated from the push. Open question, not a defect I could reproduce from the tree.

Signed-off-by: Andrew Anderson <andy@clubanderson.com>

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correctness review (read at head cd19223, the PR moved past 716748a). The store memory survives the 071 β†’ 050 β†’ 071 bounce as described, and stageTrackerPushPending only fires in the pre-sweep window, so the red-head re-ask keeps the decision per #16021. One edge case in the new store logic worth closing while you're here:

rework_asked_at is never reset by a review-verdict re-ask, so the next exchange anchors to a stale ask (src/pkg/stagelabels/store.go:887-905, NoteActivity store.go:855-859)

The clear path in NoteActivity requires !a.WaitingOnHive, but at 050 with no verdict yet stageActivity sets WaitingOnHive = true (src/pkg/github/automerge/automerge_stage_labels.go:709-711, the stage == ReviewPending && … !VerdictKnown arm). So after the author's push settles green and sits at review-gate:awaiting-review-approval, the memory is kept; when the reviewer then returns reviewer-verdict:changes_requested, Observe(071) runs notePushStageChange with ReworkAskedAt already set and only tops up noteReworkPush β€” the epoch stays at the original CI ask. The dashboard handles that 071 correctly (stageTrackerReworkAnswered, stage_tracker_rework.go:220-222 β†’ fresh requested), but the author's next push β†’ 050 β†’ red 071 reads pushed with requested_at = the first-ever CI ask, not the changes-requested ask. TestStoreReworkPushSurvivesReAsk only covers the settle via WaitingOnHive=false, which production does not emit for an unreviewed 050.

Suggested store-side reset (reason is already on the record when notePushStageChange runs, store.go:692-701):

 func (r *Record) notePushStageChange(now time.Time) {
 	switch {
 	case r.Stage.WaitsOnPush():
-		if r.ReworkAskedAt.IsZero() {
+		if r.ReworkAskedAt.IsZero() || r.reworkReAskIsVerdict() {
+			// First ask, or a reviewer looked at the head the author
+			// pushed and asked again: a new exchange starts here.
+			r.clearRework()
 			r.ReworkAskedAt = now
 		} else if r.LastPushSha != "" && !r.LastPushAt.Before(r.ReworkAskedAt) {
// reworkReAskIsVerdict reports a 071 entry whose reason is a review verdict
// on the head the author pushed for the standing ask.
func (r Record) reworkReAskIsVerdict() bool {
	return r.ReworkPushedHead != "" && strings.EqualFold(r.ActivityHead, r.ReworkPushedHead) &&
		strings.HasPrefix(r.Reason, "reviewer-verdict:")
}

Plus a store test: push β†’ 050 (WaitingOnHive: true, awaiting review) β†’ 071 LaneReasonChangesRequested β†’ assert ReworkAskedAt == now and ReworkPushedHead == "".

Not blocking: the issue's reported symptom is fixed; this only mis-dates requested_at in a multi-round exchange.

β€” hive: agent=adjudicator backend=copilot model=claude-fable-5.1 copilot=1.0.88

@github-actions github-actions Bot added conflicts-with-open-pr Open PR has a merge conflict with another open PR and removed conflicts-with-open-pr Open PR has a merge conflict with another open PR labels Oct 31, 2026
@clubanderson
clubanderson merged commit 2d07449 into v5 Oct 31, 2026
75 of 76 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the fix/rework-push-response branch October 31, 2026 11:57
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

We'd love to hear how your experience was: share feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conflicts-with-open-pr Open PR has a merge conflict with another open PR dco-signoff: yes Indicates the PR's author has signed the DCO. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

πŸ› Activity Monitor: author's force-push after a 071 ask still reads "no response" / Needs @author

1 participant