From e8ef1fbd9762d9757b2ec10bbd2da9564841d961 Mon Sep 17 00:00:00 2001 From: wuhuizuo Date: Thu, 27 Nov 2025 15:34:32 +0800 Subject: [PATCH 1/5] fix(scripts): update ticdc publishing threshold to v8.5.4 Bump previous/current release to v8.5.3 and v8.5.4 Make collect-info-for-release-issue.sh executable --- scripts/artifacts/tag-rc2ga-on-repos.sh | 8 ++++---- scripts/flow/ga/collect-info-for-release-issue.sh | 6 +++--- scripts/flow/rc/check-images-internal.ts | 2 +- scripts/flow/rc/check-tiup.ts | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) mode change 100644 => 100755 scripts/flow/ga/collect-info-for-release-issue.sh diff --git a/scripts/artifacts/tag-rc2ga-on-repos.sh b/scripts/artifacts/tag-rc2ga-on-repos.sh index 081b200f06..e54a75cb8f 100755 --- a/scripts/artifacts/tag-rc2ga-on-repos.sh +++ b/scripts/artifacts/tag-rc2ga-on-repos.sh @@ -51,8 +51,8 @@ function tag_oci_artifact_repos() { "pingcap/tidb-binlog/package" ) fi - # pingcap/ticdc/package published since v9.0.0 - if [[ "$(printf '%s\n' "v9.0.0" "$ga_ver" | sort -V | head -n1)" == "v9.0.0" ]]; then + # pingcap/ticdc/package published since v8.5.4 + if [[ "$(printf '%s\n' "v8.5.4" "$ga_ver" | sort -V | head -n1)" == "v8.5.4" ]]; then repos+=( "pingcap/ticdc/package" ) @@ -115,8 +115,8 @@ function tag_oci_image_repos() { "pingcap/tidb-binlog/image" ) fi - # ticdc will publish from ticdc repo since v9.0.0 - if [[ "$(printf '%s\n' "v9.0.0" "$ga_ver" | sort -V | head -n1)" == "v9.0.0" ]]; then + # ticdc will publish from ticdc repo since v8.5.4 + if [[ "$(printf '%s\n' "v8.5.4" "$ga_ver" | sort -V | head -n1)" == "v8.5.4" ]]; then # remove "pingcap/tiflow/images/cdc": images=("${images[@]/pingcap\/tiflow\/images\/cdc/}") # Filter out empty elements that might result from the removal diff --git a/scripts/flow/ga/collect-info-for-release-issue.sh b/scripts/flow/ga/collect-info-for-release-issue.sh old mode 100644 new mode 100755 index b34d340680..b0e124973b --- a/scripts/flow/ga/collect-info-for-release-issue.sh +++ b/scripts/flow/ga/collect-info-for-release-issue.sh @@ -1,8 +1,8 @@ #! /usr/bin/env bash # This script collects information about the current release and generates markdown for release issues. -previous_release="v8.5.1" # comment it when current release is not a patch release. -current_release="v8.5.2" +previous_release="v8.5.3" # comment it when current release is not a patch release. +current_release="v8.5.4" ### !!! Please update the list of repositories before running this script. repos=( @@ -15,7 +15,7 @@ repos=( pingcap/ng-monitoring pingcap/tidb-dashboard - pingcap/ticdc # started since v9.0.0 + pingcap/ticdc # started since v8.5.4 pingcap/tidb-tools # migrated to pingcap/tiflow since v9.0.0 pingcap/tidb-binlog # deprecated since v8.3.0 ) diff --git a/scripts/flow/rc/check-images-internal.ts b/scripts/flow/rc/check-images-internal.ts index 11665603e2..d0f8002b60 100755 --- a/scripts/flow/rc/check-images-internal.ts +++ b/scripts/flow/rc/check-images-internal.ts @@ -155,7 +155,7 @@ async function checkImages( if (version >= "v8.4.0" && gitRepo === "pingcap/tidb-binlog") { continue; } - // ticdc is initilized since v9.0.0 + // ticdc is initilized since v8.5.4 if (version <= "v8.5.3" && gitRepo === "pingcap/ticdc") { continue; } diff --git a/scripts/flow/rc/check-tiup.ts b/scripts/flow/rc/check-tiup.ts index 4da3e1456d..642d239220 100755 --- a/scripts/flow/rc/check-tiup.ts +++ b/scripts/flow/rc/check-tiup.ts @@ -220,8 +220,8 @@ async function main( if (version >= "v8.4.0" && ociRepo === "pingcap/tidb-binlog/package") { continue; } - // ticdc is initilized since v9.0.0 - if (version <= "v9.0.0" && ociRepo === "pingcap/ticdc/package") { + // ticdc is initilized since v8.5.4 + if (version <= "v8.5.4" && ociRepo === "pingcap/ticdc/package") { continue; } From e37596846a49c4320ac43a46a236ce2d5668df92 Mon Sep 17 00:00:00 2001 From: wuhuizuo Date: Thu, 27 Nov 2025 15:37:40 +0800 Subject: [PATCH 2/5] Update scripts/artifacts/tag-rc2ga-on-repos.sh Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- scripts/artifacts/tag-rc2ga-on-repos.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/artifacts/tag-rc2ga-on-repos.sh b/scripts/artifacts/tag-rc2ga-on-repos.sh index e54a75cb8f..af4c97cdb4 100755 --- a/scripts/artifacts/tag-rc2ga-on-repos.sh +++ b/scripts/artifacts/tag-rc2ga-on-repos.sh @@ -116,7 +116,7 @@ function tag_oci_image_repos() { ) fi # ticdc will publish from ticdc repo since v8.5.4 - if [[ "$(printf '%s\n' "v8.5.4" "$ga_ver" | sort -V | head -n1)" == "v8.5.4" ]]; then + if [[ "$(printf '%s\n' "v8.5.4" "$ga_ver" | sort -V | tail -n1)" == "$ga_ver" ]]; then # remove "pingcap/tiflow/images/cdc": images=("${images[@]/pingcap\/tiflow\/images\/cdc/}") # Filter out empty elements that might result from the removal From 22d31f68b806cd7ca8cebb0da3c6397fd656cf04 Mon Sep 17 00:00:00 2001 From: wuhuizuo Date: Thu, 27 Nov 2025 15:37:59 +0800 Subject: [PATCH 3/5] Update scripts/artifacts/tag-rc2ga-on-repos.sh Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- scripts/artifacts/tag-rc2ga-on-repos.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/artifacts/tag-rc2ga-on-repos.sh b/scripts/artifacts/tag-rc2ga-on-repos.sh index af4c97cdb4..9b8ade6e6d 100755 --- a/scripts/artifacts/tag-rc2ga-on-repos.sh +++ b/scripts/artifacts/tag-rc2ga-on-repos.sh @@ -52,7 +52,7 @@ function tag_oci_artifact_repos() { ) fi # pingcap/ticdc/package published since v8.5.4 - if [[ "$(printf '%s\n' "v8.5.4" "$ga_ver" | sort -V | head -n1)" == "v8.5.4" ]]; then + if [[ "$(printf '%s\n' "v8.5.4" "$ga_ver" | sort -V | tail -n1)" == "$ga_ver" ]]; then repos+=( "pingcap/ticdc/package" ) From 8ee117a4e056a9aebe27d19b733427de28c970da Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 27 Nov 2025 07:39:06 +0000 Subject: [PATCH 4/5] Initial plan From a88ed27d2db34ac165d34d39069d2790f5ec319b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 27 Nov 2025 07:44:12 +0000 Subject: [PATCH 5/5] fix: use semantic versioning for version comparisons Co-authored-by: wuhuizuo <2574558+wuhuizuo@users.noreply.github.com> --- scripts/flow/rc/check-images-internal.ts | 39 ++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/scripts/flow/rc/check-images-internal.ts b/scripts/flow/rc/check-images-internal.ts index d0f8002b60..e07cf33279 100755 --- a/scripts/flow/rc/check-images-internal.ts +++ b/scripts/flow/rc/check-images-internal.ts @@ -2,6 +2,11 @@ import * as yaml from "jsr:@std/yaml@1.0.5"; import { parseArgs } from "jsr:@std/cli@1.0.6"; import { Octokit } from "https://esm.sh/octokit@4.0.2?dts"; +import { + greaterOrEqual, + lessThanOrEqual, + parse as parseSemver, +} from "jsr:@std/semver@^1.0.4"; const platforms = [ "linux/amd64", @@ -66,6 +71,34 @@ interface Results { type GitRepoImageMap = Record; +/** + * Normalize version string for semver parsing. + * Removes 'v' prefix and '-enterprise' suffix if present. + */ +function normalizeVersion(version: string): string { + return version.replace(/^v/, "").replace(/-enterprise$/, ""); +} + +/** + * Compare two version strings using semantic versioning. + * Returns true if version >= threshold. + */ +function versionGreaterOrEqual(version: string, threshold: string): boolean { + const v = parseSemver(normalizeVersion(version)); + const t = parseSemver(normalizeVersion(threshold)); + return greaterOrEqual(v, t); +} + +/** + * Compare two version strings using semantic versioning. + * Returns true if version <= threshold. + */ +function versionLessThanOrEqual(version: string, threshold: string): boolean { + const v = parseSemver(normalizeVersion(version)); + const t = parseSemver(normalizeVersion(threshold)); + return lessThanOrEqual(v, t); +} + function validate(info: ImageInfo) { info.ok = true; // assert all git sha are same in oci files. @@ -152,11 +185,11 @@ async function checkImages( const results = {} as Record; for (const [gitRepo, map] of Object.entries(mm)) { // tidb-binlog is deprecated since v8.4.0, skip it. - if (version >= "v8.4.0" && gitRepo === "pingcap/tidb-binlog") { + if (versionGreaterOrEqual(version, "v8.4.0") && gitRepo === "pingcap/tidb-binlog") { continue; } // ticdc is initilized since v8.5.4 - if (version <= "v8.5.3" && gitRepo === "pingcap/ticdc") { + if (versionLessThanOrEqual(version, "v8.5.3") && gitRepo === "pingcap/ticdc") { continue; } @@ -164,7 +197,7 @@ async function checkImages( const gitSha = await gatheringGithubGitSha(ghClient, gitRepo, branch); for (const src of map) { - if (version >= "v8.5.4" && src === "pingcap/tiflow/images/cdc") { + if (versionGreaterOrEqual(version, "v8.5.4") && src === "pingcap/tiflow/images/cdc") { continue; } const imageUrl = `${oci_registry}/${src}:${version}`;