Conversation
…de Material Icon Theme assets Add GitLabWikiProxyHandler to fetch wiki pages via GitLab API with token support and normalize inaccessible wikis to empty arrays. Implement single retry with 500ms delay for Codeberg proxy timeouts. Support GitHub-style `topic:` prefix in search queries for cross-provider compatibility. Update .gitignore to exclude PLAN-TAGS.md. Include Material Icon Theme SVG icons and legal.json for file type visualization.
|
Warning Review limit reached
Next review available in: 42 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThe PR adds GitLab wiki proxying and provider request handling, improves topic search and repository cards, adds responsive repository-page controls, detects licenses and language colors, applies themed icons, and introduces shared file and README rendering behavior. ChangesRepository provider integration
Repository browsing interface
Estimated code review effort: 5 (Critical) | ~120 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
…te scripting' Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…te scripting' Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…te scripting' Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Actionable comments posted: 5
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
web/index.html (1)
1606-1606: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick winOther (CWE-693)
Reachability: External
Restore the pageview disclosure or remove the pageview tracker.
web/ethicalmetrics.jsstill sends pageview JSON to/v1/pageviews; removing the notice atweb/index.html:1606leaves mobile users without disclosure when counters still run.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@web/index.html` at line 1606, Restore the pageview disclosure near the closing nav in web/index.html, ensuring mobile users are informed while web/ethicalmetrics.js continues sending pageview data to /v1/pageviews; alternatively, remove or disable the pageview tracker so no undisclosed counters run.
🧹 Nitpick comments (4)
web/repo.html (2)
2053-2058: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueAdd an Escape-key handler for the overlay panel.
The panel is a full-screen overlay at
z-index: 100.closeMobileSidebar()is reachable only through the close button. Add an Escape-key handler so keyboard users can dismiss the panel from anywhere in it.♻️ Proposed addition near closeMobileSidebar
function closeMobileSidebar() { const panel = document.getElementById('mobile-sidebar-panel'); if (!panel) return; panel.classList.remove('open'); const btn = document.getElementById('mobile-sidebar-toggle-btn'); if (btn) btn.setAttribute('aria-expanded', 'false'); document.body.classList.remove('panel-open'); } + +document.addEventListener('keydown', (e) => { + if (e.key !== 'Escape') return; + const panel = document.getElementById('mobile-sidebar-panel'); + if (panel && panel.classList.contains('open')) closeMobileSidebar(); +});Also applies to: 2068-2111
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@web/repo.html` around lines 2053 - 2058, Add a document-level Escape-key handler near the existing closeMobileSidebar function so pressing Escape invokes closeMobileSidebar and dismisses the mobile sidebar overlay from anywhere within it. Preserve the current close-button behavior and only handle the Escape key.
4711-4789: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick winUse a root-relative icon path.
_themeIconcurrently builds relative<img>URLs fromICON_BASE, so servingweb/repo.htmlfrom a nested route would resolve icon URLs under that route and silently break icons when the fallback assets are not present there. Use/assets/MaterialIconTheme/material-icon-theme--.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@web/repo.html` around lines 4711 - 4789, The _themeIcon function currently generates a relative asset URL that breaks when repo.html is served from a nested route. Update ICON_BASE to use the root-relative /assets/MaterialIconTheme/material-icon-theme-- path, preserving the existing _themeIcon construction and icon mappings.internal/http/handlers.go (1)
2973-2979: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick winBound the retry and tie the request to the client context.
The retry is safe for the request itself: the method is restricted to GET/HEAD and the body is
nil, so reusingreqis correct. Two reliability points remain:
- The worst-case handler duration is now about 90.5 s (two 45 s attempts plus the sleep).
http.NewRequestat line 2955 does not carryc.Request.Context(). A client disconnect cancels nothing, so the handler holds a goroutine and an upstream connection for the full duration.Propagate the request context and lower the per-attempt timeout so the total stays close to the previous budget.
♻️ Proposed change
- req, err := http.NewRequest(c.Request.Method, target, nil) + req, err := http.NewRequestWithContext(c.Request.Context(), c.Request.Method, target, nil)- client := &http.Client{Timeout: 45 * time.Second} + client := &http.Client{Timeout: 20 * time.Second} resp, err := client.Do(req) if err != nil { // Codeberg sufre timeouts puntuales: reintentar una vez antes de devolver 502. - time.Sleep(500 * time.Millisecond) - resp, err = client.Do(req) + if c.Request.Context().Err() == nil { + time.Sleep(500 * time.Millisecond) + resp, err = client.Do(req) + } }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@internal/http/handlers.go` around lines 2973 - 2979, Update the upstream request construction around http.NewRequest to use c.Request.Context(), ensuring client disconnects cancel the operation. In the retry flow using client.Do(req), reduce the per-attempt http.Client timeout so both attempts plus the 500 ms delay remain close to the previous single-attempt duration while preserving the existing one-retry behavior.internal/http/router.go (1)
293-293: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick winConsider rate limiting this proxy route.
The route wiring is correct. The
:owner/:repoparams match thec.Paramcalls inGitLabWikiProxyHandler.Each request to this route triggers one outbound
gitlab.comAPI call that carries the sharedGITLAB_TOKEN. The route has no limiter, so an unauthenticated caller can consume the server's GitLab API quota./cb-proxy/*pathat line 284 already appliesprCheckLimiter()for the same reason. The neighbouringgl-*routes share this gap, so treat this as an existing pattern to tighten rather than a regression.♻️ Proposed change
- api.GET("/gl-wiki/:owner/:repo", GitLabWikiProxyHandler) + api.GET("/gl-wiki/:owner/:repo", prCheckLimiter(), GitLabWikiProxyHandler)🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@internal/http/router.go` at line 293, Apply the existing prCheckLimiter() middleware to the GitLabWikiProxyHandler route, matching the protection already used by /cb-proxy/*path. Extend the same rate-limiting treatment to the neighbouring gl-* proxy routes that make outbound GitLab API calls, while preserving their existing handlers and route parameters.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@internal/http/handlers.go`:
- Around line 3013-3017: Update the topic extraction in the query-handling logic
around topicParam so the value after the topic: prefix is trimmed of surrounding
whitespace and assigned only when non-empty. Preserve the existing fallback
behavior for q=topic: by leaving topicParam empty, while ensuring valid topics
such as q=topic: go are passed to providers without leading whitespace.
- Around line 1928-1933: Update the status handling in the wiki response path
around resp.StatusCode so only GitLab statuses indicating an inaccessible or
unavailable wiki are normalized to HTTP 200 with an empty list. Propagate all
other non-200 responses, including 429 and 5xx upstream failures, instead of
returning a successful empty wiki response.
In `@web/assets/MaterialIconTheme/legal.json`:
- Around line 1-8: Add the upstream MIT LICENSE file alongside the vendored SVG
assets in the MaterialIconTheme asset directory, preserving the existing
legal.json metadata and using the license text and copyright notice from the
recorded upstream commit.
In `@web/index.html`:
- Line 3041: Update the topic normalization near the `repo.topics` mapping to
fall back when `topics` is empty, merging or selecting the available `topics`,
`tags`, and `tag_list` values into one normalized array. Reuse that same array
for both `searchMatchScore` and `#`-tag filtering so provider tag matches are
scored and filtered consistently.
In `@web/repo.html`:
- Around line 4253-4285: Update _detectLicense to distinguish GPL and LGPL
license text by version before returning labels, so GPLv2 and LGPLv2.1 content
are not classified as v3; alternatively, return version-neutral labels when the
version cannot be identified. Preserve the existing specificity order with AGPL
checked before LGPL before GPL, and apply the same correction to the
corresponding duplicate detection logic.
---
Outside diff comments:
In `@web/index.html`:
- Line 1606: Restore the pageview disclosure near the closing nav in
web/index.html, ensuring mobile users are informed while web/ethicalmetrics.js
continues sending pageview data to /v1/pageviews; alternatively, remove or
disable the pageview tracker so no undisclosed counters run.
---
Nitpick comments:
In `@internal/http/handlers.go`:
- Around line 2973-2979: Update the upstream request construction around
http.NewRequest to use c.Request.Context(), ensuring client disconnects cancel
the operation. In the retry flow using client.Do(req), reduce the per-attempt
http.Client timeout so both attempts plus the 500 ms delay remain close to the
previous single-attempt duration while preserving the existing one-retry
behavior.
In `@internal/http/router.go`:
- Line 293: Apply the existing prCheckLimiter() middleware to the
GitLabWikiProxyHandler route, matching the protection already used by
/cb-proxy/*path. Extend the same rate-limiting treatment to the neighbouring
gl-* proxy routes that make outbound GitLab API calls, while preserving their
existing handlers and route parameters.
In `@web/repo.html`:
- Around line 2053-2058: Add a document-level Escape-key handler near the
existing closeMobileSidebar function so pressing Escape invokes
closeMobileSidebar and dismisses the mobile sidebar overlay from anywhere within
it. Preserve the current close-button behavior and only handle the Escape key.
- Around line 4711-4789: The _themeIcon function currently generates a relative
asset URL that breaks when repo.html is served from a nested route. Update
ICON_BASE to use the root-relative
/assets/MaterialIconTheme/material-icon-theme-- path, preserving the existing
_themeIcon construction and icon mappings.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
Improve handling of upstream responses and client-side normalization across multiple areas. - internal/http/handlers.go: Normalize GitLab wiki 401/403/404 to 200 with an empty list so the frontend doesn't show network errors for inaccessible wikis; propagate other non-200 upstream responses (e.g. 429/5xx) with their original status and body. - internal/http/handlers.go (SearchHandler): Safely trim and set topic parameter when using GitHub-style "topic:<name>" queries. - web/index.html: Add repoTagList() to unify topics/tags/tag_list into a single deduplicated lowercase tag array and use it in search scoring and tag filtering. - web/repo.html: Improve license detection to better distinguish LGPL v2.1/v3 and GPL v2/v3 (and fall back to generic LGPL/GPL when version not detected). - web/assets/MaterialIconTheme/LICENSE: Add MIT license file for the MaterialIconTheme asset. These changes reduce false error states, unify tag handling across providers, and improve license identification.
…de Material Icon Theme assets
Add GitLabWikiProxyHandler to fetch wiki pages via GitLab API with token support and normalize inaccessible wikis to empty arrays. Implement single retry with 500ms delay for Codeberg proxy timeouts. Support GitHub-style
topic:prefix in search queries for cross-provider compatibility. Update .gitignore to exclude PLAN-TAGS.md. Include Material Icon Theme SVG icons and legal.json for file type visualization.Summary by CodeRabbit