Skip to content

fix(observability): surface RAG index-population failures to Sentry - #1625

Merged
JSONbored merged 1 commit into
mainfrom
feat/sentry-rag-index-errors
Jun 27, 2026
Merged

fix(observability): surface RAG index-population failures to Sentry#1625
JSONbored merged 1 commit into
mainfrom
feat/sentry-rag-index-errors

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

Extends the review-pipeline Sentry coverage (after #1619 covered RAG retrieval / enrichment / inline failures) to the RAG index-population path. fetchRepoTree and listStoredChunkPaths (rag-index.ts) logged their catch failures via console.log with no level, so the central Sentry forwarder (which forwards only level:"error"/"fatal") never saw them — a broken index population (GitHub tree fetch down, D1 read error) silently degraded RAG quality with no Sentry signal.

Promote both to level:"error" event:"rag_index_tree_error" / "rag_list_paths_error" (keeping the ev tag for log continuity), mirroring the #1619 rag.ts pattern. Both remain fail-safe (population still degrades gracefully) — only visibility changes.

Extends #1618. (The two outer-catch population sites — rag_index_repo_error / rag_reindex_paths_error — are defensive/unreachable in the current tests and are a separate follow-up with their own coverage.)

Scope

Validation

  • git diff --check · actionlint · typecheck
  • test:coverage — both promoted catches are exercised by the existing rag-index tests (tree-throws; stored-paths read error), now asserting the level:"error" log; no new branches.
  • test:workers · build:mcp · test:mcp-pack · ui:* · npm audit --audit-level=moderate

If any required check was skipped, explain why:

  • No migration/OpenAPI/cf-typegen: logging-level change only.

Safety

  • No secrets/wallets/trust-scores exposed — logs carry repo/project + a bounded error message.
  • No public GitHub text change · auth/CORS N/A.

Notes

  • This is self-host engine code (RAG index population runs on the container); it ships on the next self-host rsync+rebuild (logging-only, non-urgent — can batch with other self-host changes).

fetchRepoTree and listStoredChunkPaths logged their catch failures via
console.log with no level, so the central Sentry forwarder (level:error/fatal
only) never saw them — a broken RAG index population (GitHub tree fetch down,
D1 read error) silently degraded retrieval quality with no signal.

Promote both to level:error (event rag_index_tree_error / rag_list_paths_error,
keeping the ev tag for log continuity), mirroring the rag.ts pattern from #1619.
Both stay fail-safe; only visibility changes. Covered by the existing tree-throws
and stored-paths-read-error tests, now asserting the level:error log.
@dosubot dosubot Bot added the size:XS label Jun 27, 2026
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@codecov

codecov Bot commented Jun 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.51%. Comparing base (031cb7b) to head (9ef54e4).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1625   +/-   ##
=======================================
  Coverage   95.51%   95.51%           
=======================================
  Files         204      204           
  Lines       22051    22051           
  Branches     7966     7966           
=======================================
  Hits        21062    21062           
  Misses        413      413           
  Partials      576      576           
Files with missing lines Coverage Δ
src/review/rag-index.ts 89.65% <100.00%> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JSONbored
JSONbored merged commit 0cf3b30 into main Jun 27, 2026
18 checks passed
@JSONbored
JSONbored deleted the feat/sentry-rag-index-errors branch June 27, 2026 22:49
JSONbored added a commit that referenced this pull request Jun 28, 2026
…the event slug (#1636)

forwardStructuredLogToSentry titled each issue with only obj.event and buried
the real failure in a 'log' context blob — so operators had to open each issue
to learn what broke. Now:
- title leads with the failure: "<event>: <message ?? error>" (e.g.
  orb_broker_unavailable: The operation was aborted due to timeout)
- index filterable tags for the dimensions operators search/group by (repo,
  installationId, pull, pr, project, kind, deliveryId), present values only
- fingerprint by event so recurrences collapse into one issue instead of
  fragmenting on the variable detail now in the title

Pairs with the source-side instrumentation (#1605/#1619/#1625/#1627/#1628):
those make failures reach Sentry; this makes each issue legible at a glance.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant