Skip to content
Draft
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
8 changes: 4 additions & 4 deletions scripts/artifacts/tag-rc2ga-on-repos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions scripts/flow/ga/collect-info-for-release-issue.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -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=(
Expand All @@ -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
)
Expand Down
41 changes: 37 additions & 4 deletions scripts/flow/rc/check-images-internal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -66,6 +71,34 @@ interface Results {

type GitRepoImageMap = Record<string, string[]>;

/**
* 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.
Expand Down Expand Up @@ -152,19 +185,19 @@ async function checkImages(
const results = {} as Record<string, ImageInfo>;
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;
}

console.group(gitRepo);
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}`;
Expand Down
4 changes: 2 additions & 2 deletions scripts/flow/rc/check-tiup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down