Skip to content

Explicit proxy support in RequestsHttpConnection #908

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

fopina
Copy link

@fopina fopina commented May 13, 2025

Description

This PR allows specifying an explicit proxy to the underlying requests.Session, overriding environment configuration.
This is useful when a specific proxy is required to access OpenSearch but nothing else (such as local tunnels).

Workaround

I've been using a very small/clean subclass across different projects for this, however I think it's clean and useful enough to be pushed to the main upstream class 😄

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@fopina fopina changed the title Added support for explicit proxy to RequestsHttpConnection Explicit proxy support in RequestsHttpConnection May 13, 2025
@fopina fopina force-pushed the requestshttpconnection/explicit_proxy_support branch 3 times, most recently from b7c1dbc to e0e40bf Compare May 13, 2025 10:02
Copy link

codecov bot commented May 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.40%. Comparing base (ba715b9) to head (e31ace0).
Report is 84 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #908      +/-   ##
==========================================
- Coverage   71.95%   70.40%   -1.56%     
==========================================
  Files          91      125      +34     
  Lines        8001     9291    +1290     
==========================================
+ Hits         5757     6541     +784     
- Misses       2244     2750     +506     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@fopina fopina force-pushed the requestshttpconnection/explicit_proxy_support branch 3 times, most recently from fc8ab2b to 1dba2cc Compare May 13, 2025 10:35
@fopina fopina force-pushed the requestshttpconnection/explicit_proxy_support branch from 1dba2cc to f308948 Compare May 13, 2025 10:50
@fopina
Copy link
Author

fopina commented May 13, 2025

Sorry for the push force spam, I did not expect so many linting complains off a single lint 😓

Ready for review now

@dblock
Copy link
Member

dblock commented May 13, 2025

Thanks. This needs tests, please.

Integ test CI is failing, needs to be looked at. Likely the 3.0 upgrade in CI to be done first in a separate PR (please help).

@fopina
Copy link
Author

fopina commented May 16, 2025

@dblock I looked at the integration tests but they are failing for the same reason as every other PR I guess. I assume #905 is trying to fix them?

I'll look into writing a unit test sure

Signed-off-by: Filipe Pina <[email protected]>
@fopina fopina force-pushed the requestshttpconnection/explicit_proxy_support branch from 64d6147 to e31ace0 Compare May 16, 2025 10:46
@fopina
Copy link
Author

fopina commented May 16, 2025

Unit test I added. I suppose it's ok like this (as http_auth) as testing further would be testing requests proxy implementation.

codecov is doing something funky:

  • it passed in the previous commit - this last one only adds a test, impossible to decrease coverage...
  • seems it compared to main on ba715b9 (very old main) for some reason...

Thanks, looking forward to see this merged and stop using an external package 🙏

@dblock
Copy link
Member

dblock commented May 18, 2025

We can ignore codecov for now.

@nathaliellenaa are you working on #905? @fopina feel free to take it over

@fopina fopina closed this May 18, 2025
@fopina fopina reopened this May 18, 2025
@fopina
Copy link
Author

fopina commented May 18, 2025

@dblock I have little to no context in this project setup, already took forever just to get tests to run locally, so I’ll have to pass.
I’ll rebase once it’s fixed, if it cannot be merged as is

@nathaliellenaa
Copy link
Contributor

@dblock @fopina I'm waiting for this PR to get merged, then I will rebase and rerun the integ tests to identify and resolve any remaining issues.

@dblock
Copy link
Member

dblock commented May 20, 2025

Looks like it's 2 weeks old, afaik nobody is working on it.

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.

3 participants