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

Clean up Cloud Build Repos #7040

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 5 additions & 6 deletions src/apphosting/index.ts
@@ -1,4 +1,3 @@
import * as repo from "./repo";
import * as poller from "../operation-poller";
import * as apphosting from "../gcp/apphosting";
import * as githubConnections from "./githubConnections";
Expand Down Expand Up @@ -44,10 +43,9 @@
webAppName: string | null,
location: string | null,
serviceAccount: string | null,
withDevConnect: boolean,
): Promise<void> {
await Promise.all([
...(withDevConnect ? [ensure(projectId, developerConnectOrigin(), "apphosting", true)] : []),
ensure(projectId, developerConnectOrigin(), "apphosting", true),
ensure(projectId, cloudbuildOrigin(), "apphosting", true),
ensure(projectId, secretManagerOrigin(), "apphosting", true),
ensure(projectId, cloudRunApiOrigin(), "apphosting", true),
Expand Down Expand Up @@ -87,9 +85,10 @@
logWarning(`Firebase web app not set`);
}

const gitRepositoryConnection: Repository | GitRepositoryLink = withDevConnect
? await githubConnections.linkGitHubRepository(projectId, location)
: await repo.linkGitHubRepository(projectId, location);
const gitRepositoryConnection: GitRepositoryLink = await githubConnections.linkGitHubRepository(
projectId,
location,
);

const rootDir = await promptOnce({
name: "rootDir",
Expand Down Expand Up @@ -191,19 +190,19 @@
async function promptNewBackendId(
projectId: string,
location: string,
prompt: any,

Check warning on line 193 in src/apphosting/index.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unexpected any. Specify a different type
): Promise<string> {
while (true) {

Check warning on line 195 in src/apphosting/index.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unexpected constant condition
const backendId = await promptOnce(prompt);

Check warning on line 196 in src/apphosting/index.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe argument of type `any` assigned to a parameter of type `QuestionsThatReturnAString<Answers>`
try {
await apphosting.getBackend(projectId, location, backendId);
} catch (err: any) {

Check warning on line 199 in src/apphosting/index.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unexpected any. Specify a different type
if (err.status === 404) {

Check warning on line 200 in src/apphosting/index.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe member access .status on an `any` value
return backendId;
}
throw new FirebaseError(
`Failed to check if backend with id ${backendId} already exists in ${location}`,
{ original: err },

Check warning on line 205 in src/apphosting/index.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe assignment of an `any` value
);
}
logWarning(`Backend with id ${backendId} already exists in ${location}`);
Expand Down Expand Up @@ -259,9 +258,9 @@
"Default service account used to run builds and deploys for Firebase App Hosting",
"Firebase App Hosting compute service account",
);
} catch (err: any) {

Check warning on line 261 in src/apphosting/index.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unexpected any. Specify a different type
// 409 Already Exists errors can safely be ignored.
if (err.status !== 409) {

Check warning on line 263 in src/apphosting/index.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe member access .status on an `any` value
throw err;
}
}
Expand Down