Skip to content

feat(internal/detect): add helper to detect projectID from env#4582

Merged
codyoss merged 5 commits intogoogleapis:masterfrom
codyoss:detect-project
Aug 13, 2021
Merged

feat(internal/detect): add helper to detect projectID from env#4582
codyoss merged 5 commits intogoogleapis:masterfrom
codyoss:detect-project

Conversation

@codyoss
Copy link
Copy Markdown
Member

@codyoss codyoss commented Aug 9, 2021

This is meant to be used by certain veneers so that we can detect the projectID in a consistent manner. Future PRs will use this logic.
Fixes: #1294

@codyoss codyoss requested a review from a team August 9, 2021 21:17
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Aug 9, 2021
@codyoss
Copy link
Copy Markdown
Member Author

codyoss commented Aug 9, 2021

cc @crwilcox Some of your libraries can use this in the future. I think you brought this up not too long ago...

Copy link
Copy Markdown
Contributor

@noahdietz noahdietz left a comment

Choose a reason for hiding this comment

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

LGTM but is there a way to add a test?

@crwilcox
Copy link
Copy Markdown
Contributor

crwilcox commented Aug 9, 2021

How does this differ from https://github.com/googleapis/google-cloud-go/blob/master/firestore/client.go#L83 / https://github.com/googleapis/google-cloud-go/blob/master/firestore/client.go#L104

Is the goal here to centralize this as most veneers have this (more or less) duplicated code?

@codyoss
Copy link
Copy Markdown
Member Author

codyoss commented Aug 10, 2021

@crwilcox

Is the goal here to centralize this as most veneers have this (more or less) duplicated code?

Yes. Just wanted to have a consistent implementation for all to use.

@codyoss
Copy link
Copy Markdown
Member Author

codyoss commented Aug 13, 2021

@noahdietz Done.

@codyoss codyoss added the automerge Merge the pull request once unit tests and other checks pass. label Aug 13, 2021
@codyoss codyoss merged commit cc65d94 into googleapis:master Aug 13, 2021
@codyoss codyoss deleted the detect-project branch August 13, 2021 20:56
@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Merge the pull request once unit tests and other checks pass. label Aug 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

all: provide project ID detection

3 participants