← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~jnsgruk/launchpad-buildd:proxy-vars-uppercase into launchpad-buildd:master

 

Jon Seager has proposed merging ~jnsgruk/launchpad-buildd:proxy-vars-uppercase into launchpad-buildd:master.

Commit message:
feat: add HTTP_PROXY/HTTPS_PROXY to env
    
Proxy variable handling is all over the place on
Linux! We were already adding http_proxy and
https_proxy, but in quite a few cases I've needed
to special case this to then re-export the upper
case versions for tools to pick them up.
   
This commit adds the upper case equivalents.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~jnsgruk/launchpad-buildd/+git/launchpad-buildd/+merge/482529

feat: add HTTP_PROXY/HTTPS_PROXY to env
    
Proxy variable handling is all over the place on
Linux! We were already adding http_proxy and
https_proxy, but in quite a few cases I've needed
to special case this to then re-export the upper
case versions for tools to pick them up.
   
This commit adds the upper case equivalents.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~jnsgruk/launchpad-buildd:proxy-vars-uppercase into launchpad-buildd:master.
diff --git a/lpbuildd/target/proxy.py b/lpbuildd/target/proxy.py
index 81b473f..e22d1f2 100644
--- a/lpbuildd/target/proxy.py
+++ b/lpbuildd/target/proxy.py
@@ -119,6 +119,8 @@ class BuilderProxyOperationMixin:
         if proxy_url:
             full_env["http_proxy"] = self.args.proxy_url
             full_env["https_proxy"] = self.args.proxy_url
+            full_env["HTTP_PROXY"] = self.args.proxy_url
+            full_env["HTTPS_PROXY"] = self.args.proxy_url
             full_env["GIT_PROXY_COMMAND"] = "/usr/local/bin/lpbuildd-git-proxy"
             # Avoid needing to keep track of snap store CDNs in proxy
             # configuration.
diff --git a/lpbuildd/target/tests/test_build_charm.py b/lpbuildd/target/tests/test_build_charm.py
index 9f98fa0..fa0d169 100644
--- a/lpbuildd/target/tests/test_build_charm.py
+++ b/lpbuildd/target/tests/test_build_charm.py
@@ -475,6 +475,8 @@ class TestBuildCharm(TestCase):
         env = {
             "http_proxy": "http://proxy.example:3128/";,
             "https_proxy": "http://proxy.example:3128/";,
+            "HTTP_PROXY": "http://proxy.example:3128/";,
+            "HTTPS_PROXY": "http://proxy.example:3128/";,
             "GIT_PROXY_COMMAND": "/usr/local/bin/lpbuildd-git-proxy",
             "SNAPPY_STORE_NO_CDN": "1",
         }
@@ -588,6 +590,8 @@ class TestBuildCharm(TestCase):
         env = {
             "http_proxy": "http://proxy.example:3128/";,
             "https_proxy": "http://proxy.example:3128/";,
+            "HTTP_PROXY": "http://proxy.example:3128/";,
+            "HTTPS_PROXY": "http://proxy.example:3128/";,
             "GIT_PROXY_COMMAND": "/usr/local/bin/lpbuildd-git-proxy",
             "SNAPPY_STORE_NO_CDN": "1",
         }
diff --git a/lpbuildd/target/tests/test_build_craft.py b/lpbuildd/target/tests/test_build_craft.py
index d53bf7d..293eb57 100644
--- a/lpbuildd/target/tests/test_build_craft.py
+++ b/lpbuildd/target/tests/test_build_craft.py
@@ -753,6 +753,8 @@ class TestBuildCraft(TestCase):
         env = {
             "http_proxy": "http://proxy.example:3128/";,
             "https_proxy": "http://proxy.example:3128/";,
+            "HTTP_PROXY": "http://proxy.example:3128/";,
+            "HTTPS_PROXY": "http://proxy.example:3128/";,
             "GIT_PROXY_COMMAND": "/usr/local/bin/lpbuildd-git-proxy",
             "SNAPPY_STORE_NO_CDN": "1",
         }
diff --git a/lpbuildd/target/tests/test_build_oci.py b/lpbuildd/target/tests/test_build_oci.py
index 5ff9a22..c295a34 100644
--- a/lpbuildd/target/tests/test_build_oci.py
+++ b/lpbuildd/target/tests/test_build_oci.py
@@ -435,6 +435,8 @@ class TestBuildOCI(TestCase):
         env = {
             "http_proxy": "http://proxy.example:3128/";,
             "https_proxy": "http://proxy.example:3128/";,
+            "HTTP_PROXY": "http://proxy.example:3128/";,
+            "HTTPS_PROXY": "http://proxy.example:3128/";,
             "GIT_PROXY_COMMAND": "/usr/local/bin/lpbuildd-git-proxy",
             "SNAPPY_STORE_NO_CDN": "1",
         }
diff --git a/lpbuildd/target/tests/test_build_rock.py b/lpbuildd/target/tests/test_build_rock.py
index d3ae80b..6b7d4ad 100644
--- a/lpbuildd/target/tests/test_build_rock.py
+++ b/lpbuildd/target/tests/test_build_rock.py
@@ -750,6 +750,8 @@ class TestBuildRock(TestCase):
         env = {
             "http_proxy": "http://proxy.example:3128/";,
             "https_proxy": "http://proxy.example:3128/";,
+            "HTTP_PROXY": "http://proxy.example:3128/";,
+            "HTTPS_PROXY": "http://proxy.example:3128/";,
             "GIT_PROXY_COMMAND": "/usr/local/bin/lpbuildd-git-proxy",
             "SNAPPY_STORE_NO_CDN": "1",
         }
@@ -973,6 +975,8 @@ class TestBuildRock(TestCase):
         env = {
             "http_proxy": "http://proxy.example:3128/";,
             "https_proxy": "http://proxy.example:3128/";,
+            "HTTP_PROXY": "http://proxy.example:3128/";,
+            "HTTPS_PROXY": "http://proxy.example:3128/";,
             "GIT_PROXY_COMMAND": "/usr/local/bin/lpbuildd-git-proxy",
             "SNAPPY_STORE_NO_CDN": "1",
         }
diff --git a/lpbuildd/target/tests/test_build_snap.py b/lpbuildd/target/tests/test_build_snap.py
index 5e3ac89..4820a9c 100644
--- a/lpbuildd/target/tests/test_build_snap.py
+++ b/lpbuildd/target/tests/test_build_snap.py
@@ -689,6 +689,8 @@ class TestBuildSnap(TestCase):
         env = {
             "http_proxy": "http://proxy.example:3128/";,
             "https_proxy": "http://proxy.example:3128/";,
+            "HTTP_PROXY": "http://proxy.example:3128/";,
+            "HTTPS_PROXY": "http://proxy.example:3128/";,
             "GIT_PROXY_COMMAND": "/usr/local/bin/lpbuildd-git-proxy",
             "SNAPPY_STORE_NO_CDN": "1",
         }
diff --git a/lpbuildd/target/tests/test_run_ci.py b/lpbuildd/target/tests/test_run_ci.py
index 4f42382..3f5f837 100644
--- a/lpbuildd/target/tests/test_run_ci.py
+++ b/lpbuildd/target/tests/test_run_ci.py
@@ -228,6 +228,8 @@ class TestRunCIPrepare(TestCase):
         env = {
             "http_proxy": "http://proxy.example:3128/";,
             "https_proxy": "http://proxy.example:3128/";,
+            "HTTP_PROXY": "http://proxy.example:3128/";,
+            "HTTPS_PROXY": "http://proxy.example:3128/";,
             "GIT_PROXY_COMMAND": "/usr/local/bin/lpbuildd-git-proxy",
             "SNAPPY_STORE_NO_CDN": "1",
         }
@@ -456,6 +458,8 @@ class TestRunCIPrepare(TestCase):
         env = {
             "http_proxy": "http://proxy.example:3128/";,
             "https_proxy": "http://proxy.example:3128/";,
+            "HTTP_PROXY": "http://proxy.example:3128/";,
+            "HTTPS_PROXY": "http://proxy.example:3128/";,
             "GIT_PROXY_COMMAND": "/usr/local/bin/lpbuildd-git-proxy",
             "SNAPPY_STORE_NO_CDN": "1",
         }
@@ -631,6 +635,8 @@ class TestRunCI(TestCase):
         env = {
             "http_proxy": "http://proxy.example:3128/";,
             "https_proxy": "http://proxy.example:3128/";,
+            "HTTP_PROXY": "http://proxy.example:3128/";,
+            "HTTPS_PROXY": "http://proxy.example:3128/";,
             "GIT_PROXY_COMMAND": "/usr/local/bin/lpbuildd-git-proxy",
             "SNAPPY_STORE_NO_CDN": "1",
         }

Follow ups