From b8088a4ecf6847e058e14da98b88fa81b61176c8 Mon Sep 17 00:00:00 2001 From: Leonardo Ortiz Date: Sun, 3 Dec 2023 03:11:40 -0300 Subject: [PATCH 1/3] use basename for site.name --- src/hosting/runTags.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/hosting/runTags.ts b/src/hosting/runTags.ts index 347022a734b..fd3abe8aa73 100644 --- a/src/hosting/runTags.ts +++ b/src/hosting/runTags.ts @@ -1,3 +1,4 @@ +import { basename } from "node:path"; import * as run from "../gcp/run"; import * as api from "./api"; import { FirebaseError } from "../error"; @@ -23,7 +24,9 @@ export async function gcTagsForServices(project: string, services: run.Service[] // id and number. const validTagsByServiceByRegion: Record>> = {}; const sites = await api.listSites(project); - const allVersionsNested = await Promise.all(sites.map((site) => api.listVersions(site.name))); + const allVersionsNested = await Promise.all( + sites.map((site) => api.listVersions(basename(site.name))) + ); const activeVersions = [...flattenArray(allVersionsNested)].filter((version) => { return version.status === "CREATED" || version.status === "FINALIZED"; }); From 04cc74130c954e13f35b361956c84b93da6a948f Mon Sep 17 00:00:00 2001 From: Leonardo Ortiz Date: Mon, 4 Dec 2023 13:42:36 -0300 Subject: [PATCH 2/3] posix basename --- src/hosting/runTags.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hosting/runTags.ts b/src/hosting/runTags.ts index fd3abe8aa73..f6d17f3d7cc 100644 --- a/src/hosting/runTags.ts +++ b/src/hosting/runTags.ts @@ -1,4 +1,4 @@ -import { basename } from "node:path"; +import { posix } from "node:path"; import * as run from "../gcp/run"; import * as api from "./api"; import { FirebaseError } from "../error"; @@ -25,7 +25,7 @@ export async function gcTagsForServices(project: string, services: run.Service[] const validTagsByServiceByRegion: Record>> = {}; const sites = await api.listSites(project); const allVersionsNested = await Promise.all( - sites.map((site) => api.listVersions(basename(site.name))) + sites.map((site) => api.listVersions(posix.basename(site.name))) ); const activeVersions = [...flattenArray(allVersionsNested)].filter((version) => { return version.status === "CREATED" || version.status === "FINALIZED"; From 90a71de4a94a26d88cb80cabdac7ffc3b50c3115 Mon Sep 17 00:00:00 2001 From: Leonardo Ortiz Date: Mon, 4 Dec 2023 14:40:59 -0300 Subject: [PATCH 3/3] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 065a1de7870..4259ea12d33 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,3 +2,4 @@ - Fixed an issue where `--non-interactive` flag is not respected in Firestore indexes deploys. (#6539) - Fixed an issue where `login:use` would not work outside of a Firebase project directory. (#6526) - Prevent app router static `not-found` requiring a Cloud Function in Next.js deployments. (#6558) +- Use only site id from site name in list versions API. (#6565)