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: add proxy checks to doctor #848

Merged
merged 2 commits into from
Aug 27, 2024
Merged

feat: add proxy checks to doctor #848

merged 2 commits into from
Aug 27, 2024

Conversation

shetzel
Copy link
Contributor

@shetzel shetzel commented Aug 26, 2024

What does this PR do?

The doctor will now look for proxy environment variables and add those values to the diagnostic report. Also adds checks to ensure values match between upper and lower case env vars.

What issues does this PR fix or reference?

@W-16510822@

@shetzel shetzel requested a review from a team as a code owner August 26, 2024 21:49
@mdonnalley
Copy link
Contributor

🟢 no vars set

❯ sf doctor
 ›   Warning: @salesforce/plugin-deploy-retrieve is a linked ESM module and cannot be auto-transpiled. Existing compiled source will
 ›   be used instead.
 ›   Warning: @salesforce/plugin-info is a linked ESM module and cannot be auto-transpiled. Existing compiled source will be used
 ›   instead.
=== Running all diagnostics

 ›   Warning: @salesforce/plugin-deploy-retrieve is a linked ESM module and cannot be auto-transpiled. Existing compiled source will
 ›   be used instead.
pass - salesforcedx plugin isn’t installed
fail - you have at least one linked plugin
pass - http_proxy and HTTP_proxy environment variables match
pass - https_proxy and HTTPS_PROXY environment variables match
pass - no_proxy and NO_PROXY environment variables match
pass - [@salesforce/plugin-trust] can ping: https://registry.npmjs.org
pass - [@salesforce/plugin-trust] can ping: https://registry.yarnpkg.com
pass - [@salesforce/plugin-trust] can ping: https://registry.npmjs.org/
pass - using latest or latest-rc CLI version
pass - can access: https://test.salesforce.com
pass - can access: https://appexchange.salesforce.com/services/data
pass - can access: https://developer.salesforce.com/media/salesforce-cli/sf/channels/stable/sf-win32-x64-buildmanifest
pass - [@salesforce/plugin-auth] CLI supports v2 crypto
warn - [@salesforce/plugin-deploy-retrieve] sourceApiVersion matches apiVersion

Wrote doctor diagnosis to: /Users/mdonnalley/repos/salesforcecli/plugin-info/1724792030335-diagnosis.json

🟢 mismatched no_proxy and NO_PROXY

❯ NO_PROXY=true no_proxy=false sf doctor
 ›   Warning: @salesforce/plugin-deploy-retrieve is a linked ESM module and cannot be auto-transpiled. Existing compiled source will
 ›   be used instead.
 ›   Warning: @salesforce/plugin-info is a linked ESM module and cannot be auto-transpiled. Existing compiled source will be used
 ›   instead.
=== Running all diagnostics

 ›   Warning: @salesforce/plugin-deploy-retrieve is a linked ESM module and cannot be auto-transpiled. Existing compiled source will
 ›   be used instead.
pass - salesforcedx plugin isn’t installed
fail - you have at least one linked plugin
pass - http_proxy and HTTP_proxy environment variables match
pass - https_proxy and HTTPS_PROXY environment variables match
fail - no_proxy and NO_PROXY environment variables match
pass - [@salesforce/plugin-trust] can ping: https://registry.npmjs.org
pass - [@salesforce/plugin-trust] can ping: https://registry.yarnpkg.com
pass - [@salesforce/plugin-trust] can ping: https://registry.npmjs.org/
pass - using latest or latest-rc CLI version
pass - can access: https://test.salesforce.com
pass - can access: https://appexchange.salesforce.com/services/data
pass - [@salesforce/plugin-auth] CLI supports v2 crypto
pass - can access: https://developer.salesforce.com/media/salesforce-cli/sf/channels/stable/sf-win32-x64-buildmanifest
warn - [@salesforce/plugin-deploy-retrieve] sourceApiVersion matches apiVersion

Wrote doctor diagnosis to: /Users/mdonnalley/repos/salesforcecli/plugin-info/1724792316386-diagnosis.json

🟢 mismatched http_proxy and HTTP_PROXY

❯ HTTP_PROXY=http://localhost:8080 http_proxy=http://localhost:8081 sf doctor
 ›   Warning: @salesforce/plugin-deploy-retrieve is a linked ESM module and cannot be auto-transpiled. Existing compiled source will
 ›   be used instead.
 ›   Warning: @salesforce/plugin-info is a linked ESM module and cannot be auto-transpiled. Existing compiled source will be used
 ›   instead.
=== Running all diagnostics

 ›   Warning: @salesforce/plugin-deploy-retrieve is a linked ESM module and cannot be auto-transpiled. Existing compiled source will
 ›   be used instead.
pass - salesforcedx plugin isn’t installed
fail - you have at least one linked plugin
fail - http_proxy and HTTP_proxy environment variables match
pass - https_proxy and HTTPS_PROXY environment variables match
pass - no_proxy and NO_PROXY environment variables match
pass - [@salesforce/plugin-trust] can ping: https://registry.npmjs.org
pass - [@salesforce/plugin-trust] can ping: https://registry.yarnpkg.com
pass - [@salesforce/plugin-trust] can ping: https://registry.npmjs.org/
pass - using latest or latest-rc CLI version
pass - [@salesforce/plugin-auth] CLI supports v2 crypto
fail - can't access: https://test.salesforce.com
fail - can't access: https://appexchange.salesforce.com/services/data
pass - can access: https://developer.salesforce.com/media/salesforce-cli/sf/channels/stable/sf-win32-x64-buildmanifest
warn - [@salesforce/plugin-deploy-retrieve] sourceApiVersion matches apiVersion

Wrote doctor diagnosis to: /Users/mdonnalley/repos/salesforcecli/plugin-info/1724792582094-diagnosis.json

🟢 mismatched https_proxy and HTTPS_PROXY

❯ HTTPS_PROXY=http://localhost:8080 https_proxy=http://localhost:8081 sf doctor
 ›   Warning: @salesforce/plugin-deploy-retrieve is a linked ESM module and cannot be auto-transpiled. Existing compiled source will
 ›   be used instead.
 ›   Warning: @salesforce/plugin-info is a linked ESM module and cannot be auto-transpiled. Existing compiled source will be used
 ›   instead.
=== Running all diagnostics

 ›   Warning: @salesforce/plugin-deploy-retrieve is a linked ESM module and cannot be auto-transpiled. Existing compiled source will
 ›   be used instead.
pass - salesforcedx plugin isn’t installed
fail - you have at least one linked plugin
pass - http_proxy and HTTP_proxy environment variables match
fail - https_proxy and HTTPS_PROXY environment variables match
pass - no_proxy and NO_PROXY environment variables match

@mdonnalley mdonnalley merged commit 3e204b8 into main Aug 27, 2024
13 checks passed
@mdonnalley mdonnalley deleted the sh/proxy-env-vars branch August 27, 2024 21:07
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.

2 participants