Merge pull request 'fix(writer-pipeline): demote sitemap gateway 502/503/504 to warning (BIT-30847)' (#51) from fix/BIT-30847-eurohandball-sitemap-502-demote into main
Tests / writer-pipeline tests (push) Successful in 37s
Tests / bridge tests (push) Successful in 39s
Tests / frontend lib tests (push) Successful in 42s

This commit was merged in pull request #51.
This commit is contained in:
spark committed 2026-10-04 06:30:57 +01:00
commit e43f04705a
2 files changed
+29 -1

No files matched your search

+20 -1
View File
@@ -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',
);
});
@@ -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';
}