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

[C++] Add option to set the default project id in GcsFilesystem #36227

Closed
coryan opened this issue Jun 22, 2023 · 0 comments · Fixed by #36228
Closed

[C++] Add option to set the default project id in GcsFilesystem #36227

coryan opened this issue Jun 22, 2023 · 0 comments · Fixed by #36228

Comments

@coryan
Copy link
Contributor

coryan commented Jun 22, 2023

Describe the enhancement requested

To create a bucket the client library must be configured with a default project. This can be done via the GOOGLE_CLOUD_CPP environment variable, or via google::cloud::storage::ProjectIdOption. There is no way to set the option in the GcsFilesystem class, which forces applications and test to rely on spooky environment variables.

Component(s)

C++

@kou kou changed the title Add option to set the default project id in GcsFilesystem [C++] Add option to set the default project id in GcsFilesystem Jun 22, 2023
kou pushed a commit that referenced this issue Jun 22, 2023
### Rationale for this change

This fixes #36227, originally motivated by the problems in #36119, but seems like a valuable feature in any case.

### What changes are included in this PR?

- Refactor some code to make it testable.
- Add a new `std::optional<std::string>` field to the `GcsOptions` class.

### Are these changes tested?

Yes, I expanded the unit tests.

### Are there any user-facing changes?

Yes. I updated the field documentation.  If I missed some documentation please let me know.

I am also not familiar with the steps required to update the Python wrappers, if there is some documentation to follow I would appreciate it.  I can expand this PR or send a separate one, your call.

* Closes: #36227

Authored-by: Carlos O'Ryan <coryan@google.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
@kou kou added this to the 13.0.0 milestone Jun 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants