Use OfficialRepositoryName from index instead of fetching buckets.json#117
Use OfficialRepositoryName from index instead of fetching buckets.json#117z-Fng wants to merge 1 commit intoScoopInstaller:mainfrom
Conversation
WalkthroughSearch no longer fetches a separate buckets.json mapping; official repository names are read from search result metadata ( Changes
Sequence Diagram(s)sequenceDiagram
participant Client as Client
participant SearchUI as Search (UI)
participant Processor as SearchProcessor
participant Azure as AzureSearch
participant Result as SearchResult
rect rgba(200,200,255,0.5)
Client->>SearchUI: trigger search
SearchUI->>Processor: build query (include Metadata/OfficialRepositoryName)
Processor->>Azure: execute search request
Azure-->>Processor: results with Metadata.OfficialRepositoryName
Processor-->>SearchUI: return results
SearchUI->>Result: render item with metadata.officialRepositoryName
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
a8d21b7 to
068c49e
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/components/SearchResult.tsx`:
- Around line 115-122: The ternary/fallback expressions for
highlightedRepository replacement and bucketName are formatted in a way Biome
rejects; rewrite them with clear grouping or explicit if/else to avoid
multi-line ternary ambiguity. Specifically, for highlightedRepository (the
expression using highlightedRepository?.toString().replace(...)) ensure the
ternary is parenthesized or converted to an if/else so the two replace calls are
clearly separated; for bucketName (the metadata.repositoryOfficial ? ... : ...
expression) either put the entire ternary on one line or expand it into a short
if/else block that assigns bucketName explicitly and uses
metadata.officialRepositoryName ||
metadata.repository.substring(...).toLowerCase() in the true branch and
extractPathFromUrl(metadata.repository, '_') in the false branch; keep
references to highlightedRepository, versionPrefix, bucketName,
extractPathFromUrl and metadata as-is.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: aad452b2-09a2-428b-92e0-73ddfa051f65
📒 Files selected for processing (8)
src/__tests__/mocks/fixtures.tssrc/components/Search.test.tsxsrc/components/Search.tsxsrc/components/SearchProcessor.tsxsrc/components/SearchResult.test.tsxsrc/components/SearchResult.tsxsrc/serialization/MetadataJson.test.tssrc/serialization/MetadataJson.ts
💤 Files with no reviewable changes (2)
- src/components/SearchResult.test.tsx
- src/components/Search.tsx
Changes
Use
OfficialRepositoryNamefrom the Azure index, instead of retrieving the official bucket name via fetchingbuckets.jsonRelates to:
Relays on:
Summary by CodeRabbit
Refactor
Tests