这是indexloc提供的服务,不要输入任何密码
Skip to content

feat(cli): add TURBO_CI_VENDOR_ENV_KEY #1622

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

Merged

Conversation

tknickman
Copy link
Member

Support blocklist for automatically include env vars

@vercel
Copy link

vercel bot commented Aug 3, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Updated
turbo-site ⬜️ Ignored (Inspect) Aug 3, 2022 at 8:45PM (UTC)

@tknickman tknickman changed the title feat(cli): support env var blocklist feat(cli): add TURBO_CI_VENDOR_ENV_KEY Aug 3, 2022
styfle pushed a commit to vercel/vercel that referenced this pull request Aug 3, 2022
Copy link
Contributor

@mehulkar mehulkar left a comment

Choose a reason for hiding this comment

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

Still learning to read Go syntax, so don't trust this review too much, but generally lgtm!

func getEnvPairsFromPrefixes(includePrefixes []string, excludePrefix string, allEnvVars map[string]string) []string {
allEnvPairs := []string{}
for _, includePrefix := range includePrefixes {
hashableFrameworkEnvPairs := getEnvPairsFromPrefix(includePrefix, excludePrefix, allEnvVars)
Copy link
Contributor

Choose a reason for hiding this comment

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

I would probably have inlined this logic, because I get confused when there are two functions named the same, but just a style preference (and I see that there were already two functions)

Copy link
Contributor

Choose a reason for hiding this comment

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

This is definitely a path-dependence outcome. It'd have been fine the other way but the path we took to get here had this outcome.

Copy link
Member Author

Choose a reason for hiding this comment

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

A good callout - I actually did this originally because I was going to call getEnvPairsFromPrefix in a goroutine, but decided it wasn't worth it since we're dealing with pretty small scale here.

@kodiakhq kodiakhq bot merged commit 16dcf5a into main Aug 3, 2022
@kodiakhq kodiakhq bot deleted the tomknickman/turbo-224-support-blocklist-for-automatic-env branch August 3, 2022 22:11
for k, v := range allEnvVars {
if strings.HasPrefix(k, prefix) {
hashableFrameworkEnvPairs = append(hashableFrameworkEnvPairs, fmt.Sprintf("%v=%v", k, v))
if excludePrefix != "" && strings.HasPrefix(k, excludePrefix) {
Copy link
Contributor

Choose a reason for hiding this comment

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

🎉

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