sourcegraph / sourcegraph-public-snapshot

Code AI platform with Code Search & Cody
https://sourcegraph.com
Other
10.11k stars 1.29k forks source link

sg: do not warn about dev build if flags are configured #64529

Closed keegancsmith closed 2 months ago

keegancsmith commented 2 months ago

If they are configured, there is no point warning about the defaults being different. In my case I configure these flags via envvars, so I don't need to be warned about it all the time.

Test Plan: I ran an sg command with and without envvars configuring and it didn't and did warn respectively.

sourcegraph on  main [$] ❄️ sourcegraph-dev-env took 44s 
❯ env | grep ^SG
SG_DISABLE_OUTPUT_DETECTION=1
SG_SKIP_AUTO_UPDATE=1
SG_DISABLE_ANALYTICS=1

sourcegraph on  main [$!] ❄️ sourcegraph-dev-env took 19s 
❯ sg migrate up
⚠️ Running sg with a dev build, following flags have different default value unless explictly set: 
✅ Connection to frontend succeeded
✅ Connection to codeintel succeeded
✅ Connection to codeinsights succeeded
✅ Schema(s) are up-to-date!

sourcegraph on  main [$!] ❄️ sourcegraph-dev-env took 4s 
❯ go install ./dev/sg

sourcegraph on  main [$!] ❄️ sourcegraph-dev-env took 19s 
❯ sg migrate up
✅ Connection to frontend succeeded
✅ Connection to codeintel succeeded
✅ Connection to codeinsights succeeded
✅ Schema(s) are up-to-date!

sourcegraph on  main [$!] ❄️ sourcegraph-dev-env took 4s 
❯ unset SG_DISABLE_ANALYTICS SG_SKIP_AUTO_UPDATE

sourcegraph on  main [$!] ❄️ sourcegraph-dev-env 
❯ sg migrate up
⚠️ Running sg with a dev build, following flags have different default value unless explictly set: skip-auto-update, disable-analytics
✅ Connection to frontend succeeded
✅ Connection to codeintel succeeded
✅ Connection to codeinsights succeeded
✅ Schema(s) are up-to-date!
keegancsmith commented 2 months ago

c-c-c-c-c-c-combobreaker. Damn you are a quick team at reviewing.