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(deps): replace deprecated httputil.ClientConn and hijack functionality #1090

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

briceamen
Copy link

@briceamen briceamen commented Dec 12, 2024

Fix #919

Remove usage of deprecated httputil.ClientConn in favor of net/http.Client per golang/go#28030. Since HTTP connection hijacking is no longer supported in modern Go, implemented alternative approach for bidirectional TCP communication.

…ality

Fix #919

BREAKING CHANGE: Remove usage of deprecated httputil.ClientConn in favor of net/http.Client
per golang/go#28030. Since HTTP connection hijacking is no longer supported in modern Go,
implemented alternative approach for bidirectional TCP communication.
Copy link
Member

@EtienneM EtienneM left a comment

Choose a reason for hiding this comment

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

sorry for the delay to review this PR.

praise: that's a long standing issue, thanks a lot for taking it!

question: you mention a breaking change in the PR description but I don't really understand what it this breaking change. How is it breaking the current CLI API?

question: did you tested your change against the staging and / or prod environment?

apps/run.go Outdated Show resolved Hide resolved
apps/run.go Outdated Show resolved Hide resolved
apps/run.go Outdated Show resolved Hide resolved
apps/run.go Outdated Show resolved Hide resolved
apps/run.go Outdated Show resolved Hide resolved
@briceamen
Copy link
Author

briceamen commented Dec 17, 2024

question: you mention a breaking change in the PR description but I don't really understand what it this breaking change. How is it breaking the current CLI API?

I mentioned a breaking change because I'm replacing the use of httputil.ClientConn with net/http.Client, and there's no longer any hijacking properly speaking. I'll remove the breaking change mention as it's not relevant in the context of a cli client.

question: did you tested your change against the staging and / or prod environment?

I've tested locally (http) and on staging for the TLS layer. I've not tested against production but in theory I could indeed

- Replace errgo.Mask/New/Notef with errors.Wrap/Wrapf/New/Newf
- Add context parameter to internal methods to avoid using nil (SA1012)
- Remove "fail to" phrases from error messages
- Accept both 200 and 202 as valid status codes for run responses
@briceamen
Copy link
Author

briceamen commented Dec 17, 2024

Let me know what you think about those changes, I took the opportunity to replace errgo throughout all errors.

I tested run bash on local, staging and prod, all went well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants