pulumi / pulumi-gcp

A Google Cloud Platform (GCP) Pulumi resource package, providing multi-language access to GCP
Apache License 2.0
183 stars 53 forks source link

Remove "unable to detect a global setting for GCP Project" warning. #1168

Open shadiramadan opened 1 year ago

shadiramadan commented 1 year ago

https://github.com/pulumi/pulumi-gcp/blob/f0115d920cb100c5fc4f39abfb54d90bf6146b61/provider/resources.go#L318

I have pulumi configuration which creates GCP projects (thus no global project ID is set) and I've found this warning very annoying in my outputs.

Could we remove or supress this specific warning?

iwahbe commented 1 year ago

Hi @shadiramadan. Thanks for telling us about the issue. I agree that the warning should be addressable. Looks like the warning was put in to address https://github.com/pulumi/pulumi-gcp/issues/890.

guineveresaenger commented 1 year ago

Per discussion with @iwahbe:

We believe we can implement this in the following way:

  1. When the warning first appears, we can allow/instruct the user to explicitly bypass it via explicitly setting gcp:project to something like "No Project" or any other string that is invalid to use for GCP Projects and thus not a potential Project name.
  2. We then look for this value in our pre-config check and set Project to a pulumi-internal constant.
  3. When this constant is detected on a stack, we know the user does not need the warning, and skip it.
  4. We will adjust the warning text to include override instructions.
SpainTrain commented 2 weeks ago

Curious whether there is any progress on this?

Configurable warnings (generally, and specific to this) are very helpful for better DX. In our case developers think they are doing something wrong when they interact with our stacks because we do not use the default project feature. Thanks!