← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~pelpsi/launchpad-buildd:GOPROXY-and-CARGOHTTPCAINFO-configuration into launchpad-buildd:master

 

Simone Pelosi has proposed merging ~pelpsi/launchpad-buildd:GOPROXY-and-CARGOHTTPCAINFO-configuration into launchpad-buildd:master.

Commit message:
Configure GOPROXY and CARGO_HTTP_CAINFO if fetch service

These env variables should be in place for every build type if
the fetch service is active.


Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~pelpsi/launchpad-buildd/+git/launchpad-buildd/+merge/475683
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~pelpsi/launchpad-buildd:GOPROXY-and-CARGOHTTPCAINFO-configuration into launchpad-buildd:master.
diff --git a/lpbuildd/target/proxy.py b/lpbuildd/target/proxy.py
index 2200e50..893e749 100644
--- a/lpbuildd/target/proxy.py
+++ b/lpbuildd/target/proxy.py
@@ -124,7 +124,7 @@ class BuilderProxyOperationMixin:
             # configuration.
             full_env["SNAPPY_STORE_NO_CDN"] = "1"
         # Avoid circular import using __class__.__name__
-        if use_fetch_service and self.__class__.__name__ == "BuildRock":
+        if use_fetch_service:
             full_env["CARGO_HTTP_CAINFO"] = self.mitm_certificate_path
             full_env["GOPROXY"] = "direct"
 
diff --git a/lpbuildd/target/tests/test_build_craft.py b/lpbuildd/target/tests/test_build_craft.py
index 3d0edee..4be9be2 100644
--- a/lpbuildd/target/tests/test_build_craft.py
+++ b/lpbuildd/target/tests/test_build_craft.py
@@ -817,6 +817,10 @@ class TestBuildCraft(TestCase):
             "https_proxy": "http://proxy.example:3128/";,
             "GIT_PROXY_COMMAND": "/usr/local/bin/lpbuildd-git-proxy",
             "SNAPPY_STORE_NO_CDN": "1",
+            "CARGO_HTTP_CAINFO": (
+                "/usr/local/share/ca-certificates/local-ca.crt"
+            ),
+            "GOPROXY": "direct",
         }
         self.assertThat(
             build_craft.backend.run.calls,
@@ -979,6 +983,10 @@ class TestBuildCraft(TestCase):
             "https_proxy": "http://proxy.example:3128/";,
             "GIT_PROXY_COMMAND": "/usr/local/bin/lpbuildd-git-proxy",
             "SNAPPY_STORE_NO_CDN": "1",
+            "CARGO_HTTP_CAINFO": (
+                "/usr/local/share/ca-certificates/local-ca.crt"
+            ),
+            "GOPROXY": "direct",
         }
         self.assertThat(
             build_craft.backend.run.calls,
diff --git a/lpbuildd/target/tests/test_build_snap.py b/lpbuildd/target/tests/test_build_snap.py
index 5c721f9..4b43c8f 100644
--- a/lpbuildd/target/tests/test_build_snap.py
+++ b/lpbuildd/target/tests/test_build_snap.py
@@ -753,6 +753,10 @@ class TestBuildSnap(TestCase):
             "https_proxy": "http://proxy.example:3128/";,
             "GIT_PROXY_COMMAND": "/usr/local/bin/lpbuildd-git-proxy",
             "SNAPPY_STORE_NO_CDN": "1",
+            "CARGO_HTTP_CAINFO": (
+                "/usr/local/share/ca-certificates/local-ca.crt"
+            ),
+            "GOPROXY": "direct",
         }
         self.assertThat(
             build_snap.backend.run.calls,