Repository navigation
feat(ui): add upgrade banner with latest release changelog stats - #40429
Conversation
Adds GET /get/latest_release_info, which fetches the latest stable GitHub release once per hour per worker and buckets its PR bullets by conventional commit prefix into new features, fixes, and other updates. The Admin UI compares the running proxy version to that release and shows a dismissible top banner with the stat line when the proxy is behind. Dismissal is stored per release version in localStorage so the banner returns for the next one. Co-Authored-By: Claude Code <noreply@anthropic.com>
|
Kerry Lu seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
Use Annotated[..., Depends(...)] instead of a call in the default value to clear the B008 ruff budget. Extract an inline test object over the no-large-inline-object-arg eslint budget. Mock UpgradeBanner in the layout test, matching the other top banners, since it now renders through react-query hooks that need a QueryClientProvider the test doesn't set up. Co-Authored-By: Claude Code <noreply@anthropic.com>
…r_changelog_stats
…latest release fetches Unprefixed release bullets now count as other_updates, concurrent cache misses share one upstream GitHub request through an injected asyncio.Lock, and the dashboard upgrade banner is announced as status rather than alert Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
bugbot run |
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
bugbot run |
|
Want your agent to iterate on Greptile's feedback? Try greploops. |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 26bcc53. Configure here.
…r_changelog_stats
|
@greptileai please re-review at a36a62a: merged current main into the branch, feature diff is unchanged. |
…lets Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
@greptileai please review ea04267: count_release_bullets now returns an immutable mapping to clear the LIT002 lint gate. |
… raising Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
@greptileai please review 3777b0b: test-only change, the route check test now carries a test-quality-ok reason for the lint gate. |
|
bugbot run please re-review the current tip 3777b0b; the commits since your last pass merge main and adjust lint-only code. |
…r_changelog_stats
TLDR
Problem this solves:
How it solves it:
GET /get/latest_release_inforeads the latest stable GitHub releaseUser Flow
Before: an admin running an old proxy never learns a newer release exists
v1.99.0{"detail":"Not Found"}with status 404v1.101.0is outAfter: the same admin sees the newer release and its changelog stats at the top of every dashboard page
v1.101.0linking to the GitHub release{"version":"1.101.0","new_features":96,"bug_fixes":270,"other_updates":107,"release_url":"https://github.com/BerriAI/litellm/releases/tag/v1.101.0"}with status 200Relevant issues
Affected release
Linear ticket
Resolves LIT-7209
Closes LIT-7209
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
uv run pytest tests/test_litellm/<your_test_file>.py -v. Leave the suites (make test-unit-*,make test-unit) to CI: it finishes in ~15 minutes where a laptop takes an hour or more@greptileaito re-request a review after pushing changes)Delays in PR merge?
If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).
Screenshots / Proof of Fix
Shared setup: Postgres plus the proxy started with
PYTHONPATH=<checkout> python litellm/proxy/proxy_cli.py --config config.yaml --port 4000, config below. The Admin UI dev server isnpm run devinui/litellm-dashboardon port 3000. For the UI case the installed package metadata was pointed at version1.99.0so the running proxy reports an older version than the live latest release (1.101.0). The live GitHub release body is byte-identical across arms; the only difference between arms is the checkout onPYTHONPATHBefore (ff7dc86)
Endpoint
curl -s -w "\n%{http_code}\n" -H "Authorization: Bearer sk-1234" http://localhost:4000/get/latest_release_info{"detail":"Not Found"}then404Control leg (real provider call)
curl -s -w "\n%{http_code}\n" -H "Authorization: Bearer sk-1234" -H "Content-Type: application/json" http://localhost:4000/chat/completions -d '{"model":"gpt-4o-mini","messages":[{"role":"user","content":"Reply with the single word ok"}],"max_tokens":5}'{"id":"chatcmpl-EPd0hZ6ct6bPuN5vFS2SOVWRyyEuf",...,"choices":[{"finish_reason":"stop","index":0,"message":{"content":"Ok.","role":"assistant",...}}],"usage":{"completion_tokens":2,"prompt_tokens":13,"total_tokens":15,...}}then200Admin UI
v1.99.0Unauthenticated
curl -s -w "\n%{http_code}\n" http://localhost:4000/get/latest_release_info{"detail":"Not Found"}then404After (3777b0b)
The endpoint, unauthenticated and cache legs below were re-captured on the tip 3777b0b after merging current main. The control leg, Admin UI and non-admin legs were captured on 26bcc53; the commits since then only merge main, swap a mutable Counter for a MappingProxyType, and annotate a test, none of which change those paths
Endpoint
curl -s -w "\n%{http_code}\n" -H "Authorization: Bearer sk-1234" http://localhost:4000/get/latest_release_info{"version":"1.101.0","new_features":96,"bug_fixes":270,"other_updates":107,"release_url":"https://github.com/BerriAI/litellm/releases/tag/v1.101.0"}then200Control leg (real provider call)
curl ... /chat/completionsas Before200with a realchat.completionobjectAdmin UI
v1.101.0links to https://github.com/BerriAI/litellm/releases/tag/v1.101.01.101.0Unauthenticated
curl -s -w "\n%{http_code}\n" http://localhost:4000/get/latest_release_info{"error":{"message":"Authentication Error, No api key passed in.","type":"auth_error","param":"None","code":"401"}}then401Non-admin role
KEY=$(curl -s -H "Authorization: Bearer sk-1234" -H "Content-Type: application/json" -d '{"user_role":"internal_user_viewer"}' http://localhost:4000/key/generate | python3 -c "import sys,json;print(json.load(sys.stdin)['key'])")curl -s -w "\nHTTP %{http_code}\n" -H "Authorization: Bearer $KEY" http://localhost:4000/get/latest_release_info{"error":{"message":"Authentication Error, Only proxy admin can be used to generate, delete, update info for new keys/users/teams. Route=/get/latest_release_info. ...","type":"auth_error","param":"None","code":"401"}}thenHTTP 401HTTP 200. In that capture the body wasnullbecause this box had exhausted the anonymous GitHub API rate limit; the admin curl above shows the populated bodyCache
for i in 1 2 3; do curl -s -o /dev/null -w "%{http_code} %{time_total}s\n" -H "Authorization: Bearer sk-1234" http://localhost:4000/get/latest_release_info; done0.00 sof wall time with status200; the proxy log shows a single upstream GitHub requestType
🆕 New Feature
Caveats (if any)
Low
major.minor.patchonly; dev or rc builds with other suffixes never show itlitellm/proxy/_experimental/outis rebuilt by the scheduled automation, not in this PRAnalyze (python)CodeQL check is red on this PR and on main (run for 6ef7b86 fails the same way): theLogInjection.qlquery exceeds its 2 GiB result-set limit. It is not a required check and there are zero github-advanced-security review threads on this PRReview taxonomy audit (A-BB) on the current diff: A1 not applicable, the cache holds a value owned by GitHub and is refreshed by TTL only. B1 fixed, concurrent cache misses now share one fetch under an
asyncio.Lock. H4 and T16 fixed,as anycasts in the banner test replaced by typed partial results. T5 fixed,localStorageis cleared after each test. L6 fixed, the banner is announced withrole="status"instead of an assertive alert. F3 not applicable, the endpoint has no sibling surfaces. H7 not applicable, see the prebuilt bundle caveat above. D2 fixed after Bugbot flagged it, the route is onLiteLLMRoutes.info_routeslike/get/user_bannerso non-admin roles are not rejected. A2 fixed after Bugbot flagged it, the banner tracks the dismissed version instead of a boolean so a later release shows again without a remountFinal Attestation
Link to Devin session: https://app.devin.ai/sessions/4662d75ea19f45658bcfcc67efa8b322
Open in Devin Desktop: https://app.devin.ai/desktop/session/4662d75ea19f45658bcfcc67efa8b322?variant=devin