fix(review): surface a non-2xx REES enrichment response to Sentry - #1646
Conversation
buildReviewEnrichment returned undefined on a non-200 from /v1/enrich with no log, so a broken or auth-failing REES backend silently degraded the review to no-enrichment with no signal. Log it at error level (the same review_context_fetch_failed event as the network-error catch) so the Sentry forwarder captures a broken REES backend.
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review — held for maintainer review
⏸️ Held for maintainer review Review summary
Nits — 5 non-blocking
Review context
Contributor next steps
Signal definitions
Review detailsGenerated from public PR metadata and the diff. Advisory only; deterministic signals remain authoritative. A clean, minimal observability fix: the silent `return undefined` on a non-2xx REES response is replaced with a structured `console.error` at the same `review_context_fetch_failed` event and log level as the existing `catch` block (`enrichment-wire.ts:143`), closing the gap where a broken REES backend would degrade the review invisibly. Behavior is otherwise unchanged — the function still returns `undefined` and the review proceeds un-enriched. The test exercises the real code path with a genuine non-200 stub and the assertion correctly targets both the event name and the embedded status code in the serialized JSON string. Nits (5)
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
|
Important 🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪 🔍 Gittensory is reviewing…AI analysis is in progress. This comment will update when the review is complete. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed · 🟪 Reviewing |
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1646 +/- ##
=======================================
Coverage ? 95.53%
=======================================
Files ? 204
Lines ? 22115
Branches ? 7985
=======================================
Hits ? 21128
Misses ? 412
Partials ? 575
🚀 New features to boost your workflow:
|
Summary
buildReviewEnrichmentreturnedundefinedon a non-200 from the REES/v1/enrichendpoint with no log — so a broken or auth-failing enrichment backend silently degraded the review to no-enrichment with no signal (only network/timeout errors were logged). It now logs the non-2xx at error level (the samereview_context_fetch_failedevent as the network-error catch, with the status code) so the Sentry forwarder captures a broken REES backend.Verified live:
/v1/enrichcurrently returns 200 — this closes the observability gap for when it doesn't.Scope
enrichment-wire.ts+ its test).site//CNAME/Pages.Validation
npm run test:cigreen; the non-200 test now asserts the error log fires (status 502).npm audit --audit-level=moderateSafety