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-15369-gateway-message.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Avoid reporting transient GitHub gateway failures embedded in log messages as repeated runtime errors.
5 changes: 3 additions & 2 deletions src/pkg/fleetreport/fleetreport.go
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,8 @@ func IsGitHubUpstreamUnavailable(s string) bool {
// IsBenignMessage reports whether a raw log message is noise the generic
// repeated-error feed must not report: the read/keepalive i/o timeout rule
// above applied to the whole line, GitHub rate-limit and pacing refusals
// (IsGitHubRateLimited), every benignSubstrings entry, and the
// (IsGitHubRateLimited), gateway failures (IsGitHubUpstreamUnavailable),
// every benignSubstrings entry, and the
// exact-message exclusions matched in the function body below.
func IsBenignMessage(msg string) bool {
m := strings.ToLower(msg)
Expand Down Expand Up @@ -886,7 +887,7 @@ func IsBenignMessage(msg string) bool {
"[contribute-ws] refusing task: daily rate limit reached":
return true
}
if benignIOTimeout(m, m) || IsGitHubRateLimited(m) {
if benignIOTimeout(m, m) || IsGitHubRateLimited(m) || IsGitHubUpstreamUnavailable(m) {
return true
}
for _, s := range benignSubstrings {
Expand Down
7 changes: 6 additions & 1 deletion src/pkg/fleetreport/slogfeed/slogfeed_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,9 @@ func TestGitHubUpstreamUnavailableLogsWithoutFleetReport(t *testing.T) {
msg string
args []any
}{
{"fetch failed: GET https://api.github.com/repos/o/r/pulls/1336: 503 []", nil},
{"fetch failed: GET https://api.github.com/repos/o/r: 502 Bad Gateway []", nil},
{"fetch failed: GET https://api.github.com/repos/o/r: 504 Gateway Timeout []", nil},
{"self-authored automerge sweep skipped PR", []any{"repo", "kubestellar-mcp", "pr", 1336, "reason", "fetch-pr", "error", "GET https://api.github.com/repos/o/r/pulls/1336: 503 []"}},
{"failed to fetch check runs", []any{"error", "GET https://api.github.com/repos/o/r/commits/abc/check-runs: 502 Bad Gateway []"}},
{"failed to fetch check runs", []any{"error", "GET https://api.github.com/repos/o/r/commits/abc/check-runs: 504 Gateway Timeout []"}},
Expand All @@ -591,7 +594,9 @@ func TestGitHubUpstreamUnavailableLogsWithoutFleetReport(t *testing.T) {
logger, seen, _ := newFeed(t)
logger.Warn("self-authored automerge sweep skipped PR", "error", "GET https://api.github.com/repos/o/r/pulls/1336: 500 Internal Server Error []")
logger.Warn("self-authored automerge sweep skipped PR", "error", "GET https://api.github.com/repos/o/r/pulls/1336: 403 Resource not accessible by integration")
if len(*seen) != 2 {
logger.Warn("fetch failed: GET https://api.github.com/repos/o/r/pulls/503: 404 Not Found")
logger.Warn("fetch failed: GET https://api.github.com/repos/o/r: 500 Internal Server Error")
if len(*seen) != 4 {
t.Fatalf("non-gateway failures must remain reportable: %+v", *seen)
}
}
Expand Down
Loading