Skip to content

fix(analytics): panels tell a failed read, an unindexed source and an empty result apart (#17651) - #20543

Closed
mrveiss wants to merge 8 commits into
mainfrom
issue-17651-analytics-backend
Closed

mrveiss wants to merge 8 commits into
mainfrom
issue-17651-analytics-backend

Conversation

@mrveiss

@mrveiss mrveiss commented Nov 1, 2026

Copy link
Copy Markdown
Owner

Thinking Path

Codebase analytics panels render blank with matching routes, so the backend answer has to be checked. /declarations and /problems turned 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

  • New endpoints/store_state.py. /declarations and /problems answer 503 when the store cannot be read, no_data with indexed: false for a source never indexed, and success with indexed: true when indexed and empty.
  • api/codebase_analytics/storage.py, code_intelligence/pattern_analysis/storage.py and chromadb_storage.py use chromadb_data_dir(). Reader and indexer shared one literal before, so this removes the duplicate; it is not the cause of the blanks.
  • usePatternAnalysis.ts no longer swallows a failed cached read, clear or report, and PatternAnalysis.vue shows 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; real chromadb is stubbed, and the pattern-analysis path is pinned by source text only.
  • usePatternAnalysis.errors.test.ts: 4 passed, 3 fail against main, with @autobot/ui mocked.
  • A read-only look at the local install found the ChromaDB service running on its own 4.2G data directory and the local data folder empty. No authenticated API call was made, so the cause of the blank panels is not proven.

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 needs CodebaseAnalytics.vue split first. Existing rows without source_id stay invisible until re-indexed. Other endpoints with the same swallow-to-empty shape were not audited, and pattern_analysis.py keeps its recorded no_data ruling (#12365).

… 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.
@mrveiss mrveiss added this to the M3 - Refined GUI complete milestone Nov 1, 2026
@mrveiss mrveiss added the phase:M3.9 Chat, Agents, Analytics and Settings screens label Nov 1, 2026
@coderabbitai

coderabbitai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
Commits

Reviewing files that changed from the base of the PR and between 87eae8a and fad5576.

Files ignored due to path filters: 1
  • scripts/python_file_size_known_large.py is excluded by !scripts/python_file_size_known_large.py
Files selected for processing: 13
  • autobot-backend/api/codebase_analytics/chromadb_storage.py
  • autobot-backend/api/codebase_analytics/endpoints/declarations.py
  • autobot-backend/api/codebase_analytics/endpoints/stats.py
  • autobot-backend/api/codebase_analytics/endpoints/store_state.py
  • autobot-backend/api/codebase_analytics/endpoints/store_state_17651_test.py
  • autobot-backend/api/codebase_analytics/storage.py
  • autobot-backend/code_intelligence/pattern_analysis/storage.py
  • autobot-frontend/src/components/analytics/PatternAnalysis.vue
  • autobot-frontend/src/composables/usePatternAnalysis.errors.test.ts
  • autobot-frontend/src/composables/usePatternAnalysis.ts
  • autobot-frontend/src/i18n/locales/en.json
  • repo_tests/i18n_untranslated_ratchet_test.py
  • scripts/frontend_file_size_known_large.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Notice: 29 open PRs — past the runaway threshold (25)

This is not a request to defer this PR. There is no cap on open PRs (#19397) -- nothing blocks opening or pushing a PR.

This notice only means the count is high enough to be worth a glance for a runaway — something opening PRs in a loop, or a merge pipeline that has stalled so nothing is draining.

Currently open:

If the queue is draining normally, ignore this. Otherwise:

  1. Check whether CI is dispatching at all — see the ci-dispatch-watchdog status on these PRs
  2. Approved PRs land through the merge train the coordinator sequences (merge commits, never squash) -- check the open chore(merge-train) PR is moving, not each PR on its own
  3. Look for a loop opening near-identical PRs

Warn-only runaway detector — .github/workflows/pr-queue-gate.yml. It never blocks a merge.

@mrveiss

mrveiss commented Nov 1, 2026

Copy link
Copy Markdown
Owner Author

Code review on PR #20543 (head ac72986): approve.

Read only. The outage, not-indexed and empty cases split as stated, and 503 survives with_error_handling. Note: /patterns/cached-summary still turns a store failure into no_data 200 under the ruling on #12365, so the new raise path only fires on transport or HTTP errors. The pattern-analysis path is pinned by source text only.

@mrveiss

mrveiss commented Nov 2, 2026

Copy link
Copy Markdown
Owner Author

Landed through the merge train (PR #20594), merge 655489c, with the content check clean. Proof: git rev-list --no-merges --count origin/main..head = 0; the head moved only by syncing main after the train froze it. Closing and deleting the branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

phase:M3.9 Chat, Agents, Analytics and Settings screens

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant