Add nested license object and search sort=updated/releases#13
Add nested license object and search sort=updated/releases#13rainxchzed merged 1 commit intomainfrom
Conversation
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (8)
✨ 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 |
Summary
Two client-blocking asks landed together because they share a common denominator (every `RepoResponse` mapper).
1. Nested `license` object on RepoResponse
Client's `DetailsRepositoryImpl.getRepoStats` is still firing a direct-GitHub `/repos/{owner}/{name}` call for signed-in users to grab license info -- one full GitHub quota hit per stats fetch -- because the previously-shipped flat fields (`licenseSpdxId` / `licenseName`) didn't match the upstream shape.
Add the nested form alongside the flat fields:
```json
"license": { "spdxId": "MIT", "name": "MIT License" } | null
```
Same data, different shape, matches the upstream GitHub object verbatim. Once client switches to `license`, the direct-GitHub enrichment call goes away -- anon and signed-in both get license from backend, full quota preserved for the cases where direct-GitHub really is needed (refresh, signing-fingerprint, attestations).
`license` is null when both `licenseSpdxId` and `licenseName` are null (no LICENSE file detected). Otherwise it carries whatever subset of the two values is populated.
The flat fields remain on the response for back-compat with shipped client builds. They will be removed in a follow-up after the next client release migrates to `license.spdxId` / `license.name`.
Wired in every mapper: `RepoRepository.toRepoResponse`, `SearchRoutes.MeiliRepoHit.toRepoResponse`, `RepoRoutes.toMetadataOnlyResponse`, `GitHubSearchClient.RepoWithRelease.toRepoResponse`, `SearchRepository.search` (Postgres FTS path -- which previously didn't even SELECT the license columns; now does).
2. Search `sort` options + browse mode
Client's "Recently Updated" sort (PR #520) currently routes around the backend to direct GitHub `/search/repositories?sort=updated`, costing each user 60/hr (anon) or 5000/hr (signed-in) of their GitHub quota and breaking on networks that can't reach `api.github.com`.
Backend now accepts:
`relevance` still requires a non-empty `q` (text-rank needs a query). Every other sort accepts an empty `q` for browse-mode listings -- "Recently Updated" / "Recent Releases" home tabs render against the indexed catalog without a search box.
`sort=updated` is routed directly to Postgres FTS until the fetcher repo's `meili_sync.py` adds `updated_at_gh` to Meili's sortable-attributes config. Postgres has the column already; Meili-side support comes for free once that fetcher PR lands.
The on-demand passthrough + miss-logging paths skip when `q` is blank -- a browse-mode catalog listing has no query to log or passthrough.
Test plan