googleapis / release-please

generate release PRs based on the conventionalcommits.org spec
https://www.conventionalcommits.org
Apache License 2.0
4.44k stars 331 forks source link

Proxy fails when using HTTP CONNECT (E.G. HTTPS via a HTTP only proxy) #2259

Open PeterC89 opened 3 months ago

PeterC89 commented 3 months ago

release-please fails when trying to connect to a HTTP only proxy via HTTP CONNECT See: https://github.com/googleapis/release-please/blob/08331fa555ed482f675fb3e9dd5b0a5296e200a3/src/github.ts#L226-L231

It would probably make sense just to take the whole proxy URL (E.G. http://my-proxy:80) and apply it to the HTTP agent instead of making assumptions about the users environment?

Happy to raise a PR for this 🙂

Note: This would also require an update in the GitHub action to stop it splitting the proxy input and would probably therefore be a breaking change for both release-please and the action.

Environment details

Steps to reproduce

  1. Use a proxy value such as my-proxy:80 which only accepts http connections
  2. Get an error when release-please incorrectly tries to use https connection to the proxy.
PeterC89 commented 3 months ago

Possible solution here: https://github.com/PeterC89/release-please/commit/13913fbc1b971959550a67e45f267877372b03dd

Just noticed that the existing unit tests would have produced some very entertaining results with the current setup: https://github.com/googleapis/release-please/blob/08331fa555ed482f675fb3e9dd5b0a5296e200a3/test/github.ts#L103-L110 Would have produced a proxy URL of https://http://proxy.com:3000

PeterC89 commented 2 months ago

There may also be an issue in the newer version of octokit requiring a different approach to proxies https://github.com/octokit/rest.js/issues/43