Closed jamesward closed 5 years ago
Sounds like it should be in the first release.
This exists in the existing button and I don't think we should drop it.
This is a bit too much gcloud output parsing (sadly).
I think we can redirect users to New Project UI as we do in #25, which prompts them with associating a billing account?
Why can't we do something similar to what the current button does?
Unless this happens to a noticeable % of users, I am not sure if it’s worth doing.
People can read the gcloud error and re-click the button, it’s not a huge deal.
Setting up billing on a project is a different and non-instinctive step after the project is created. So it seems like folks new to the platform could run into this. I did when I was getting started.
Since the primary purpose of the button is to get people new to the platform to give it a try, the more hand holding we can do, the better. It is worth trying to button from zero (no account, etc) and see how it all flows. That kind of user is the target for the button.
So maybe we can find a better way to validate a billing account?
Got it. This is more severe than I initially anticipated.
I'll try to get this in the first version.
Actually when no projects are found, we send users to https://console.cloud.google.com/cloud-resource-manager, which clearly asks for a billing account:
How does someone end up with a project without a billing account?
Found this command which can help detecting:
$ gcloud beta billing projects describe ahmetb-samples-playground --format=yaml
billingAccountName: billingAccounts/0050EC-505932-A9F334
billingEnabled: true
name: projects/ahmetb-samples-playground/billingInfo
projectId: ahmetb-samples-playground
The only problem would be if they decide to change this command from beta to GA, then backport GA to beta, we would break in the downstream. But I think it's a fair amount of risk.
Sandeep tells me that this command fails if there's no billing account ––in a weird way:
$ gcloud beta billing projects describe --format=json x
API [cloudbilling.googleapis.com] not enabled on project
[x]. Would you like to enable and retry (this will take a
few minutes)? (y/N)?
Apparently enabling another API has an output like this
ERROR: (gcloud.beta.billing.projects.describe) User [y@gmail.com] does
not have permission to access project [x] (or it may not exist):
Cloud Billing API has not been used in project x before or it is dis
abled. Enable it by visiting https://console.developers.google.com/apis/api/clou
dbilling.googleapis.com/overview?project=x then retry. If you enable
d this API recently, wait a few minutes for the action to propagate to our syste
ms and retry.
- '@type': type.googleapis.com/google.rpc.Help
links:
- description: Google developers console API activation
url: https://console.developers.google.com/apis/api/cloudbilling.googleapis.
com/overview?project=1027933777022
but I really don't want to parse the output.
In my case when I go to https://console.cloud.google.com/ without any projects, it takes me to https://console.cloud.google.com/getting-started
Then use the project selector to create a project, which takes me to: https://console.cloud.google.com/projectcreate
But I don't have an option to select a billing account there because I don't have a billing account. So I get a project without a billing account.
For the record, it is possible to create a project without billing via gcloud projects create
, however it's nearly impossible (I wasn't able to find it) create a project on Cloud Console that doesn't prompt for a billing account.
That said, billing accounts can also go "inactive" (say an expired card), and the check we added covers both cases.
Here is the UI I get on my demo account:
But on my non-google work account I am forced to select a billing account.
Like: