Skip to content

feat: add HIDE_UPDATE_BANNER environment variable#2050

Closed
joelklabo wants to merge 1 commit intogetAlby:masterfrom
joelklabo:feat/hide-update-banner
Closed

feat: add HIDE_UPDATE_BANNER environment variable#2050
joelklabo wants to merge 1 commit intogetAlby:masterfrom
joelklabo:feat/hide-update-banner

Conversation

@joelklabo
Copy link
Copy Markdown
Contributor

@joelklabo joelklabo commented Feb 9, 2026

Summary

Closes #2048

Adds a HIDE_UPDATE_BANNER environment variable that suppresses the new version update banner. Useful for managed deployments like Start9 that provide their own update notifications.

Changes

  • config/models.go: Add HideUpdateBanner bool to AppConfig (HIDE_UPDATE_BANNER env var, defaults to false)
  • api/models.go: Add HideUpdateBanner field to InfoResponse
  • api/api.go: Populate from env config in GetInfo()
  • frontend/src/types.ts: Add hideUpdateBanner to InfoResponse interface
  • frontend/src/hooks/useBanner.tsx: Early return with showBanner: false when flag is set
  • .env.example: Document the new variable

Test plan

  • `go vet` passes
  • `go test ./api/...` passes
  • `npx tsc --noEmit` passes (frontend)
  • ESLint + Prettier pass (via lint-staged pre-commit hook)
  • Commitlint passes
  • Verify banner hidden when `HIDE_UPDATE_BANNER=true`
  • Verify banner shown as normal when env var is unset

Summary by CodeRabbit

Release Notes

  • New Features
    • Added configuration option to hide the update banner.

Closes getAlby#2048

Add a `HIDE_UPDATE_BANNER` environment variable that suppresses the new
version update banner. This is useful for managed deployments like
Start9 that handle their own update notifications.

When set to `true`, the frontend banner hook returns early with
`showBanner: false`, skipping both the version check and the VSS
migration banner.

Changes:
- config/models.go: Add `HideUpdateBanner` to `AppConfig`
- api/models.go: Add `HideUpdateBanner` to `InfoResponse`
- api/api.go: Populate `HideUpdateBanner` from env config
- frontend/src/types.ts: Add `hideUpdateBanner` to `InfoResponse`
- frontend/src/hooks/useBanner.tsx: Check flag before computing banner state
- .env.example: Document the new variable

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Feb 9, 2026

📝 Walkthrough

Walkthrough

This change introduces an environment variable HIDE_UPDATE_BANNER that allows administrators to suppress the version update banner in managed deployments. The flag is threaded through the configuration system, exposed via the API response, and consumed by the frontend banner hook to conditionally hide the update notification.

Changes

Cohort / File(s) Summary
Configuration & Environment
.env.example, config/models.go
Added new HIDE_UPDATE_BANNER environment variable with default false value and descriptive comment for managed deployment use cases.
API Response Structure
api/models.go, api/api.go
Extended InfoResponse struct with HideUpdateBanner boolean field and populated it from app configuration in the GetInfo endpoint.
Frontend Integration
frontend/src/types.ts, frontend/src/hooks/useBanner.tsx
Updated InfoResponse interface and modified banner hook to conditionally hide the update banner when flag is enabled, short-circuiting remaining effect logic.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A banner so grand, we wished it away,
With just one flag set, it hides for the day,
From config to frontend, the message floats through,
A managed deployment's preferred point of view! 🎉

🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title accurately describes the main feature: adding a HIDE_UPDATE_BANNER environment variable. It is concise, clear, and specific about the primary change.
Linked Issues check ✅ Passed The PR fully implements the objective from #2048: adds HIDE_UPDATE_BANNER environment variable to suppress the update banner, supporting managed deployments that provide their own update notifications.
Out of Scope Changes check ✅ Passed All changes are directly related to implementing the HIDE_UPDATE_BANNER feature. No extraneous modifications outside the scope of suppressing the update banner were detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

No actionable comments were generated in the recent review. 🎉

🧹 Recent nitpick comments
frontend/src/hooks/useBanner.tsx (1)

19-22: Guard also suppresses the VSS migration banner — verify this is intentional.

When hideUpdateBanner is true, the early return on Line 21 skips both the version-check banner and the VSS migration logic (Lines 26-30). The VSS migration TODO says "remove after 2026-01-01" and we're past that date, so this is likely moot. If the VSS migration banner is still relevant, consider placing the guard after that check instead.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@joelklabo joelklabo marked this pull request as ready for review February 9, 2026 17:25
@joelklabo
Copy link
Copy Markdown
Contributor Author

Closing in favor of #2051 which has a cleaner implementation on a separate branch.

@joelklabo joelklabo closed this Feb 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add environment variable to hide new version banner

1 participant