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

use only site id from site name #6565

Merged
merged 3 commits into from
Dec 4, 2023
Merged
Changes from 1 commit
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
5 changes: 4 additions & 1 deletion src/hosting/runTags.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { basename } from "node:path";
leoortizz marked this conversation as resolved.
Show resolved Hide resolved
import * as run from "../gcp/run";
import * as api from "./api";
import { FirebaseError } from "../error";
Expand All @@ -23,7 +24,9 @@
// id and number.
const validTagsByServiceByRegion: Record<string, Record<string, Set<string>>> = {};
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";
});
Expand Down Expand Up @@ -114,11 +117,11 @@
})
.some((length) => length >= garbageCollectionThreshold);
if (needsGC) {
await exports.gcTagsForServices(project, services);

Check warning on line 120 in src/hosting/runTags.ts

View workflow job for this annotation

GitHub Actions / lint (18)

Unsafe member access .gcTagsForServices on an `any` value

Check warning on line 120 in src/hosting/runTags.ts

View workflow job for this annotation

GitHub Actions / lint (18)

Unsafe call of an `any` typed value
}

// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const tags: Record<string, Record<string, string>> = await exports.ensureLatestRevisionTagged(

Check warning on line 124 in src/hosting/runTags.ts

View workflow job for this annotation

GitHub Actions / lint (18)

Unsafe member access .ensureLatestRevisionTagged on an `any` value

Check warning on line 124 in src/hosting/runTags.ts

View workflow job for this annotation

GitHub Actions / lint (18)

Unsafe call of an `any` typed value
services,
`fh-${version}`
);
Expand Down Expand Up @@ -160,7 +163,7 @@
if (alreadyTagged) {
// Null assertion is safe because the predicate that found alreadyTagged
// checked for tag.
tags[region][serviceId] = alreadyTagged.tag!;

Check warning on line 166 in src/hosting/runTags.ts

View workflow job for this annotation

GitHub Actions / lint (18)

Forbidden non-null assertion
continue;
}
tags[region][serviceId] = defaultTag;
Expand Down
Loading