launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #28372
[Merge] ~jugmac00/launchpad:pass-artifactory-credentials into launchpad:master
Jürgen Gmach has proposed merging ~jugmac00/launchpad:pass-artifactory-credentials into launchpad:master.
Commit message:
Pass Artifactory credentials to builders
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~jugmac00/launchpad/+git/launchpad/+merge/420028
--
Your team Launchpad code reviewers is requested to review the proposed merge of ~jugmac00/launchpad:pass-artifactory-credentials into launchpad:master.
diff --git a/lib/lp/code/model/cibuildbehaviour.py b/lib/lp/code/model/cibuildbehaviour.py
index 35fe231..2b4e7d9 100644
--- a/lib/lp/code/model/cibuildbehaviour.py
+++ b/lib/lp/code/model/cibuildbehaviour.py
@@ -23,6 +23,7 @@ from lp.buildmaster.model.buildfarmjobbehaviour import (
)
from lp.code.enums import RevisionStatusResult
from lp.code.interfaces.cibuild import ICIBuild
+from lp.services.config import config
from lp.soyuz.adapters.archivedependencies import (
get_sources_list_for_building,
)
@@ -78,6 +79,9 @@ class CIBuildBehaviour(BuilderProxyMixin, BuildFarmJobBehaviourBase):
args["git_repository"] = build.git_repository.git_https_url
args["git_path"] = build.commit_sha1
args["private"] = build.is_private
+ artifactory_url = "https://%s@%s" % (
+ config.artifactory.read_credentials, config.artifactory.base_url)
+ args["urls"] = {"artifactory": artifactory_url}
return args
def verifySuccessfulBuild(self):
diff --git a/lib/lp/code/model/tests/test_cibuildbehaviour.py b/lib/lp/code/model/tests/test_cibuildbehaviour.py
index 505d4b5..acdf1eb 100644
--- a/lib/lp/code/model/tests/test_cibuildbehaviour.py
+++ b/lib/lp/code/model/tests/test_cibuildbehaviour.py
@@ -171,6 +171,11 @@ class TestAsyncCIBuildBehaviour(StatsMixin, TestCIBuildBehaviourBase):
port=config.builddmaster.builder_proxy_port))
self.proxy_api = self.useFixture(InProcessProxyAuthAPIFixture())
yield self.proxy_api.start()
+ self.pushConfig(
+ "artifactory",
+ base_url="canonical.artifactory.com",
+ read_credentials="user:pass",
+ )
self.now = time.time()
self.useFixture(MockPatch("time.time", return_value=self.now))
self.addCleanup(shut_down_default_process_pool)
@@ -262,6 +267,9 @@ class TestAsyncCIBuildBehaviour(StatsMixin, TestCIBuildBehaviourBase):
"revocation_endpoint": RevocationEndpointMatcher(job, self.now),
"series": Equals(job.build.distro_series.name),
"trusted_keys": Equals(expected_trusted_keys),
+ "urls": Equals(
+ {"artifactory": "https://user:pass@xxxxxxxxxxxxxxxxxxxxxxxxx"}
+ ),
}))
@defer.inlineCallbacks
Follow ups