From c61c19216c11daf3c213bba65daf926eb6999fa7 Mon Sep 17 00:00:00 2001 From: Tiago Neves Date: Sun, 4 Oct 2026 06:17:33 +0100 Subject: [PATCH] fix(writer-pipeline): demote sitemap gateway 502/503/504 to warning EHF google-news-sitemap already retries; residual gateway blips (BIT-30847 / ERRSIG a92b3521aec8) must not open Error Loop tickets. Keep HTTP 500 as error so broken endpoints like the old /sitemap.xml stay actionable. Paperclip-Agent: Bug Squasher (urlKey bug-squasher; id 4669adc7-6368-43ef-bf27-5a601a6b7b83) Paperclip-Issue: BIT-30847 Paperclip-Run: ce265bf3-24dc-4532-b87d-92188cc55399 --- .../src/cycle-error-report.test.ts | 21 ++++++++++++++++++- writer-pipeline/src/lib/cycle-error-report.ts | 9 ++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/writer-pipeline/src/cycle-error-report.test.ts b/writer-pipeline/src/cycle-error-report.test.ts index ae64e48..12e8669 100644 --- a/writer-pipeline/src/cycle-error-report.test.ts +++ b/writer-pipeline/src/cycle-error-report.test.ts @@ -22,9 +22,28 @@ describe('cycleErrorMessageLevel', () => { ); }); - it('keeps whole-source sitemap failures as error', () => { + it('downgrades whole-source sitemap gateway blips to warning (BIT-30847)', () => { + assert.equal( + cycleErrorMessageLevel( + 'sitemap eurohandball_sitemap (https://www.eurohandball.com/google-news-sitemap.xml): HTTP 502', + ), + 'warning', + ); assert.equal( cycleErrorMessageLevel('sitemap eurohandball_sitemap (https://www.eurohandball.com/sitemap.xml): HTTP 503'), + 'warning', + ); + assert.equal( + cycleErrorMessageLevel( + 'sitemap eurohandball_sitemap (https://www.eurohandball.com/google-news-sitemap.xml): HTTP 504', + ), + 'warning', + ); + }); + + it('keeps whole-source sitemap HTTP 500 as error (actionable upstream/config)', () => { + assert.equal( + cycleErrorMessageLevel('sitemap eurohandball_sitemap (https://www.eurohandball.com/sitemap.xml): HTTP 500'), 'error', ); }); diff --git a/writer-pipeline/src/lib/cycle-error-report.ts b/writer-pipeline/src/lib/cycle-error-report.ts index 9a43bb0..9fa4575 100644 --- a/writer-pipeline/src/lib/cycle-error-report.ts +++ b/writer-pipeline/src/lib/cycle-error-report.ts @@ -16,6 +16,15 @@ export function cycleErrorMessageLevel(message: string): 'warning' | 'error' { if (message.includes('truncating')) return 'warning'; // Per-URL HTML probe failed but other pages in the same source may have succeeded. if (/^sitemap .+ page \(https?:\/\//.test(message)) return 'warning'; + // Whole-source fetch already retries (http-retry); remaining gateway blips are upstream + // noise (BIT-30847 / ERRSIG a92b3521aec8). Keep HTTP 500 as error — that flagged the + // broken /sitemap.xml URL fixed in BIT-30741. + if ( + /^sitemap .+ \(https?:\/\//.test(message) && + /: HTTP (502|503|504)\b/.test(message) + ) { + return 'warning'; + } return 'error'; }