diff --git a/scripts/artifacts/tag-rc2ga-on-repos.sh b/scripts/artifacts/tag-rc2ga-on-repos.sh index 081b200f06..9b8ade6e6d 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 | tail -n1)" == "$ga_ver" ]]; 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 | 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 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..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 v9.0.0 - if (version <= "v8.5.3" && gitRepo === "pingcap/ticdc") { + // ticdc is initilized since v8.5.4 + 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}`; 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; }