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

feat: adding support for bq #1878

Merged
merged 13 commits into from
Oct 31, 2023
Merged

Conversation

bradmiro
Copy link
Contributor

Adding support for bq command line tool.

Copy link
Member

@bharathkkb bharathkkb left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @bradmiro

}

// ActivateCredsAndEnvVars activates credentials and exports auth related envvars.
func ActivateCredsAndEnvVars(t testing.TB, creds string) {
Copy link
Member

Choose a reason for hiding this comment

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

This does not seem BQ specific and might be a better fit in utils?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I copied this directly from gcloud.go since auth is the same - I can move it from here (and there) to utils if that makes sense. Or I can leave it as-is in gcloud.go

Copy link
Member

Choose a reason for hiding this comment

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

Good point, since the logic is the same is there any advantage to mirroring this in bq package? Maybe we can just leave it in gcloud for now.

}

// stringFromTextAndArgs convert msg and args to formatted text
func stringFromTextAndArgs(msgAndArgs ...interface{}) string {
Copy link
Member

Choose a reason for hiding this comment

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

Since we are starting to use this for both gcloud and bq, I think centralizing this in utils might be good.

Copy link
Contributor Author

@bradmiro bradmiro Oct 16, 2023

Choose a reason for hiding this comment

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

I can move this out of both files but that might result in a breaking change if the function in gcloud.go was referenced in any downstream projects - wdyt? (I'm less familiar with Golang best practices so apologies if there's an easy fix here I'm unaware of)

Copy link
Member

Choose a reason for hiding this comment

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

Since it was unexported from gcloud package it is okay to move

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Works for me.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

@bharathkkb
Copy link
Member

/gcbrun

@apeabody
Copy link
Collaborator

/gcbrun

@apeabody
Copy link
Collaborator

/gcbrun

@g-awmalik
Copy link
Collaborator

/gcbrun

@bharathkkb
Copy link
Member

/gcbrun

}

// ActivateCredsAndEnvVars activates credentials and exports auth related envvars.
func ActivateCredsAndEnvVars(t testing.TB, creds string) {
Copy link
Member

Choose a reason for hiding this comment

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

Good point, since the logic is the same is there any advantage to mirroring this in bq package? Maybe we can just leave it in gcloud for now.

@bharathkkb bharathkkb merged commit d4b0385 into GoogleCloudPlatform:master Oct 31, 2023
10 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants