Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/fixed-ci-reporting-reconciliation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Detect verified current-head GitHub Actions workflow/check reporting stalls after bounded consistency observations, expose exact run/attempt provenance and owner action without changing CI gates or automatically rerunning workflows.
36 changes: 36 additions & 0 deletions src/docs/hive-merge.md
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,42 @@ cannot stop external writers and does not relax strict current-base checks.
Deploying the changed hive binary activates the policy; no agent, memory,
review, CI, hold or authorization setting needs changing.

### CI reporting reconciliation

An unfinished required check is not green merely because its Actions workflow
ended. PR CI evaluation now reports `ci-reporting-stalled` only after two fresh,
consistent observations separated by a propagation grace. It verifies the exact
current PR head, Actions App/check/suite provenance, owning workflow execution,
latest attempt's job-to-check URL, and a final head/base/attempt consistency read.
A newer execution, changed head, unsupported provider or unavailable API cannot
be used to declare a stall. Ordinary queued/running workflows remain ordinary
pending CI, regardless of elapsed time. Workflow success does not fabricate a
successful check; workflow failure and pending job/check reporting remain
separately visible.

The structured `CIReportingObservation` and existing reason tooltip identify
the check, run, latest attempt, job, conclusion and observation time. API refusal
is `ci-reporting-unverified`, not green. The stage remains CI-pending-compatible,
and all current-head review, authorization, hold and merge gates remain intact.
Commit-only/base observations retain their existing behavior. No rendering API
polling is added: evaluation uses an identity/PR/head/check-set-scoped, bounded
single-flight cache. `HIVE_CI_REPORTING_RECHECK` and `HIVE_CI_REPORTING_GRACE`
default to five minutes; verified check/workflow events request a refresh bounded
to once per minute. Duplicate deliveries cannot shorten grace; cold restart
requires fresh consistency observations again.

**Automatic recovery is not implemented or enabled.** A confirmed stall exposes
owner action: inspect the exact workflow's current attempt and logs before one
affected-workflow rerun. Do not rerun all CI or rebase to hide reporting failure.
The existing filesystem mutation ledger only serializes users sharing that
filesystem; shared-CI post-effect comment markers are not atomic cross-hive
claims. Future recovery must prove a pre-mutation episode claim and enforced
designated executor (other hives observe only), with durable ambiguous intent
blocking blind retries. Actions rerun RPCs accept no fencing/idempotency token:
designated routing or a forge CAS alone is not failover fencing or exactly-once
execution, and ambiguous intent must not be automatically stolen after a TTL.
App permission changes, live configuration and experimental integration
activation are not prerequisites for detection and are not made by this change.
### Merge train: ready PRs lead

Every lane groups its candidates on one base whose changed files overlap
Expand Down
4 changes: 3 additions & 1 deletion src/pkg/cistatus/cistatus.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ import "strings"
// ReasonIsPending reports whether a commit-CI skip reason means the checks
// are still running or not yet reported, as opposed to failing.
func ReasonIsPending(reason string) bool {
return strings.HasSuffix(reason, "-pending") ||
return strings.HasPrefix(reason, "ci-reporting-stalled:") ||
strings.HasPrefix(reason, "ci-reporting-unverified:") ||
strings.HasSuffix(reason, "-pending") ||
strings.HasPrefix(reason, "pending: ") ||
strings.HasPrefix(reason, "required-check-missing:")
}
6 changes: 6 additions & 0 deletions src/pkg/dashboard/stage_tracker_caption.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,12 @@ func humanizeStageReason(reason string) string {
if r == "" {
return ""
}
if rest, ok := strings.CutPrefix(r, "ci-reporting-stalled:"); ok {
return "CI reporting stalled — " + rest
}
if rest, ok := strings.CutPrefix(r, "ci-reporting-unverified:"); ok {
return "CI reporting unverified — " + rest
}
if base, approver := stagelabels.HumanApprovedReason(r); approver != "" {
clause := humanizeStageReason(base)
if clause == "" {
Expand Down
17 changes: 17 additions & 0 deletions src/pkg/dashboard/stage_tracker_ci_reporting_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package dashboard

import (
"strings"
"testing"
)

func TestCIReportingUsesExistingReasonWithoutPromotingStage(t *testing.T) {
for _, prefix := range []string{"stalled", "unverified"} {
reason := "ci-reporting-" + prefix + ":check=\"build-and-test\" run=21 attempt=2 owner-action-required"
got := humanizeStageReason(reason)
if !strings.HasPrefix(got, "CI reporting "+prefix+" — ") ||
!strings.Contains(got, "run=21 attempt=2") || !strings.Contains(got, "owner-action-required") {
t.Fatalf("reporting provenance disappeared from existing tooltip reason: %s", got)
}
}
}
5 changes: 5 additions & 0 deletions src/pkg/github/automerge/automerge_sweep_queued.go
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ func (c *Engine) commitGreenForPRSkipping(ctx context.Context, owner, repo, bran
c.warnRequiredChecksFallback(owner, repo, branch)
}
st, err := hgithub.EvaluateCommitCI(ctx, c.gh, owner, repo, sha, hgithub.CommitCIOptions{
PRNumber: prNumber,
Required: required,
RequiredKnown: requiredKnown,
RequiredKnownFromConfig: fromConfig,
Expand All @@ -364,6 +365,10 @@ func (c *Engine) commitGreenForPRSkipping(ctx context.Context, owner, repo, bran
if err != nil {
return false, st.Reason, err
}
if len(st.Reporting) > 0 {
c.info("automerge CI reporting observation", "repo", owner+"/"+repo, "pr", prNumber,
"head", sha, "observations", st.Reporting)
}
if prNumber > 0 && len(st.IgnoredMetaContexts) > 0 {
c.info("automerge ignoring meta contexts on unprotected base", "pr", prNumber, "contexts", st.IgnoredMetaContexts)
}
Expand Down
Loading
Loading