Repository navigation
fix(analytics): panels tell a failed read, an unindexed source and an empty result apart (#17651) - #20543
fix(analytics): panels tell a failed read, an unindexed source and an empty result apart (#17651)#20543mrveiss wants to merge 8 commits into
Conversation
… empty result apart (#17651) Declarations and Problems answered a store outage with an empty list and status success/no_data; they now return 503, and carry indexed:true/false so a source never indexed differs from one indexed with nothing of that kind. The three code-index store sites share autobot_shared.paths.chromadb_data_dir instead of each spelling the path. Pattern analysis reports a failed cached read, clear and report fetch as an error, rendered through EmptyState.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 32 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
Code review on PR #20543 (head ac72986): approve. Read only. The outage, not-indexed and empty cases split as stated, and 503 survives |
Thinking Path
Codebase analytics panels render blank with matching routes, so the backend answer has to be checked.
/declarationsand/problemsturned a store failure into an empty success, so a client could not tell an outage from a clean result. Three sites also spelled the ChromaDB path themselves instead of using the existing helper.What Changed
endpoints/store_state.py./declarationsand/problemsanswer 503 when the store cannot be read,no_datawithindexed: falsefor a source never indexed, andsuccesswithindexed: truewhen indexed and empty.api/codebase_analytics/storage.py,code_intelligence/pattern_analysis/storage.pyandchromadb_storage.pyusechromadb_data_dir(). Reader and indexer shared one literal before, so this removes the duplicate; it is not the cause of the blanks.usePatternAnalysis.tsno longer swallows a failed cached read, clear or report, andPatternAnalysis.vueshows the error, with one en.json key.Verification
store_state_17651_test.py: 12 passed, 8 of them fail against main. It uses the repo in-memory client; realchromadbis stubbed, and the pattern-analysis path is pinned by source text only.usePatternAnalysis.errors.test.ts: 4 passed, 3 fail against main, with@autobot/uimocked.Model Used
Claude Sonnet for the implementation, Claude Opus for coordination.
Single-issue rationale
Refs #17651 and does not close it. Left open: the frontend reading
indexed, the authenticated measurement, and the error wiring that needsCodebaseAnalytics.vuesplit first. Existing rows withoutsource_idstay invisible until re-indexed. Other endpoints with the same swallow-to-empty shape were not audited, andpattern_analysis.pykeeps its recordedno_dataruling (#12365).