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-review-fix-dispatch-excluded-log.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- The "review fix dispatch excluded" line for PRs the hive did not author (`not-hive-authored`) is now logged at INFO instead of WARN, so the expected policy skip is no longer filed as an `unclassified_error_repeated` fleet issue ([#14870](https://github.com/hivecommons/hive/issues/14870)).
7 changes: 6 additions & 1 deletion src/cmd/hive/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11150,7 +11150,12 @@ func auditWithheldReviewFixes(plan review.DispatchPlan, auditor reviewFixAuditor
// kick: a PR shown as "Fixing" that nobody is fixing must be loud
// (hivecommons/hive#14665).
for _, x := range plan.FixExclusions {
logger.Warn("review fix dispatch excluded",
level := slog.LevelWarn
if x.Reason == review.FixDispatchExcludedNotHiveAuthored || x.Reason == review.FixDispatchExcludedNotHiveAuthoredDCO {
// Policy skip (the hive never pushes to PRs it did not author), not a fault.
level = slog.LevelInfo
}
logger.Log(context.Background(), level, "review fix dispatch excluded",
"repo", x.Repo, "pr", x.Number, "head_sha", x.HeadSHA, "author", x.Author, "reason", x.Reason, "attempts", x.Attempts)
}
for _, w := range plan.WithheldFixes {
Expand Down
13 changes: 13 additions & 0 deletions src/cmd/hive/review_fix_withheld_audit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,16 @@ func TestAuditWithheldReviewFixesRecordsSettingOn(t *testing.T) {
t.Fatalf("audit entry must record the setting as on: %v", auditor.entries)
}
}

func TestAuditWithheldReviewFixesNotHiveAuthoredExclusionIsNotWarn(t *testing.T) {
var buf strings.Builder
logger := slog.New(slog.NewTextHandler(&buf, nil))
plan := review.DispatchPlan{FixExclusions: []review.FixDispatchExclusion{
{Repo: "acme/x", Number: 1, HeadSHA: "abc", Author: "human", Reason: review.FixDispatchExcludedNotHiveAuthored},
}}
auditWithheldReviewFixes(plan, nil, logger)
out := buf.String()
if !strings.Contains(out, "review fix dispatch excluded") || strings.Contains(out, "level=WARN") {
t.Fatalf("not-hive-authored exclusion must log below WARN, got: %s", out)
}
}
Loading