Repository navigation
fix(frontend): one reader for the cached security score (#18907) - #21132
Conversation
|
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 45 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 (code-reviewer pass) at b88f4f7Parity holds for both former callers: the page keeps
Closes check
The CHANGES: unify the duplicate type and drop the cast. Harden or scope the sweep. The remaining items can be fixed in the same PR. |
|
Review findings fixed in b6faf3a.
Verification: vitest on the 3 touched/related test files, 20 tests (6 + 5 + 9); eslint clean on touched files; vue-tsc reported nothing for them. The guard is hardened, so |
Code review (code-reviewer pass) at b6faf3aDelta reviewed: b88f4f7..b6faf3a. All six earlier rows are resolved in code, and no new blocker was found.
Closes check
APPROVE |
|
Both lows fixed in e89b67e: the guard now flags a live-route line followed by a line starting with |
|
Delta review b6faf3a → e89b67e: APPROVE. Both lows from the approved review are fixed, with no other change:
0 unresolved threads. Queued for the next merge train. |
…ad to its new home (#18907)
|
Ejected from T101 on analytics_page_open_reads_only_20491 (shard 4); fixed at 1351266. The guard now reads the cached security read at useCachedSecurityScore.ts (scopeToSource) and the two callers' withSourceId hand-off; added planted controls for a dropped scoper, a non-GET method/.post, and an added page-open scan or mount call. |
|
Delta review at 1351266 (T101 ejection fix): APPROVE. |
Thinking Path
Two composables each fetched the cached security score. The page one (
useCodeIntelScores) was already source-scoped;useCodeIntelligencekept its ownApiClientcopy. Per #20999 the page reader is canonical, so the fetch moves into one composable that both delegate to, with the full raw payload kept sofrom_cacheandcompleted_atstay reachable.What Changed
autobot-frontend/src/composables/analytics/useCachedSecurityScore.ts(new): the singleuseFetchEndpointcall, always source-scoped; exposesraw, the score pick, and anonSuccesshook.useCodeIntelScores.ts:loadCachedSecurityScorenow delegates to it (behaviour unchanged).useCodeIntelligence.ts:getSecurityScoreCacheddelegates to it; same return shape, skip without a scoper, errors still collected.codeIntelTypes.ts:CachedSecurityScoreRawmoved to the shared types.useCachedSecurityScore.oneHome.test.ts(sweep fails if any other source file names the route; planted control included) anduseCodeIntelligence.cachedScore.test.ts(request carriessource_id, fields kept, no scoper sends nothing, failure surfaced).repo_tests/frontend_api_contract_ratchet_test.py:inline_genericsbaseline 534 to 533, as the ratchet prescribes (oneApiClient.get<...>removed).useCodeIntelligencecollects on a failed cached read changed from the thrownerr.messagetoCached security score returned <status>(the shared reader's message).Verification
useCodeIntelScores.cachedRead9). The local install lacksreka-ui, so the last two ran with it aliased to a stub in a throwaway config.Closes #18907
Closes #20999
Model Used
Claude Sonnet 5.5