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

fix(cli): Respect NO_PROXY on cypress download #17702

Merged
merged 4 commits into from Sep 20, 2021
Merged

fix(cli): Respect NO_PROXY on cypress download #17702

merged 4 commits into from Sep 20, 2021

Conversation

westarne
Copy link
Contributor

@westarne westarne commented Aug 11, 2021

User facing changelog

As stated in the open issue, the download of cypress did not support the NO_PROXY environment variable and thus always used a proxy. This PR fixes that behaviour by adding an explicit NO_PROXY lookup. This change is based on https://github.com/cypress-io/request/blob/master/lib/getProxyFromURI.js.

Additional details

I've selected this approach to still explicitly hand in the proxy to the request module, because in there the variables npm_config_proxy and npm_config_https_proxy are ignored to determine the proxy.
As alternative stated in #6304 (comment) it would also be possible to leave out the proxy parameter when executing the request as it will be determined in there. But as mentioned this would not respect the npm config properties.

How has the user experience changed?

npm install cypress now works if a proxy is set but not used for cypress.

PR Tasks

  • Have tests been added/updated?
  • Has the original issue or this PR been tagged with a release in ZenHub?

@westarne westarne requested a review from a team as a code owner August 11, 2021 16:41
@westarne westarne requested review from flotwig and chrisbreiding and removed request for a team August 11, 2021 16:41
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Aug 11, 2021

Thanks for taking the time to open a PR!

@CLAassistant
Copy link

CLAassistant commented Aug 11, 2021

CLA assistant check
All committers have signed the CLA.

@westarne westarne changed the title Respect NO_PROXY on cypress download fix: Respect NO_PROXY on cypress download Aug 11, 2021
Copy link
Contributor

@flotwig flotwig left a comment

Choose a reason for hiding this comment

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

Thank you for opening a PR.

cli/lib/tasks/download.js Outdated Show resolved Hide resolved
@westarne westarne requested a review from flotwig August 11, 2021 23:12
Copy link
Contributor

@flotwig flotwig left a comment

Choose a reason for hiding this comment

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

I added a commit to add proxy-from-env@1.0.0 to package.json.

Also, can you please open a PR in cypress-documentation to enhance the install docs with this information? This would be a good place: https://github.com/cypress-io/cypress-documentation/blob/master/content/guides/getting-started/installing-cypress.md

Once that's done this looks good to me.

@westarne
Copy link
Contributor Author

Thank you @flotwig
I've created a PR on the documentation repo: cypress-io/cypress-documentation#4089

Copy link
Contributor

@flotwig flotwig left a comment

Choose a reason for hiding this comment

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

Thank you for the contribution @westarne

@flotwig flotwig changed the title fix: Respect NO_PROXY on cypress download fix(cli): Respect NO_PROXY on cypress download Sep 20, 2021
@flotwig flotwig merged commit 8249d2e into cypress-io:develop Sep 20, 2021
thlorenz added a commit to thlorenz/cypress that referenced this pull request Sep 20, 2021
* develop:
  fix(cli): Respect NO_PROXY on cypress download (cypress-io#17702)
  chore: Update Chrome (beta) to 94.0.4606.50 (cypress-io#18117)
  release 8.4.1 [skip ci]
  fix: GH env variable for test other projects (cypress-io#18147)
  fix(open_project): remove unnecessary fn wrapping from tryToCalls (cypress-io#18146)
tgriesser added a commit that referenced this pull request Sep 24, 2021
…/remove-decorators

* unified-desktop-gui:
  fixing broken ct tests
  fix types
  remove old code
  chore: bump deps (#18213)
  feat(app): icon library supporting Cy's custom icons (#18195)
  feat(app): adding navigation, pages, router, and layout (#18194)
  chore: Update Chrome (stable) to 94.0.4606.54 (#18196)
  chore: bump yarn.lock (#18204)
  chore(tests): fix flake in net stubbing/xhr/proxy logging tests (#18163)
  chore: Update Chrome (beta) to 94.0.4606.54 (#18174)
  fix: add deprecation notice for win 32-bit (#18130)
  chore: fix broken firefox focus tests, bump resource class of chrome-beta job (#18133)
  fix(cli): Respect NO_PROXY on cypress download (#17702)
  chore: Update Chrome (beta) to 94.0.4606.50 (#18117)
  release 8.4.1 [skip ci]
  fix: GH env variable for test other projects (#18147)
  fix(open_project): remove unnecessary fn wrapping from tryToCalls (#18146)
  change @ts-expect-error -> @ts-ignore (#18047)
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Sep 27, 2021

Released in 8.5.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v8.5.0, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Sep 27, 2021
@westarne westarne deleted the bugfix/fix-download-no-proxy-ignore branch January 21, 2022 20:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make it possible to support no_proxy environment variable for download
3 participants