From a2373cdcb77510b24a4de27b744e1f394e623f7d Mon Sep 17 00:00:00 2001 From: trikimiki <41070061+trikimiki@users.noreply.github.com> Date: Tue, 26 May 2026 16:58:43 +0300 Subject: [PATCH 1/2] add "patchableFrom" to upgrade instructions fix misleading patch upgrade (no script run) notes --- .../upgrade-instructions/DockerComposeUpgradeSteps.astro | 4 ++-- .../upgrade-instructions/DockerUpgradeSteps.astro | 6 +++--- src/components/upgrade-instructions/LinuxUpgradeSteps.astro | 4 ++-- .../upgrade-instructions/WindowsUpgradeSteps.astro | 4 ++-- src/models/upgrade-instructions.ts | 5 +++++ 5 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/components/upgrade-instructions/DockerComposeUpgradeSteps.astro b/src/components/upgrade-instructions/DockerComposeUpgradeSteps.astro index 760f4a601..50ca317c8 100644 --- a/src/components/upgrade-instructions/DockerComposeUpgradeSteps.astro +++ b/src/components/upgrade-instructions/DockerComposeUpgradeSteps.astro @@ -116,7 +116,7 @@ function repoLink(ver: string): string | null { {prevHref ? ( {prevDisplayLabel} ) : prevDisplayLabel} - {v.patch && <>{' '}or any {v.baseVersion} patch}.{' '} + {v.patch && <>{' '}or any {v.patchableFrom ?? v.baseVersion} patch}.{' '} In order to upgrade to {isPE ? `${v.displayVersion}PE` : v.displayVersion} you need to{' '} {prevHref ? ( <>upgrade to {prevDisplayLabel} first. @@ -163,7 +163,7 @@ function repoLink(ver: string): string | null {
{v.patch ? ( -

If you are upgrading from {v.upgradableFrom}, you must run the script below. However, if you are upgrading from version {`${v.baseVersion}.x`}, DO NOT run the upgrade script; proceed directly to starting the service.

+

If you are upgrading from {v.upgradableFrom}, you must run the script below. However, if you are upgrading from version {v.patchableFrom ?? v.baseVersion + '.x'}, DO NOT run the upgrade script; proceed directly to starting the service.

) : (

If you are upgrading from version {v.upgradableFrom}, you must run the script below.

)} diff --git a/src/components/upgrade-instructions/DockerUpgradeSteps.astro b/src/components/upgrade-instructions/DockerUpgradeSteps.astro index e940ada09..798ce10d2 100644 --- a/src/components/upgrade-instructions/DockerUpgradeSteps.astro +++ b/src/components/upgrade-instructions/DockerUpgradeSteps.astro @@ -93,7 +93,7 @@ function versionTag(ver: string): string { {prevHref ? ( {prevDisplayLabel} ) : prevDisplayLabel} - {v.patch && <>{' '}or any {v.baseVersion} patch}.{' '} + {v.patch && <>{' '}or any {v.patchableFrom ?? v.baseVersion} patch}.{' '} In order to upgrade to {isPE ? `${v.displayVersion}PE` : v.displayVersion} you need to{' '} {prevHref ? ( <>upgrade to {prevDisplayLabel} first. @@ -121,7 +121,7 @@ function versionTag(ver: string): string {
{v.patch ? ( -

If you are upgrading from {v.upgradableFrom}, you must run the script below. However, if you are upgrading from version {`${v.baseVersion}.x`}, DO NOT run the upgrade script; proceed directly to starting the service.

+

If you are upgrading from {v.upgradableFrom}, you must run the script below. However, if you are upgrading from version {v.patchableFrom ?? v.baseVersion + '.x'}, DO NOT run the upgrade script; proceed directly to starting the service.

) : (

If you are upgrading from version {v.upgradableFrom}, you must run the script below.

)} @@ -143,7 +143,7 @@ function versionTag(ver: string): string {
{v.patch ? ( -

If you are upgrading from {v.upgradableFrom}, you must run the script below. However, if you are upgrading from version {`${v.baseVersion}.x`}, DO NOT run the upgrade script; proceed directly to starting the service.

+

If you are upgrading from {v.upgradableFrom}, you must run the script below. However, if you are upgrading from version {v.patchableFrom ?? v.baseVersion + '.x'}, DO NOT run the upgrade script; proceed directly to starting the service.

) : (

If you are upgrading from version {v.upgradableFrom}, you must run the script below.

)} diff --git a/src/components/upgrade-instructions/LinuxUpgradeSteps.astro b/src/components/upgrade-instructions/LinuxUpgradeSteps.astro index 7df20cd87..5fb84c049 100644 --- a/src/components/upgrade-instructions/LinuxUpgradeSteps.astro +++ b/src/components/upgrade-instructions/LinuxUpgradeSteps.astro @@ -124,7 +124,7 @@ function needsCompatibilityCheck(version: string): boolean { {prevDisplayLabel} ) : ( prevDisplayLabel - )}{v.patch ? <>{' '}or any {v.baseVersion} patch : ''}.{' '} + )}{v.patch ? <>{' '}or any {v.patchableFrom ?? v.baseVersion} patch : ''}.{' '} In order to upgrade to {isPE ? `${v.displayVersion}PE` : v.displayVersion} you need to{' '} {prevHref ? ( <>upgrade to {prevDisplayLabel} first. @@ -198,7 +198,7 @@ function needsCompatibilityCheck(version: string): boolean {
{v.patch ? ( -

If you are upgrading from {v.upgradableFrom}, you must run the script below. However, if you are upgrading from version {`${v.baseVersion}.x`}, DO NOT run the upgrade script; proceed directly to starting the service.

+

If you are upgrading from {v.upgradableFrom}, you must run the script below. However, if you are upgrading from version {v.patchableFrom ?? v.baseVersion + '.x'}, DO NOT run the upgrade script; proceed directly to starting the service.

) : (

If you are upgrading from version {v.upgradableFrom}, you must run the script below.

)} diff --git a/src/components/upgrade-instructions/WindowsUpgradeSteps.astro b/src/components/upgrade-instructions/WindowsUpgradeSteps.astro index 4faea1f4a..420cccbba 100644 --- a/src/components/upgrade-instructions/WindowsUpgradeSteps.astro +++ b/src/components/upgrade-instructions/WindowsUpgradeSteps.astro @@ -113,7 +113,7 @@ function needsCompatibilityCheck(version: string): boolean { {prevHref ? ( {prevDisplayLabel} ) : prevDisplayLabel} - {v.patch && <>{' '}or any {v.baseVersion} patch}.{' '} + {v.patch && <>{' '}or any {v.patchableFrom ?? v.baseVersion} patch}.{' '} In order to upgrade to {isPE ? `${v.displayVersion}PE` : v.displayVersion} you need to{' '} {prevHref ? ( <>upgrade to {prevDisplayLabel} first. @@ -182,7 +182,7 @@ function needsCompatibilityCheck(version: string): boolean {
{v.patch ? ( -

If you are upgrading from {v.upgradableFrom}, you must run the script below. However, if you are upgrading from version {`${v.baseVersion}.x`}, DO NOT run the upgrade script; proceed directly to starting the service.

+

If you are upgrading from {v.upgradableFrom}, you must run the script below. However, if you are upgrading from version {v.patchableFrom ?? v.baseVersion + '.x'}, DO NOT run the upgrade script; proceed directly to starting the service.

) : (

If you are upgrading from version {v.upgradableFrom}, you must run the script below.

)} diff --git a/src/models/upgrade-instructions.ts b/src/models/upgrade-instructions.ts index 974acec20..3917f9120 100644 --- a/src/models/upgrade-instructions.ts +++ b/src/models/upgrade-instructions.ts @@ -13,6 +13,8 @@ export interface UpgradeVersion { releaseDatePe?: string; /** "upgradable-from" value, e.g. "4.2.1.x" or "4.1.0" */ upgradableFrom: string; + /** Optional override for the in-family patch label used in "or any X patch" text and the "from version X" upgrade-script note. When unset, templates fall back to baseVersion (and baseVersion.x for the script note). */ + patchableFrom?: string; /** Anchor of the upgradable-from version on the same platform page */ prevVersionAnchor?: string; lts: boolean; @@ -47,6 +49,7 @@ export const UPGRADE_VERSIONS: UpgradeVersion[] = [ baseVersion: '4.3.1', releaseDate: 'May 28 2026', upgradableFrom: '4.2.1.x', + patchableFrom: '4.3.x', prevVersionAnchor: 'v4-3-0-1', lts: true, patch: true, @@ -63,6 +66,7 @@ export const UPGRADE_VERSIONS: UpgradeVersion[] = [ baseVersion: '4.3.1', releaseDate: 'Mar 31 2026', upgradableFrom: '4.2.1.x', + patchableFrom: '4.3.x', prevVersionAnchor: 'v4-3-0-1', lts: true, patch: true, @@ -80,6 +84,7 @@ export const UPGRADE_VERSIONS: UpgradeVersion[] = [ baseVersion: '4.3.1', releaseDate: 'Mar 10 2026', upgradableFrom: '4.2.1.x', + patchableFrom: '4.3.x', prevVersionAnchor: 'v4-3-0-1', lts: true, patch: true, From 112b33c207786ee4d3927bc160d1e6848c1acd5b Mon Sep 17 00:00:00 2001 From: trikimiki <41070061+trikimiki@users.noreply.github.com> Date: Tue, 26 May 2026 18:05:20 +0300 Subject: [PATCH 2/2] fix "latest patch" wording applied to all patches --- .../DockerComposeUpgradeSteps.astro | 6 +++--- .../upgrade-instructions/DockerUpgradeSteps.astro | 6 +++--- .../upgrade-instructions/LinuxUpgradeSteps.astro | 6 +++--- .../upgrade-instructions/WindowsUpgradeSteps.astro | 6 +++--- src/models/upgrade-instructions.ts | 14 ++++++++++++++ .../[platform]/[familySlug].astro | 6 +++--- .../[platform]/[familySlug].astro | 6 +++--- 7 files changed, 32 insertions(+), 18 deletions(-) diff --git a/src/components/upgrade-instructions/DockerComposeUpgradeSteps.astro b/src/components/upgrade-instructions/DockerComposeUpgradeSteps.astro index 50ca317c8..ff44cf5de 100644 --- a/src/components/upgrade-instructions/DockerComposeUpgradeSteps.astro +++ b/src/components/upgrade-instructions/DockerComposeUpgradeSteps.astro @@ -1,5 +1,5 @@ --- -import { UPGRADE_VERSIONS, getFamilySlug } from '~/models/upgrade-instructions'; +import { UPGRADE_VERSIONS, LATEST_PATCH_VERSIONS, getFamilySlug } from '~/models/upgrade-instructions'; import type { Products } from '~/models/site.models'; interface Props { @@ -55,8 +55,8 @@ function repoLink(ver: string): string | null { {versions.map((v) => { const newer = isNewerVersionScheme(v.version); const needsCompat = needsCompatibilityCheck(v.version); - const heading = v.patch && v.baseVersion !== v.displayVersion - ? `Upgrading ThingsBoard${isPE ? ' PE' : ''} to latest ${v.baseVersion} (${v.displayVersion})` + const heading = v.patch && v.baseVersion !== v.displayVersion && LATEST_PATCH_VERSIONS.has(v.version) + ? `Upgrading ThingsBoard${isPE ? ' PE' : ''} to ${v.displayVersion} (latest ${v.baseVersion} patch)` : `Upgrading ThingsBoard${isPE ? ' PE' : ''} to ${v.displayVersion}`; const prevLabel = v.x ? v.upgradableFrom : v.upgradableFrom; const prevDisplayLabel = isPE ? `${prevLabel} PE` : prevLabel; diff --git a/src/components/upgrade-instructions/DockerUpgradeSteps.astro b/src/components/upgrade-instructions/DockerUpgradeSteps.astro index 798ce10d2..de5e378f0 100644 --- a/src/components/upgrade-instructions/DockerUpgradeSteps.astro +++ b/src/components/upgrade-instructions/DockerUpgradeSteps.astro @@ -1,5 +1,5 @@ --- -import { UPGRADE_VERSIONS, getFamilySlug } from '~/models/upgrade-instructions'; +import { UPGRADE_VERSIONS, LATEST_PATCH_VERSIONS, getFamilySlug } from '~/models/upgrade-instructions'; import type { Products } from '~/models/site.models'; interface Props { @@ -33,8 +33,8 @@ function versionTag(ver: string): string { {versions.map((v) => { const newer = isNewerVersionScheme(v.version); const needsCompat = needsCompatibilityCheck(v.version); - const heading = v.patch && v.baseVersion !== v.displayVersion - ? `Upgrading ThingsBoard${isPE ? ' PE' : ''} to latest ${v.baseVersion} (${v.displayVersion})` + const heading = v.patch && v.baseVersion !== v.displayVersion && LATEST_PATCH_VERSIONS.has(v.version) + ? `Upgrading ThingsBoard${isPE ? ' PE' : ''} to ${v.displayVersion} (latest ${v.baseVersion} patch)` : `Upgrading ThingsBoard${isPE ? ' PE' : ''} to ${v.displayVersion}`; const prevLabel = v.x ? v.upgradableFrom : v.upgradableFrom; const prevDisplayLabel = isPE ? `${prevLabel} PE` : prevLabel; diff --git a/src/components/upgrade-instructions/LinuxUpgradeSteps.astro b/src/components/upgrade-instructions/LinuxUpgradeSteps.astro index 5fb84c049..9f0dfc8a0 100644 --- a/src/components/upgrade-instructions/LinuxUpgradeSteps.astro +++ b/src/components/upgrade-instructions/LinuxUpgradeSteps.astro @@ -1,5 +1,5 @@ --- -import { UPGRADE_VERSIONS, getFamilySlug } from '~/models/upgrade-instructions'; +import { UPGRADE_VERSIONS, LATEST_PATCH_VERSIONS, getFamilySlug } from '~/models/upgrade-instructions'; import type { Products } from '~/models/site.models'; import PrepareSection from './PrepareSection.astro'; @@ -57,8 +57,8 @@ function needsCompatibilityCheck(version: string): boolean { {versions.map((v) => { const newer = isNewerVersionScheme(v.version); const needsCompat = needsCompatibilityCheck(v.version); - const heading = v.patch && v.baseVersion !== v.displayVersion - ? `Upgrading ThingsBoard${isPE ? ' PE' : ''} to latest ${v.baseVersion} (${v.displayVersion})` + const heading = v.patch && v.baseVersion !== v.displayVersion && LATEST_PATCH_VERSIONS.has(v.version) + ? `Upgrading ThingsBoard${isPE ? ' PE' : ''} to ${v.displayVersion} (latest ${v.baseVersion} patch)` : `Upgrading ThingsBoard${isPE ? ' PE' : ''} to ${v.displayVersion}`; const prevLabel = v.x ? v.upgradableFrom : v.upgradableFrom; const prevDisplayLabel = isPE ? `${prevLabel} PE` : prevLabel; diff --git a/src/components/upgrade-instructions/WindowsUpgradeSteps.astro b/src/components/upgrade-instructions/WindowsUpgradeSteps.astro index 420cccbba..32775eed2 100644 --- a/src/components/upgrade-instructions/WindowsUpgradeSteps.astro +++ b/src/components/upgrade-instructions/WindowsUpgradeSteps.astro @@ -1,5 +1,5 @@ --- -import { UPGRADE_VERSIONS, getFamilySlug } from '~/models/upgrade-instructions'; +import { UPGRADE_VERSIONS, LATEST_PATCH_VERSIONS, getFamilySlug } from '~/models/upgrade-instructions'; import type { Products } from '~/models/site.models'; interface Props { @@ -46,8 +46,8 @@ function needsCompatibilityCheck(version: string): boolean { {versions.map((v) => { const newer = isNewerVersionScheme(v.version); const needsCompat = needsCompatibilityCheck(v.version); - const heading = v.patch && v.baseVersion !== v.displayVersion - ? `Upgrading ThingsBoard${isPE ? ' PE' : ''} to latest ${v.baseVersion} (${v.displayVersion})` + const heading = v.patch && v.baseVersion !== v.displayVersion && LATEST_PATCH_VERSIONS.has(v.version) + ? `Upgrading ThingsBoard${isPE ? ' PE' : ''} to ${v.displayVersion} (latest ${v.baseVersion} patch)` : `Upgrading ThingsBoard${isPE ? ' PE' : ''} to ${v.displayVersion}`; const prevLabel = v.x ? v.upgradableFrom : v.upgradableFrom; const prevDisplayLabel = isPE ? `${prevLabel} PE` : prevLabel; diff --git a/src/models/upgrade-instructions.ts b/src/models/upgrade-instructions.ts index 3917f9120..acf941521 100644 --- a/src/models/upgrade-instructions.ts +++ b/src/models/upgrade-instructions.ts @@ -713,3 +713,17 @@ export const UPGRADE_VERSIONS: UpgradeVersion[] = [ /** Unique version families in order, e.g. ["4.3", "4.2", "4.1", ...] */ export const UPGRADE_FAMILIES: string[] = [...new Set(UPGRADE_VERSIONS.map((v) => v.family))]; + +/** Version strings that are the newest patch within their baseVersion family. */ +export const LATEST_PATCH_VERSIONS: Set = (() => { + const seen = new Set(); + const latest = new Set(); + for (const v of UPGRADE_VERSIONS) { + if (!v.patch || !v.baseVersion) continue; + if (!seen.has(v.baseVersion)) { + seen.add(v.baseVersion); + latest.add(v.version); + } + } + return latest; +})(); diff --git a/src/pages/docs/installation/upgrade-instructions/[platform]/[familySlug].astro b/src/pages/docs/installation/upgrade-instructions/[platform]/[familySlug].astro index 34ce14f56..5b0aa0084 100644 --- a/src/pages/docs/installation/upgrade-instructions/[platform]/[familySlug].astro +++ b/src/pages/docs/installation/upgrade-instructions/[platform]/[familySlug].astro @@ -1,6 +1,6 @@ --- import StarlightPage from '@astrojs/starlight/components/StarlightPage.astro'; -import { UPGRADE_VERSIONS, UPGRADE_FAMILIES, getFamilySlug } from '~/models/upgrade-instructions'; +import { UPGRADE_VERSIONS, UPGRADE_FAMILIES, LATEST_PATCH_VERSIONS, getFamilySlug } from '~/models/upgrade-instructions'; import { Products } from '~/models/site.models'; import LinuxUpgradeSteps from '~/components/upgrade-instructions/LinuxUpgradeSteps.astro'; import WindowsUpgradeSteps from '~/components/upgrade-instructions/WindowsUpgradeSteps.astro'; @@ -42,8 +42,8 @@ const familyVersions = UPGRADE_VERSIONS.filter((v) => v.family === family); const headings = familyVersions.map((v) => ({ depth: 2, slug: v.anchor, - text: v.patch - ? `Upgrading ThingsBoard to latest ${v.baseVersion} (${v.displayVersion})` + text: v.patch && v.baseVersion !== v.displayVersion && LATEST_PATCH_VERSIONS.has(v.version) + ? `Upgrading ThingsBoard to ${v.displayVersion} (latest ${v.baseVersion} patch)` : `Upgrading ThingsBoard to ${v.displayVersion}`, })); diff --git a/src/pages/docs/pe/installation/upgrade-instructions/[platform]/[familySlug].astro b/src/pages/docs/pe/installation/upgrade-instructions/[platform]/[familySlug].astro index 77dddf633..53c66ee6d 100644 --- a/src/pages/docs/pe/installation/upgrade-instructions/[platform]/[familySlug].astro +++ b/src/pages/docs/pe/installation/upgrade-instructions/[platform]/[familySlug].astro @@ -1,6 +1,6 @@ --- import StarlightPage from '@astrojs/starlight/components/StarlightPage.astro'; -import { UPGRADE_VERSIONS, UPGRADE_FAMILIES, getFamilySlug } from '~/models/upgrade-instructions'; +import { UPGRADE_VERSIONS, UPGRADE_FAMILIES, LATEST_PATCH_VERSIONS, getFamilySlug } from '~/models/upgrade-instructions'; import { Products } from '~/models/site.models'; import LinuxUpgradeSteps from '~/components/upgrade-instructions/LinuxUpgradeSteps.astro'; import WindowsUpgradeSteps from '~/components/upgrade-instructions/WindowsUpgradeSteps.astro'; @@ -42,8 +42,8 @@ const familyVersions = UPGRADE_VERSIONS.filter((v) => v.family === family); const headings = familyVersions.map((v) => ({ depth: 2, slug: v.anchor, - text: v.patch - ? `Upgrading ThingsBoard PE to latest ${v.baseVersion} (${v.displayVersion})` + text: v.patch && v.baseVersion !== v.displayVersion && LATEST_PATCH_VERSIONS.has(v.version) + ? `Upgrading ThingsBoard PE to ${v.displayVersion} (latest ${v.baseVersion} patch)` : `Upgrading ThingsBoard PE to ${v.displayVersion}`, }));