repman icon indicating copy to clipboard operation
repman copied to clipboard

fix: Packagist proxy through HTTP Proxy

Open ymorocutti opened this issue 1 year ago • 5 comments

Use StreamContextFactory from composer package to create stream context as this method already support HTTP proxy settings

ymorocutti avatar Apr 26 '23 08:04 ymorocutti

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (c384362) 99.03% compared to head (e4b0944) 99.03%. Report is 3 commits behind head on master.

:exclamation: Current head e4b0944 differs from pull request most recent head 5945ddc. Consider uploading reports for the commit 5945ddc to get more accurate results

Additional details and impacted files
@@            Coverage Diff            @@
##             master     #646   +/-   ##
=========================================
  Coverage     99.03%   99.03%           
  Complexity     1916     1916           
=========================================
  Files           301      301           
  Lines          6083     6083           
=========================================
  Hits           6024     6024           
  Misses           59       59           

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Apr 26 '23 09:04 codecov[bot]

Can we add test for that or it will be too complicated?

akondas avatar May 28 '23 11:05 akondas

Can we add test for that or it will be too complicated?

I could unit test method createContext with fake URL and multiple proxy/no_proxy settings to make sure options returned to create a context are what we expect.

ymorocutti avatar May 31 '23 08:05 ymorocutti

Can we add test for that or it will be too complicated?

I could unit test method createContext with fake URL and multiple proxy/no_proxy settings to make sure options returned to create a context are what we expect.

Works for me, at least test will concrete solution :sweat_smile:

akondas avatar May 31 '23 10:05 akondas

@akondas

Should be good now, I've done some tests to verify stream context on multiple case:

  • Without any configured proxy
  • With usage of HTTP_PROXY
  • With usage of HTTP_PROXY and NO_PROXY

ymorocutti avatar Jun 07 '23 09:06 ymorocutti