launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #29004
[Merge] ~jugmac00/launchpad:converge-naming-for-package-repositories into launchpad:master
Jürgen Gmach has proposed merging ~jugmac00/launchpad:converge-naming-for-package-repositories into launchpad:master.
Commit message:
Rename `apt_repositories` into `package_repositories`
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~jugmac00/launchpad/+git/launchpad/+merge/428406
--
Your team Launchpad code reviewers is requested to review the proposed merge of ~jugmac00/launchpad:converge-naming-for-package-repositories into launchpad:master.
diff --git a/lib/lp/code/model/cibuildbehaviour.py b/lib/lp/code/model/cibuildbehaviour.py
index 726bb80..ec4c9fc 100644
--- a/lib/lp/code/model/cibuildbehaviour.py
+++ b/lib/lp/code/model/cibuildbehaviour.py
@@ -56,6 +56,8 @@ def build_environment_variables(distribution_name: str) -> dict:
def build_apt_repositories(distribution_name: str) -> list:
+ # deprecated - will be removed in favor of `build_package_repositories`
+ # once the renaming process had been finished
# - load apt repository configuration lines from JSON Array
# - replace authentication placeholder
try:
@@ -70,6 +72,21 @@ def build_apt_repositories(distribution_name: str) -> list:
return rv
+def build_package_repositories(distribution_name: str) -> list:
+ # - load package_repository configuration lines from JSON Array
+ # - replace authentication placeholder
+ try:
+ lines = config["cibuild." + distribution_name]["package_repositories"]
+ except NoSectionError:
+ return []
+ if lines is None:
+ return []
+ rv = []
+ for line in json.loads(lines):
+ rv.append(replace_auth_placeholder(line))
+ return rv
+
+
def build_plugin_settings(distribution_name: str) -> dict:
# - load key/value pairs from JSON Object
# - replace authentication placeholder
@@ -193,6 +210,9 @@ class CIBuildBehaviour(BuilderProxyMixin, BuildFarmJobBehaviourBase):
args["apt_repositories"] = build_apt_repositories(
distribution_name
)
+ args["package_repositories"] = build_package_repositories(
+ distribution_name
+ )
args["plugin_settings"] = build_plugin_settings(distribution_name)
args["secrets"] = build_secrets(distribution_name)
return args
diff --git a/lib/lp/code/model/tests/test_cibuildbehaviour.py b/lib/lp/code/model/tests/test_cibuildbehaviour.py
index bd198ed..d9cb423 100644
--- a/lib/lp/code/model/tests/test_cibuildbehaviour.py
+++ b/lib/lp/code/model/tests/test_cibuildbehaviour.py
@@ -339,6 +339,12 @@ class TestAsyncCIBuildBehaviour(StatsMixin, TestCIBuildBehaviourBase):
"deb https://public_ppa.example.net/repository focal main",
]
),
+ package_repositories=json.dumps(
+ [
+ "deb https://%(read_auth)s@xxxxxxxxxxxxxxxxxxxxx/artifactory/soss-deb-stable focal main universe", # noqa: E501
+ "deb https://public_ppa.example.net/repository focal main",
+ ]
+ ),
plugin_settings=json.dumps(
{
"miniconda_conda_channel": "https://%(read_auth)s@xxxxxxxxxxxxxxxxxxxxx/artifactory/soss-conda-stable-local/", # noqa: E501
@@ -360,6 +366,7 @@ class TestAsyncCIBuildBehaviour(StatsMixin, TestCIBuildBehaviourBase):
# but have no values set
self.assertEqual({}, args["environment_variables"])
self.assertEqual([], args["apt_repositories"])
+ self.assertEqual([], args["package_repositories"])
self.assertEqual({}, args["plugin_settings"])
self.assertEqual({}, args["secrets"])
@@ -379,6 +386,7 @@ class TestAsyncCIBuildBehaviour(StatsMixin, TestCIBuildBehaviourBase):
args = yield job.extraBuildArgs()
self.assertEqual({}, args["environment_variables"])
self.assertNotIn([], args["apt_repositories"])
+ self.assertNotIn([], args["package_repositories"])
@defer.inlineCallbacks
def test_extraBuildArgs_git_include_artifactory_configuration(self):
@@ -400,6 +408,12 @@ class TestAsyncCIBuildBehaviour(StatsMixin, TestCIBuildBehaviourBase):
"deb https://public_ppa.example.net/repository focal main",
]
),
+ package_repositories=json.dumps(
+ [
+ "deb https://%(read_auth)s@xxxxxxxxxxxxxxxxxxxxx/artifactory/soss-deb-stable focal main universe", # noqa: E501
+ "deb https://public_ppa.example.net/repository focal main",
+ ]
+ ),
plugin_settings=json.dumps(
{
"miniconda_conda_channel": "https://%(read_auth)s@xxxxxxxxxxxxxxxxxxxxx/artifactory/soss-conda-stable-local/", # noqa: E501
@@ -458,6 +472,12 @@ class TestAsyncCIBuildBehaviour(StatsMixin, TestCIBuildBehaviourBase):
"deb https://public_ppa.example.net/repository focal main", # noqa: E501
]
),
+ "package_repositories": Equals(
+ [
+ "deb https://user:pass@xxxxxxxxxxxxxxxxxxxxx/artifactory/soss-deb-stable focal main universe", # noqa: E501
+ "deb https://public_ppa.example.net/repository focal main", # noqa: E501
+ ]
+ ),
"plugin_settings": Equals(
{
"miniconda_conda_channel": "https://user:pass@xxxxxxxxxxxxxxxxxxxxx/artifactory/soss-conda-stable-local/", # noqa: E501
diff --git a/lib/lp/services/config/schema-lazr.conf b/lib/lp/services/config/schema-lazr.conf
index 640da63..89eab5a 100644
--- a/lib/lp/services/config/schema-lazr.conf
+++ b/lib/lp/services/config/schema-lazr.conf
@@ -246,8 +246,11 @@ salsa.debian.org.token: none
environment_variables: none
# value is a JSON Array
# example:
+# (deprecated - remove once the renaming into `package_repositories` is done)
# apt_repositories: ["deb https://%(read_auth)s@xxxxxxxxxxxxxxxxxxxxx/artifactory/soss-deb-stable focal main universe"]
apt_repositories: none
+# package_repositories: ["deb https://%(read_auth)s@xxxxxxxxxxxxxxxxxxxxx/artifactory/soss-deb-stable focal main universe"]
+package_repositories: none
# value is a JSON Object
# example:
# plugin_settings: {"miniconda_conda_channel": "https://%(read_auth)s@xxxxxxxxxxxxxxxxxxxxx/artifactory/soss-conda-stable-local/"}
Follow ups