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

Inconsistent behavior between GOOGLE_CLOUD_PROJECT and ProjectIdOption #11742

Closed
coryan opened this issue May 27, 2023 · 0 comments · Fixed by #11754
Closed

Inconsistent behavior between GOOGLE_CLOUD_PROJECT and ProjectIdOption #11742

coryan opened this issue May 27, 2023 · 0 comments · Fixed by #11754
Assignees
Labels
api: storage Issues related to the Cloud Storage API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@coryan
Copy link
Contributor

coryan commented May 27, 2023

We have at least 2 ways to send the project id in the storage library. The GOOGLE_CLOUD_PROJECT environment variable, the ProjectIdOption that can be used with google::cloud::Options. It seems that some functions only use one and not the other. And some functions consume a project_id parameter for extra fun.

We need to make this consistent. Application developers should not need to guess which one applies. Keep in mind the option precedence hierarchy.

We have at least 2 ways to send the project id in the storage library.

Make that 3. For HMAC keys we also have OverrideDefaultProject. Sigh.

The story of how we got here is hilarious, but does not fix anything.


This issue is from https://stackoverflow.com/questions/76345053/how-to-set-the-project-id-for-c-storage-client

User ADC: If the environment variable GOOGLE_CLOUD_PROJECT is set, the CreateV4SignedUrl works without specifying the SigningAccount parameter. If the environment variable is not set, then the SigningAccount parameter is required.

However, the Project ID should be able to be set via the gcs::Client() option gcs::ProjectIdOption>(project_id), but that seems to be implemented but never processed later in the code.

Originally posted by @jhanley-com in #11740 (comment)

@coryan coryan added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. priority: p2 Moderately-important priority. Fix may not be included in next release. api: storage Issues related to the Cloud Storage API. labels May 27, 2023
@coryan coryan self-assigned this May 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the Cloud Storage API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant