Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(script/flow/rc): fix flow check script #3191

Merged
merged 1 commit into from
Oct 29, 2024
Merged
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
16 changes: 11 additions & 5 deletions scripts/flow/rc/check-images-internal.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env deno run --allow-run --allow-net --allow-write
import * as yaml from "jsr:@std/yaml@^1.0.0";
import { parseArgs } from "jsr:@std/cli@^1.0.1";
#!/usr/bin/env -S deno run --allow-run --allow-net --allow-write
import * as yaml from "jsr:@std/yaml@1.0.5";
import { parseArgs } from "jsr:@std/cli@1.0.6";

const platforms = [
"linux/amd64",
Expand Down Expand Up @@ -156,7 +156,7 @@ async function gatheringGithubGitSha(repo: string, branch: string) {
);
const { sha } = await res.json();
console.info(`got github git sha of ${repo}@${branch}: ${sha}`);
return sha;
return sha || "";
}

function checkTools() {
Expand All @@ -175,6 +175,11 @@ 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") {
continue;
}

console.group(gitRepo);
const gitSha = await gatheringGithubGitSha(gitRepo, branch);

Expand Down Expand Up @@ -216,7 +221,7 @@ async function main(
}: CliParams,
) {
checkTools();
const totalResults = {} as Record<string, any>;
const totalResults = {} as Record<string, Record<string, ImageInfo>>;
const totalFailedPkgs = {} as Record<string, string[]>;

{
Expand Down Expand Up @@ -244,6 +249,7 @@ async function main(
totalResults["enterprise"] = results;
totalFailedPkgs["enterprise"] = failedPkgs;
}

// write the results to a yaml file.
await Deno.writeTextFile(save_to, yaml.stringify(totalResults));

Expand Down
11 changes: 8 additions & 3 deletions scripts/flow/rc/check-tiup.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env deno run --allow-run --allow-net --allow-write
import * as yaml from "jsr:@std/yaml@^1.0.0";
import { parseArgs } from "jsr:@std/cli@^1.0.1";
#!/usr/bin/env -S deno run --allow-run --allow-net --allow-write
import * as yaml from "jsr:@std/yaml@1.0.5";
import { parseArgs } from "jsr:@std/cli@1.0.6";

const TiupPlatforms = [
"darwin/amd64",
Expand Down Expand Up @@ -205,6 +205,11 @@ async function main(

const results = { tiup: {} } as Results;
for (const [ociRepo, pkgs] of Object.entries(OCI2Tiup)) {
// tidb-binlog is deprecated since v8.4.0, skip it.
if (version >= "v8.4.0" && ociRepo === "pingcap/tidb-binlog/package") {
continue;
}

console.group(ociRepo);
const ociInfos = {} as Record<string, OciMetadata>;
for (const platform of TiupPlatforms) {
Expand Down