Skip to content

feat(settings): display version check status and upgrade reminder - #334

Merged
cxymds merged 1 commit into
mainfrom
feat/version-check
Dec 4, 2026
Merged

cxymds merged 1 commit into
mainfrom
feat/version-check

Conversation

@cxymds

@cxymds cxymds commented Dec 4, 2026 •

Copy link
Copy Markdown
Member

Pull Request

Description

Add a read-only Version Check section below the Notify / Audit module switches on the System Settings page (app/(dashboard)/settings/page.tsx) that consumes the server-side GET /rustfs/admin/v3/version-check endpoint. It displays the current RustFS version and the latest available version, shows a latest badge when up to date, and renders an external upgrade reminder link (update available / 升级至最新版本) pointing to the canonical locale-appropriate RustFS upgrade documentation (https://docs.rustfs.com/en/operations/upgrade or https://docs.rustfs.com/zh/operations/upgrade) when a newer release exists.

The Console does not issue external browser requests to version.rustfs.com and does not expose a toggle or disable control on the settings page. Version check reads run independently from module switches so older servers or unavailable checks degrade gracefully to Unavailable without affecting Notify or Audit switch reads and writes, and the Sync action guards against overlapping refreshes while either switches or version check are loading.

Type of Change

  • New feature (non-breaking change which adds functionality)
  • Test improvements

Testing

  • Unit tests added/updated
  • Manual testing completed
pnpm install --frozen-lockfile
pnpm type-check
pnpm lint
pnpm format:check
pnpm test:run
pnpm build

All 1,349 unit tests passed, including tests/lib/version-check.test.ts covering payload normalization, version formatting (refs/tags/, RELEASE., v, and @commit), display-state resolution, locale-specific upgrade documentation URLs, placement below Audit, Sync disabled state during versionLoading, and Settings page contract assertions. Headless Chrome verified the static production build against a local HTTP fixture server across desktop (English update available, Chinese update available, English latest) and mobile (390x844, zero horizontal overflow).

Checklist

  • Code follows the project's style guidelines
  • Self-review completed
  • TypeScript types are properly defined
  • All commit messages are in English (Conventional Commits)
  • All existing tests pass
  • No new dependencies added, or they are justified

Related Issues

Related to rustfs/backlog#3400

Screenshots (if applicable)

Captured locally from the production static build (out/rustfs/console) backed by a local HTTP fixture server to exercise each state deterministically.

View / State Before After
Desktop (EN, update available) Before After EN update available
Desktop (ZH, update available) — After ZH update available
Desktop (EN, latest) — After EN latest
Mobile 390x844 (EN, update available) — After Mobile

Additional Notes

Requires the companion rustfs backend PR that caches the server-side update check result and exposes GET /rustfs/admin/v3/version-check. Against older RustFS servers without that route, the section still shows the current version from /rustfs/console/version and marks latest status as Unavailable.

@overtrue overtrue left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 62203284 (feat(settings): display version check status and upgrade reminder).

The feature implementation (lib/version-check.ts, hooks/use-version-check.ts, app/(dashboard)/settings/page.tsx, and tests/lib/version-check.test.ts) is well structured: normalizeVersionCheckSnapshot handles missing/malformed fields safely, ApiClient suppress403Redirect: true is wired correctly with Promise.allSettled fallback to configManager.loadConfig().release?.version, and all UI strings are keyed in the locale files.

Blocking items before approval:

  1. Merge conflicts (CONFLICTING / DIRTY): Needs rebase onto main (433917a1), which modified all 15 i18n/locales/*.json files in #333.
  2. CI gate: 0 CI checks have run on feat/version-check.

Non-blocking notes:

  • In app/(dashboard)/settings/page.tsx, the Sync button uses disabled={loading || saving} and omits versionLoading, so repeated clicks while only the version check is still pending can issue overlapping requests.
  • In lib/version-check.ts, UPGRADE_DOCS_URL_EN omits the trailing / while UPGRADE_DOCS_URL_ZH includes it (.../upgrade/).

@cxymds
cxymds force-pushed the feat/version-check branch from 6220328 to 43c1aab Compare December 4, 2026 03:21
@cxymds

cxymds commented Dec 4, 2026

Copy link
Copy Markdown
Member Author

Addressed all review items in 43c1aab:

  • Rebased cleanly onto origin/main (6121c06), resolving all 15 i18n/locales/*.json merge conflicts and triggering CI checks.
  • Moved the read-only Version Check section below the Notify / Audit module switches and refreshed all screenshots in the PR description.
  • Guarded the Sync button with disabled={loading || versionLoading || saving} to prevent overlapping version-check requests while pending.
  • Normalized both English and Chinese upgrade documentation URLs to omit the trailing slash (https://docs.rustfs.com/en/operations/upgrade and https://docs.rustfs.com/zh/operations/upgrade), matching the live canonical target (the trailing-slash variants return HTTP 307 to the non-trailing-slash paths).

@cxymds
cxymds merged commit b6a829d into main Dec 4, 2026
10 checks passed
@cxymds
cxymds deleted the feat/version-check branch December 4, 2026 03:24
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.

2 participants