Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -116,7 +116,7 @@ function repoLink(ver: string): string | null {
{prevHref ? (
<a href={prevHref}>{prevDisplayLabel}</a>
) : prevDisplayLabel}
{v.patch && <>{' '}or any {v.baseVersion} patch</>}.{' '}
{v.patch && <>{' '}or any {v.patchableFrom ?? v.baseVersion} patch</>}.{' '}
In order to upgrade to <strong>{isPE ? `${v.displayVersion}PE` : v.displayVersion}</strong> you need to{' '}
{prevHref ? (
<><a href={prevHref}><strong>upgrade to {prevDisplayLabel} first</strong></a>.</>
Expand Down Expand Up @@ -163,7 +163,7 @@ function repoLink(ver: string): string | null {
<p class="starlight-aside__title" aria-hidden="true">Caution</p>
<div class="starlight-aside__content">
{v.patch ? (
<p>If you are upgrading from {v.upgradableFrom}, you <strong>must</strong> run the script below. However, if you are upgrading from version {`${v.baseVersion}.x`}, <strong>DO NOT</strong> run the upgrade script; proceed directly to starting the service.</p>
<p>If you are upgrading from {v.upgradableFrom}, you <strong>must</strong> run the script below. However, if you are upgrading from version {v.patchableFrom ?? v.baseVersion + '.x'}, <strong>DO NOT</strong> run the upgrade script; proceed directly to starting the service.</p>
) : (
<p>If you are upgrading from version {v.upgradableFrom}, you must run the script below.</p>
)}
Expand Down
12 changes: 6 additions & 6 deletions src/components/upgrade-instructions/DockerUpgradeSteps.astro
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -93,7 +93,7 @@ function versionTag(ver: string): string {
{prevHref ? (
<a href={prevHref}>{prevDisplayLabel}</a>
) : prevDisplayLabel}
{v.patch && <>{' '}or any {v.baseVersion} patch</>}.{' '}
{v.patch && <>{' '}or any {v.patchableFrom ?? v.baseVersion} patch</>}.{' '}
In order to upgrade to <strong>{isPE ? `${v.displayVersion}PE` : v.displayVersion}</strong> you need to{' '}
{prevHref ? (
<><a href={prevHref}><strong>upgrade to {prevDisplayLabel} first</strong></a>.</>
Expand Down Expand Up @@ -121,7 +121,7 @@ function versionTag(ver: string): string {
<p class="starlight-aside__title" aria-hidden="true">Caution</p>
<div class="starlight-aside__content">
{v.patch ? (
<p>If you are upgrading from {v.upgradableFrom}, you <strong>must</strong> run the script below. However, if you are upgrading from version {`${v.baseVersion}.x`}, <strong>DO NOT</strong> run the upgrade script; proceed directly to starting the service.</p>
<p>If you are upgrading from {v.upgradableFrom}, you <strong>must</strong> run the script below. However, if you are upgrading from version {v.patchableFrom ?? v.baseVersion + '.x'}, <strong>DO NOT</strong> run the upgrade script; proceed directly to starting the service.</p>
) : (
<p>If you are upgrading from version {v.upgradableFrom}, you must run the script below.</p>
)}
Expand All @@ -143,7 +143,7 @@ function versionTag(ver: string): string {
<p class="starlight-aside__title" aria-hidden="true">Caution</p>
<div class="starlight-aside__content">
{v.patch ? (
<p>If you are upgrading from {v.upgradableFrom}, you <strong>must</strong> run the script below. However, if you are upgrading from version {`${v.baseVersion}.x`}, <strong>DO NOT</strong> run the upgrade script; proceed directly to starting the service.</p>
<p>If you are upgrading from {v.upgradableFrom}, you <strong>must</strong> run the script below. However, if you are upgrading from version {v.patchableFrom ?? v.baseVersion + '.x'}, <strong>DO NOT</strong> run the upgrade script; proceed directly to starting the service.</p>
) : (
<p>If you are upgrading from version {v.upgradableFrom}, you must run the script below.</p>
)}
Expand Down
10 changes: 5 additions & 5 deletions src/components/upgrade-instructions/LinuxUpgradeSteps.astro
Original file line number Diff line number Diff line change
@@ -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';

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -124,7 +124,7 @@ function needsCompatibilityCheck(version: string): boolean {
<a href={prevHref}>{prevDisplayLabel}</a>
) : (
prevDisplayLabel
)}{v.patch ? <>{' '}or any {v.baseVersion} patch</> : ''}.{' '}
)}{v.patch ? <>{' '}or any {v.patchableFrom ?? v.baseVersion} patch</> : ''}.{' '}
In order to upgrade to <strong>{isPE ? `${v.displayVersion}PE` : v.displayVersion}</strong> you need to{' '}
{prevHref ? (
<><a href={prevHref}><strong>upgrade to {prevDisplayLabel} first</strong></a>.</>
Expand Down Expand Up @@ -198,7 +198,7 @@ function needsCompatibilityCheck(version: string): boolean {
<p class="starlight-aside__title" aria-hidden="true">Caution</p>
<div class="starlight-aside__content">
{v.patch ? (
<p>If you are upgrading from {v.upgradableFrom}, you <strong>must</strong> run the script below. However, if you are upgrading from version {`${v.baseVersion}.x`}, <strong>DO NOT</strong> run the upgrade script; proceed directly to starting the service.</p>
<p>If you are upgrading from {v.upgradableFrom}, you <strong>must</strong> run the script below. However, if you are upgrading from version {v.patchableFrom ?? v.baseVersion + '.x'}, <strong>DO NOT</strong> run the upgrade script; proceed directly to starting the service.</p>
) : (
<p>If you are upgrading from version {v.upgradableFrom}, you must run the script below.</p>
)}
Expand Down
10 changes: 5 additions & 5 deletions src/components/upgrade-instructions/WindowsUpgradeSteps.astro
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -113,7 +113,7 @@ function needsCompatibilityCheck(version: string): boolean {
{prevHref ? (
<a href={prevHref}>{prevDisplayLabel}</a>
) : prevDisplayLabel}
{v.patch && <>{' '}or any {v.baseVersion} patch</>}.{' '}
{v.patch && <>{' '}or any {v.patchableFrom ?? v.baseVersion} patch</>}.{' '}
In order to upgrade to <strong>{isPE ? `${v.displayVersion}PE` : v.displayVersion}</strong> you need to{' '}
{prevHref ? (
<><a href={prevHref}><strong>upgrade to {prevDisplayLabel} first</strong></a>.</>
Expand Down Expand Up @@ -182,7 +182,7 @@ function needsCompatibilityCheck(version: string): boolean {
<p class="starlight-aside__title" aria-hidden="true">Caution</p>
<div class="starlight-aside__content">
{v.patch ? (
<p>If you are upgrading from {v.upgradableFrom}, you <strong>must</strong> run the script below. However, if you are upgrading from version {`${v.baseVersion}.x`}, <strong>DO NOT</strong> run the upgrade script; proceed directly to starting the service.</p>
<p>If you are upgrading from {v.upgradableFrom}, you <strong>must</strong> run the script below. However, if you are upgrading from version {v.patchableFrom ?? v.baseVersion + '.x'}, <strong>DO NOT</strong> run the upgrade script; proceed directly to starting the service.</p>
) : (
<p>If you are upgrading from version {v.upgradableFrom}, you must run the script below.</p>
)}
Expand Down
19 changes: 19 additions & 0 deletions src/models/upgrade-instructions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -708,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<string> = (() => {
const seen = new Set<string>();
const latest = new Set<string>();
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;
})();
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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}`,
}));

Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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}`,
}));

Expand Down