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

Remove --location from apphosting:rollouts:create and error when more than one backend is found. #8271

Merged
merged 1 commit into from
Feb 28, 2025

Conversation

annajowang
Copy link
Contributor

Description

Remove --location from apphosting:rollouts:create and error when more than one backend is found.

Scenarios Tested

firebase apphosting:rollouts:create chickenbugs where chickenbugs is the only backend with the name => should succeed
firebase apphosting:rollouts:create chicken where there are multiple backends with this name => should error
firebase apphosting:rollouts:create chicken --location us-central1 => should complain about unknown option --location

@annajowang annajowang changed the base branch from master to next February 27, 2025 22:57
@annajowang annajowang requested a review from taeold February 27, 2025 23:41
@annajowang annajowang linked an issue Feb 27, 2025 that may be closed by this pull request
@annajowang annajowang marked this pull request as ready for review February 27, 2025 23:41
@annajowang annajowang enabled auto-merge (squash) February 27, 2025 23:41
);
if (backends.length > 1) {
throw new FirebaseError(
`You have multiple backends with the same ${backendId} ID. This is not allowed until we can support more locations. ` +
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since we already have the backends, think it would be nice to list out locations where the conflict is arising.

logWarning(
`Backends with the following primary regions are unreachable: ${unreachable.join(", ")}.\n` +
"If your backend is in one of these regions, please try again later.",
);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we return here? otherwise, it looks like we are throwing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm this was intentional on my end.
If no backend is found, no matter what, I wanted to throw an error.

but IF there are unreachable locations I wanted to warn before throwing that error. the unreachable location may impact the backend the user wants to get, but it may also be completely unreleated.

@annajowang annajowang merged commit 5122651 into next Feb 28, 2025
51 of 56 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove --location from apphosting commands
2 participants