Merge ~cjwatson/launchpad:generic-artifactory-properties into launchpad:master

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: 01a8cbb40e6ded42f1d92e55cb166b2af7463e17
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/launchpad:generic-artifactory-properties
Merge into: launchpad:master
Prerequisite: ~cjwatson/launchpad:artifactory-strip-trailing-backslashes
Diff against target: 483 lines (+85/-2)
4 files modified
lib/lp/archivepublisher/artifactory.py (+28/-1)
lib/lp/archivepublisher/tests/test_artifactory.py (+43/-0)
lib/lp/archivepublisher/tests/test_pool.py (+7/-1)
lib/lp/archivepublisher/tests/test_publisher.py (+7/-0)
Reviewer Review Type Date Requested Status
Jürgen Gmach Approve
Review via email: mp+434496@code.launchpad.net

Commit message

Add generic.name, generic.version, and soss.type Artifactory properties

Description of the change

For most artifact types, Artifactory sets "name" and "version" properties itself by scanning the artifact. However, for generic artifacts it obviously can't do this, since the content doesn't necessarily have any particular known structure. Since we already require generic artifacts to have "name" and "version" output properties set by the build job, fill in this gap by passing those on to Artifactory.

`soss.type` makes it easier for automation built on top of Artifactory to tell what any given artifact is meant to be, without having to look at the `launchpad.*` properties which we consider to be implementation details.

To post a comment you must log in.
Revision history for this message
Jürgen Gmach (jugmac00) wrote :

LGTM

I think it would be great to have some description of the properties in the docstring at least. Currently, it feels a bit that like we set some properties somehow and somewhere, but for unknown reasons.

I think it makes no sense to repeat the logic of the source code, but somehow give some spec, e.g. what properties are expected.

review: Approve
01a8cbb... by Colin Watson

Add some more commentary on additional properties

Revision history for this message
Colin Watson (cjwatson) wrote :

There's already a comment a bit further up (outside the patch context) linking to the internal spreadsheet with the property schema we intend to expose. I've added a bit more commentary now though, as this might indeed be a bit obscure if you haven't been in all the discussions ...

Revision history for this message
Jürgen Gmach (jugmac00) wrote :

Thank you!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/lib/lp/archivepublisher/artifactory.py b/lib/lp/archivepublisher/artifactory.py
index 9fc4fc7..2d16d99 100644
--- a/lib/lp/archivepublisher/artifactory.py
+++ b/lib/lp/archivepublisher/artifactory.py
@@ -22,9 +22,10 @@ from packaging import utils as packaging_utils
22from zope.security.proxy import isinstance as zope_isinstance22from zope.security.proxy import isinstance as zope_isinstance
2323
24from lp.archivepublisher.diskpool import FileAddActionEnum, poolify24from lp.archivepublisher.diskpool import FileAddActionEnum, poolify
25from lp.registry.interfaces.sourcepackage import SourcePackageFileType
25from lp.services.config import config26from lp.services.config import config
26from lp.services.librarian.utils import copy_and_close27from lp.services.librarian.utils import copy_and_close
27from lp.soyuz.enums import ArchiveRepositoryFormat28from lp.soyuz.enums import ArchiveRepositoryFormat, BinaryPackageFileType
28from lp.soyuz.interfaces.archive import IArchive29from lp.soyuz.interfaces.archive import IArchive
29from lp.soyuz.interfaces.files import (30from lp.soyuz.interfaces.files import (
30 IBinaryPackageFile,31 IBinaryPackageFile,
@@ -205,6 +206,10 @@ class ArtifactoryPoolEntry:
205 the AQL search via `ArtifactoryPool.getAllArtifacts`, and so206 the AQL search via `ArtifactoryPool.getAllArtifacts`, and so
206 `updateProperties` will always try to update them even if there207 `updateProperties` will always try to update them even if there
207 aren't really any changes.208 aren't really any changes.
209
210 We also set an assortment of additional metadata items, specified in
211 https://docs.google.com/spreadsheets/d/15Xkdi-CRu2NiQfLoclP5PKW63Zw6syiuao8VJG7zxvw
212 (private).
208 """213 """
209 properties = {}214 properties = {}
210 properties["launchpad.release-id"] = [release_id]215 properties["launchpad.release-id"] = [release_id]
@@ -271,8 +276,14 @@ class ArtifactoryPoolEntry:
271 # (private).276 # (private).
272 if ISourcePackageReleaseFile.providedBy(self.pub_file):277 if ISourcePackageReleaseFile.providedBy(self.pub_file):
273 release = self.pub_file.sourcepackagerelease278 release = self.pub_file.sourcepackagerelease
279 # Allow automation built on top of Artifactory to tell that this
280 # is a source package.
281 properties["soss.type"] = ["source"]
274 elif IBinaryPackageFile.providedBy(self.pub_file):282 elif IBinaryPackageFile.providedBy(self.pub_file):
275 release = self.pub_file.binarypackagerelease283 release = self.pub_file.binarypackagerelease
284 # Allow automation built on top of Artifactory to tell that this
285 # is a binary package.
286 properties["soss.type"] = ["binary"]
276 else:287 else:
277 # There are no other kinds of `IPackageReleaseFile` at the moment.288 # There are no other kinds of `IPackageReleaseFile` at the moment.
278 raise AssertionError("Unsupported file: %r" % self.pub_file)289 raise AssertionError("Unsupported file: %r" % self.pub_file)
@@ -298,6 +309,22 @@ class ArtifactoryPoolEntry:
298 # likely that a path will begin with "spdx:" so there309 # likely that a path will begin with "spdx:" so there
299 # probably won't be significant confusion in practice.310 # probably won't be significant confusion in practice.
300 properties["soss.license"] = [license_field["path"]]311 properties["soss.license"] = [license_field["path"]]
312 if self.pub_file.filetype in (
313 SourcePackageFileType.GENERIC,
314 BinaryPackageFileType.GENERIC,
315 ):
316 # For most artifact types, Artifactory sets "name" and "version"
317 # properties itself by scanning the artifact. However, for
318 # generic artifacts it obviously can't do this, since the
319 # content doesn't necessarily have any particular known
320 # structure. Since we already require generic artifacts to have
321 # "name" and "version" output properties set by the build job,
322 # fill in this gap by passing those on to Artifactory.
323 package_name = release.getUserDefinedField("name")
324 if package_name is None:
325 package_name = self.source_name
326 properties["generic.name"] = [package_name]
327 properties["generic.version"] = [self.source_version]
301 return properties328 return properties
302329
303 def addFile(self):330 def addFile(self):
diff --git a/lib/lp/archivepublisher/tests/test_artifactory.py b/lib/lp/archivepublisher/tests/test_artifactory.py
index 4179c2e..da1a31a 100644
--- a/lib/lp/archivepublisher/tests/test_artifactory.py
+++ b/lib/lp/archivepublisher/tests/test_artifactory.py
@@ -192,6 +192,7 @@ class TestArtifactoryPool(TestCase):
192 "launchpad.release-id": ["binary:1"],192 "launchpad.release-id": ["binary:1"],
193 "launchpad.source-name": ["foo"],193 "launchpad.source-name": ["foo"],
194 "launchpad.source-version": ["1.0+1"],194 "launchpad.source-version": ["1.0+1"],
195 "soss.type": ["binary"],
195 },196 },
196 foo.getProperties(),197 foo.getProperties(),
197 )198 )
@@ -317,11 +318,13 @@ class TestArtifactoryPool(TestCase):
317 "launchpad.release-id": ["binary:1"],318 "launchpad.release-id": ["binary:1"],
318 "launchpad.source-name": ["foo"],319 "launchpad.source-name": ["foo"],
319 "launchpad.source-version": ["1.0"],320 "launchpad.source-version": ["1.0"],
321 "soss.type": ["binary"],
320 },322 },
321 PurePath("pool/f/foo/foo-1.1.deb"): {323 PurePath("pool/f/foo/foo-1.1.deb"): {
322 "launchpad.release-id": ["binary:2"],324 "launchpad.release-id": ["binary:2"],
323 "launchpad.source-name": ["foo"],325 "launchpad.source-name": ["foo"],
324 "launchpad.source-version": ["1.1"],326 "launchpad.source-version": ["1.1"],
327 "soss.type": ["binary"],
325 },328 },
326 },329 },
327 pool.getAllArtifacts(330 pool.getAllArtifacts(
@@ -345,6 +348,7 @@ class TestArtifactoryPool(TestCase):
345 "launchpad.release-id": ["binary:3"],348 "launchpad.release-id": ["binary:3"],
346 "launchpad.source-name": ["bar"],349 "launchpad.source-name": ["bar"],
347 "launchpad.source-version": ["1.0"],350 "launchpad.source-version": ["1.0"],
351 "soss.type": ["binary"],
348 },352 },
349 },353 },
350 pool.getAllArtifacts(354 pool.getAllArtifacts(
@@ -369,6 +373,7 @@ class TestArtifactoryPool(TestCase):
369 "launchpad.release-id": ["binary:4"],373 "launchpad.release-id": ["binary:4"],
370 "launchpad.source-name": ["qux"],374 "launchpad.source-name": ["qux"],
371 "launchpad.source-version": ["1.0"],375 "launchpad.source-version": ["1.0"],
376 "soss.type": ["binary"],
372 },377 },
373 },378 },
374 pool.getAllArtifacts(379 pool.getAllArtifacts(
@@ -393,6 +398,7 @@ class TestArtifactoryPool(TestCase):
393 "launchpad.release-id": ["source:5"],398 "launchpad.release-id": ["source:5"],
394 "launchpad.source-name": ["go-module"],399 "launchpad.source-name": ["go-module"],
395 "launchpad.source-version": ["v0.0.1"],400 "launchpad.source-version": ["v0.0.1"],
401 "soss.type": ["source"],
396 },402 },
397 },403 },
398 pool.getAllArtifacts(404 pool.getAllArtifacts(
@@ -409,6 +415,7 @@ class TestArtifactoryPool(TestCase):
409 filename="bar-1.0.tar.gz",415 filename="bar-1.0.tar.gz",
410 release_type=FakeReleaseType.SOURCE,416 release_type=FakeReleaseType.SOURCE,
411 release_id=1,417 release_id=1,
418 filetype=SourcePackageFileType.GENERIC,
412 user_defined_fields=[419 user_defined_fields=[
413 ("name", "bar"),420 ("name", "bar"),
414 ("version", "1.0"),421 ("version", "1.0"),
@@ -418,9 +425,12 @@ class TestArtifactoryPool(TestCase):
418 self.assertEqual(425 self.assertEqual(
419 {426 {
420 PurePath("bar/1.0/bar-1.0.tar.gz"): {427 PurePath("bar/1.0/bar-1.0.tar.gz"): {
428 "generic.name": ["bar"],
429 "generic.version": ["1.0"],
421 "launchpad.release-id": ["source:1"],430 "launchpad.release-id": ["source:1"],
422 "launchpad.source-name": ["bar"],431 "launchpad.source-name": ["bar"],
423 "launchpad.source-version": ["1.0"],432 "launchpad.source-version": ["1.0"],
433 "soss.type": ["source"],
424 },434 },
425 },435 },
426 pool.getAllArtifacts(436 pool.getAllArtifacts(
@@ -453,6 +463,7 @@ class TestArtifactoryPool(TestCase):
453 "launchpad.source-name": ["bar"],463 "launchpad.source-name": ["bar"],
454 "launchpad.source-version": ["1.0"],464 "launchpad.source-version": ["1.0"],
455 "pypi.requires.python": [""],465 "pypi.requires.python": [""],
466 "soss.type": ["binary"],
456 },467 },
457 },468 },
458 pool.getAllArtifacts(469 pool.getAllArtifacts(
@@ -521,6 +532,7 @@ class TestArtifactoryPoolFromLibrarian(TestCaseWithFactory):
521 "launchpad.release-id": ["source:%d" % spr.id],532 "launchpad.release-id": ["source:%d" % spr.id],
522 "launchpad.source-name": ["foo"],533 "launchpad.source-name": ["foo"],
523 "launchpad.source-version": ["1.0"],534 "launchpad.source-version": ["1.0"],
535 "soss.type": ["source"],
524 },536 },
525 path.properties,537 path.properties,
526 )538 )
@@ -535,6 +547,7 @@ class TestArtifactoryPoolFromLibrarian(TestCaseWithFactory):
535 "deb.name": [spr.name],547 "deb.name": [spr.name],
536 "deb.version": [spr.version],548 "deb.version": [spr.version],
537 "soss.license": ["debian/copyright"],549 "soss.license": ["debian/copyright"],
550 "soss.type": ["source"],
538 },551 },
539 path.properties,552 path.properties,
540 )553 )
@@ -594,6 +607,7 @@ class TestArtifactoryPoolFromLibrarian(TestCaseWithFactory):
594 "launchpad.release-id": ["binary:%d" % bpr.id],607 "launchpad.release-id": ["binary:%d" % bpr.id],
595 "launchpad.source-name": ["foo"],608 "launchpad.source-name": ["foo"],
596 "launchpad.source-version": ["1.0"],609 "launchpad.source-version": ["1.0"],
610 "soss.type": ["binary"],
597 },611 },
598 path.properties,612 path.properties,
599 )613 )
@@ -609,6 +623,7 @@ class TestArtifactoryPoolFromLibrarian(TestCaseWithFactory):
609 "deb.component": ["main"],623 "deb.component": ["main"],
610 "deb.architecture": [processor.name],624 "deb.architecture": [processor.name],
611 "soss.license": ["/usr/share/doc/foo/copyright"],625 "soss.license": ["/usr/share/doc/foo/copyright"],
626 "soss.type": ["binary"],
612 },627 },
613 path.properties,628 path.properties,
614 )629 )
@@ -662,6 +677,7 @@ class TestArtifactoryPoolFromLibrarian(TestCaseWithFactory):
662 "launchpad.release-id": ["binary:%d" % bpr.id],677 "launchpad.release-id": ["binary:%d" % bpr.id],
663 "launchpad.source-name": ["foo"],678 "launchpad.source-name": ["foo"],
664 "launchpad.source-version": ["1.0"],679 "launchpad.source-version": ["1.0"],
680 "soss.type": ["binary"],
665 },681 },
666 path.properties,682 path.properties,
667 )683 )
@@ -679,6 +695,7 @@ class TestArtifactoryPoolFromLibrarian(TestCaseWithFactory):
679 sorted(das.architecturetag for das in dases)695 sorted(das.architecturetag for das in dases)
680 ),696 ),
681 "soss.license": ["/usr/share/doc/foo/copyright"],697 "soss.license": ["/usr/share/doc/foo/copyright"],
698 "soss.type": ["binary"],
682 },699 },
683 path.properties,700 path.properties,
684 )701 )
@@ -738,6 +755,7 @@ class TestArtifactoryPoolFromLibrarian(TestCaseWithFactory):
738 ci_build.git_repository.getCodebrowseUrl()755 ci_build.git_repository.getCodebrowseUrl()
739 ],756 ],
740 "soss.commit_id": [ci_build.commit_sha1],757 "soss.commit_id": [ci_build.commit_sha1],
758 "soss.type": ["source"],
741 },759 },
742 path.properties,760 path.properties,
743 )761 )
@@ -754,6 +772,7 @@ class TestArtifactoryPoolFromLibrarian(TestCaseWithFactory):
754 ci_build.git_repository.getCodebrowseUrl()772 ci_build.git_repository.getCodebrowseUrl()
755 ],773 ],
756 "soss.commit_id": [ci_build.commit_sha1],774 "soss.commit_id": [ci_build.commit_sha1],
775 "soss.type": ["source"],
757 },776 },
758 path.properties,777 path.properties,
759 )778 )
@@ -814,6 +833,7 @@ class TestArtifactoryPoolFromLibrarian(TestCaseWithFactory):
814 ci_build.git_repository.getCodebrowseUrl()833 ci_build.git_repository.getCodebrowseUrl()
815 ],834 ],
816 "soss.commit_id": [ci_build.commit_sha1],835 "soss.commit_id": [ci_build.commit_sha1],
836 "soss.type": ["source"],
817 },837 },
818 path.properties,838 path.properties,
819 )839 )
@@ -830,6 +850,7 @@ class TestArtifactoryPoolFromLibrarian(TestCaseWithFactory):
830 ci_build.git_repository.getCodebrowseUrl()850 ci_build.git_repository.getCodebrowseUrl()
831 ],851 ],
832 "soss.commit_id": [ci_build.commit_sha1],852 "soss.commit_id": [ci_build.commit_sha1],
853 "soss.type": ["source"],
833 },854 },
834 path.properties,855 path.properties,
835 )856 )
@@ -889,6 +910,7 @@ class TestArtifactoryPoolFromLibrarian(TestCaseWithFactory):
889 ci_build.git_repository.getCodebrowseUrl()910 ci_build.git_repository.getCodebrowseUrl()
890 ],911 ],
891 "soss.commit_id": [ci_build.commit_sha1],912 "soss.commit_id": [ci_build.commit_sha1],
913 "soss.type": ["source"],
892 },914 },
893 path.properties,915 path.properties,
894 )916 )
@@ -905,6 +927,7 @@ class TestArtifactoryPoolFromLibrarian(TestCaseWithFactory):
905 ci_build.git_repository.getCodebrowseUrl()927 ci_build.git_repository.getCodebrowseUrl()
906 ],928 ],
907 "soss.commit_id": [ci_build.commit_sha1],929 "soss.commit_id": [ci_build.commit_sha1],
930 "soss.type": ["source"],
908 },931 },
909 path.properties,932 path.properties,
910 )933 )
@@ -981,6 +1004,7 @@ class TestArtifactoryPoolFromLibrarian(TestCaseWithFactory):
981 ci_build.git_repository.getCodebrowseUrl()1004 ci_build.git_repository.getCodebrowseUrl()
982 ],1005 ],
983 "soss.commit_id": [ci_build.commit_sha1],1006 "soss.commit_id": [ci_build.commit_sha1],
1007 "soss.type": ["binary"],
984 },1008 },
985 path.properties,1009 path.properties,
986 )1010 )
@@ -997,6 +1021,7 @@ class TestArtifactoryPoolFromLibrarian(TestCaseWithFactory):
997 ci_build.git_repository.getCodebrowseUrl()1021 ci_build.git_repository.getCodebrowseUrl()
998 ],1022 ],
999 "soss.commit_id": [ci_build.commit_sha1],1023 "soss.commit_id": [ci_build.commit_sha1],
1024 "soss.type": ["binary"],
1000 },1025 },
1001 path.properties,1026 path.properties,
1002 )1027 )
@@ -1064,6 +1089,7 @@ class TestArtifactoryPoolFromLibrarian(TestCaseWithFactory):
1064 ci_build.git_repository.getCodebrowseUrl()1089 ci_build.git_repository.getCodebrowseUrl()
1065 ],1090 ],
1066 "soss.commit_id": [ci_build.commit_sha1],1091 "soss.commit_id": [ci_build.commit_sha1],
1092 "soss.type": ["binary"],
1067 },1093 },
1068 path.properties,1094 path.properties,
1069 )1095 )
@@ -1080,6 +1106,7 @@ class TestArtifactoryPoolFromLibrarian(TestCaseWithFactory):
1080 ci_build.git_repository.getCodebrowseUrl()1106 ci_build.git_repository.getCodebrowseUrl()
1081 ],1107 ],
1082 "soss.commit_id": [ci_build.commit_sha1],1108 "soss.commit_id": [ci_build.commit_sha1],
1109 "soss.type": ["binary"],
1083 },1110 },
1084 path.properties,1111 path.properties,
1085 )1112 )
@@ -1147,6 +1174,7 @@ class TestArtifactoryPoolFromLibrarian(TestCaseWithFactory):
1147 ci_build.git_repository.getCodebrowseUrl()1174 ci_build.git_repository.getCodebrowseUrl()
1148 ],1175 ],
1149 "soss.commit_id": [ci_build.commit_sha1],1176 "soss.commit_id": [ci_build.commit_sha1],
1177 "soss.type": ["binary"],
1150 },1178 },
1151 path.properties,1179 path.properties,
1152 )1180 )
@@ -1163,6 +1191,7 @@ class TestArtifactoryPoolFromLibrarian(TestCaseWithFactory):
1163 ci_build.git_repository.getCodebrowseUrl()1191 ci_build.git_repository.getCodebrowseUrl()
1164 ],1192 ],
1165 "soss.commit_id": [ci_build.commit_sha1],1193 "soss.commit_id": [ci_build.commit_sha1],
1194 "soss.type": ["binary"],
1166 },1195 },
1167 path.properties,1196 path.properties,
1168 )1197 )
@@ -1219,6 +1248,8 @@ class TestArtifactoryPoolFromLibrarian(TestCaseWithFactory):
1219 self.assertFalse(path.is_symlink())1248 self.assertFalse(path.is_symlink())
1220 self.assertEqual(1249 self.assertEqual(
1221 {1250 {
1251 "generic.name": ["foo"],
1252 "generic.version": ["1.0"],
1222 "launchpad.release-id": ["source:%d" % spr.id],1253 "launchpad.release-id": ["source:%d" % spr.id],
1223 "launchpad.source-name": ["foo-package"],1254 "launchpad.source-name": ["foo-package"],
1224 "launchpad.source-version": ["1.0"],1255 "launchpad.source-version": ["1.0"],
@@ -1226,12 +1257,15 @@ class TestArtifactoryPoolFromLibrarian(TestCaseWithFactory):
1226 ci_build.git_repository.getCodebrowseUrl()1257 ci_build.git_repository.getCodebrowseUrl()
1227 ],1258 ],
1228 "soss.commit_id": [ci_build.commit_sha1],1259 "soss.commit_id": [ci_build.commit_sha1],
1260 "soss.type": ["source"],
1229 },1261 },
1230 path.properties,1262 path.properties,
1231 )1263 )
1232 pool.updateProperties(spr.name, spr.version, [sprf], spphs)1264 pool.updateProperties(spr.name, spr.version, [sprf], spphs)
1233 self.assertEqual(1265 self.assertEqual(
1234 {1266 {
1267 "generic.name": ["foo"],
1268 "generic.version": ["1.0"],
1235 "launchpad.release-id": ["source:%d" % spr.id],1269 "launchpad.release-id": ["source:%d" % spr.id],
1236 "launchpad.source-name": ["foo-package"],1270 "launchpad.source-name": ["foo-package"],
1237 "launchpad.source-version": ["1.0"],1271 "launchpad.source-version": ["1.0"],
@@ -1242,6 +1276,7 @@ class TestArtifactoryPoolFromLibrarian(TestCaseWithFactory):
1242 ci_build.git_repository.getCodebrowseUrl()1276 ci_build.git_repository.getCodebrowseUrl()
1243 ],1277 ],
1244 "soss.commit_id": [ci_build.commit_sha1],1278 "soss.commit_id": [ci_build.commit_sha1],
1279 "soss.type": ["source"],
1245 },1280 },
1246 path.properties,1281 path.properties,
1247 )1282 )
@@ -1302,6 +1337,8 @@ class TestArtifactoryPoolFromLibrarian(TestCaseWithFactory):
1302 self.assertFalse(path.is_symlink())1337 self.assertFalse(path.is_symlink())
1303 self.assertEqual(1338 self.assertEqual(
1304 {1339 {
1340 "generic.name": ["foo"],
1341 "generic.version": ["1.0"],
1305 "launchpad.release-id": ["binary:%d" % bpr.id],1342 "launchpad.release-id": ["binary:%d" % bpr.id],
1306 "launchpad.source-name": ["foo"],1343 "launchpad.source-name": ["foo"],
1307 "launchpad.source-version": ["1.0"],1344 "launchpad.source-version": ["1.0"],
@@ -1309,12 +1346,15 @@ class TestArtifactoryPoolFromLibrarian(TestCaseWithFactory):
1309 ci_build.git_repository.getCodebrowseUrl()1346 ci_build.git_repository.getCodebrowseUrl()
1310 ],1347 ],
1311 "soss.commit_id": [ci_build.commit_sha1],1348 "soss.commit_id": [ci_build.commit_sha1],
1349 "soss.type": ["binary"],
1312 },1350 },
1313 path.properties,1351 path.properties,
1314 )1352 )
1315 pool.updateProperties(bpph.pool_name, bpph.pool_version, [bpf], bpphs)1353 pool.updateProperties(bpph.pool_name, bpph.pool_version, [bpf], bpphs)
1316 self.assertEqual(1354 self.assertEqual(
1317 {1355 {
1356 "generic.name": ["foo"],
1357 "generic.version": ["1.0"],
1318 "launchpad.release-id": ["binary:%d" % bpr.id],1358 "launchpad.release-id": ["binary:%d" % bpr.id],
1319 "launchpad.source-name": ["foo"],1359 "launchpad.source-name": ["foo"],
1320 "launchpad.source-version": ["1.0"],1360 "launchpad.source-version": ["1.0"],
@@ -1325,6 +1365,7 @@ class TestArtifactoryPoolFromLibrarian(TestCaseWithFactory):
1325 ci_build.git_repository.getCodebrowseUrl()1365 ci_build.git_repository.getCodebrowseUrl()
1326 ],1366 ],
1327 "soss.commit_id": [ci_build.commit_sha1],1367 "soss.commit_id": [ci_build.commit_sha1],
1368 "soss.type": ["binary"],
1328 },1369 },
1329 path.properties,1370 path.properties,
1330 )1371 )
@@ -1377,6 +1418,7 @@ class TestArtifactoryPoolFromLibrarian(TestCaseWithFactory):
1377 "launchpad.source-name": ["foo"],1418 "launchpad.source-name": ["foo"],
1378 "launchpad.source-version": ["1.0"],1419 "launchpad.source-version": ["1.0"],
1379 "deb.version": ["1.0"],1420 "deb.version": ["1.0"],
1421 "soss.type": ["binary"],
1380 },1422 },
1381 path.properties,1423 path.properties,
1382 )1424 )
@@ -1393,6 +1435,7 @@ class TestArtifactoryPoolFromLibrarian(TestCaseWithFactory):
1393 "deb.architecture": [das.architecturetag],1435 "deb.architecture": [das.architecturetag],
1394 "deb.version": ["1.0"],1436 "deb.version": ["1.0"],
1395 "soss.license": ["/usr/share/doc/foo/copyright"],1437 "soss.license": ["/usr/share/doc/foo/copyright"],
1438 "soss.type": ["binary"],
1396 },1439 },
1397 path.properties,1440 path.properties,
1398 )1441 )
diff --git a/lib/lp/archivepublisher/tests/test_pool.py b/lib/lp/archivepublisher/tests/test_pool.py
index a4d4cf5..6e515ad 100644
--- a/lib/lp/archivepublisher/tests/test_pool.py
+++ b/lib/lp/archivepublisher/tests/test_pool.py
@@ -10,8 +10,9 @@ from lazr.enum import EnumeratedType, Item
10from zope.interface import alsoProvides, implementer10from zope.interface import alsoProvides, implementer
1111
12from lp.archivepublisher.diskpool import DiskPool, poolify, unpoolify12from lp.archivepublisher.diskpool import DiskPool, poolify, unpoolify
13from lp.registry.interfaces.sourcepackage import SourcePackageFileType
13from lp.services.log.logger import BufferLogger14from lp.services.log.logger import BufferLogger
14from lp.soyuz.enums import ArchiveRepositoryFormat15from lp.soyuz.enums import ArchiveRepositoryFormat, BinaryPackageFileType
15from lp.soyuz.interfaces.files import (16from lp.soyuz.interfaces.files import (
16 IBinaryPackageFile,17 IBinaryPackageFile,
17 IPackageReleaseFile,18 IPackageReleaseFile,
@@ -78,11 +79,13 @@ class FakePackageReleaseFile:
78 filename,79 filename,
79 release_type=FakeReleaseType.BINARY,80 release_type=FakeReleaseType.BINARY,
80 release_id=1,81 release_id=1,
82 filetype=None,
81 user_defined_fields=None,83 user_defined_fields=None,
82 ci_build=None,84 ci_build=None,
83 ):85 ):
84 self.libraryfile = FakeLibraryFileAlias(contents, filename)86 self.libraryfile = FakeLibraryFileAlias(contents, filename)
85 if release_type == FakeReleaseType.SOURCE:87 if release_type == FakeReleaseType.SOURCE:
88 self.filetype = filetype or SourcePackageFileType.DSC
86 self.sourcepackagereleaseID = release_id89 self.sourcepackagereleaseID = release_id
87 self.sourcepackagerelease = FakePackageRelease(90 self.sourcepackagerelease = FakePackageRelease(
88 release_id,91 release_id,
@@ -91,6 +94,7 @@ class FakePackageReleaseFile:
91 )94 )
92 alsoProvides(self, ISourcePackageReleaseFile)95 alsoProvides(self, ISourcePackageReleaseFile)
93 elif release_type == FakeReleaseType.BINARY:96 elif release_type == FakeReleaseType.BINARY:
97 self.filetype = filetype or BinaryPackageFileType.DEB
94 self.binarypackagereleaseID = release_id98 self.binarypackagereleaseID = release_id
95 self.binarypackagerelease = FakePackageRelease(99 self.binarypackagerelease = FakePackageRelease(
96 release_id, user_defined_fields=user_defined_fields100 release_id, user_defined_fields=user_defined_fields
@@ -107,6 +111,7 @@ class PoolTestingFile:
107 filename,111 filename,
108 release_type=FakeReleaseType.BINARY,112 release_type=FakeReleaseType.BINARY,
109 release_id=1,113 release_id=1,
114 filetype=None,
110 user_defined_fields=None,115 user_defined_fields=None,
111 ):116 ):
112 self.pool = pool117 self.pool = pool
@@ -117,6 +122,7 @@ class PoolTestingFile:
117 filename,122 filename,
118 release_type=release_type,123 release_type=release_type,
119 release_id=release_id,124 release_id=release_id,
125 filetype=filetype,
120 user_defined_fields=user_defined_fields,126 user_defined_fields=user_defined_fields,
121 )127 )
122128
diff --git a/lib/lp/archivepublisher/tests/test_publisher.py b/lib/lp/archivepublisher/tests/test_publisher.py
index e52d5a3..44f54c3 100644
--- a/lib/lp/archivepublisher/tests/test_publisher.py
+++ b/lib/lp/archivepublisher/tests/test_publisher.py
@@ -4221,6 +4221,7 @@ class TestArtifactoryPublishing(TestPublisherBase):
4221 "launchpad.source-name": ["hello"],4221 "launchpad.source-name": ["hello"],
4222 "launchpad.source-version": ["1.0"],4222 "launchpad.source-version": ["1.0"],
4223 "soss.license": ["debian/copyright"],4223 "soss.license": ["debian/copyright"],
4224 "soss.type": ["source"],
4224 },4225 },
4225 source_path.properties,4226 source_path.properties,
4226 )4227 )
@@ -4241,6 +4242,7 @@ class TestArtifactoryPublishing(TestPublisherBase):
4241 "launchpad.source-name": ["hello"],4242 "launchpad.source-name": ["hello"],
4242 "launchpad.source-version": ["1.0"],4243 "launchpad.source-version": ["1.0"],
4243 "soss.license": ["/usr/share/doc/hello/copyright"],4244 "soss.license": ["/usr/share/doc/hello/copyright"],
4245 "soss.type": ["binary"],
4244 },4246 },
4245 binary_path.properties,4247 binary_path.properties,
4246 )4248 )
@@ -4318,6 +4320,7 @@ class TestArtifactoryPublishing(TestPublisherBase):
4318 "launchpad.source-name": ["hello"],4320 "launchpad.source-name": ["hello"],
4319 "launchpad.source-version": ["1.0"],4321 "launchpad.source-version": ["1.0"],
4320 "soss.license": ["debian/copyright"],4322 "soss.license": ["debian/copyright"],
4323 "soss.type": ["source"],
4321 },4324 },
4322 dsc_path.properties,4325 dsc_path.properties,
4323 )4326 )
@@ -4333,6 +4336,7 @@ class TestArtifactoryPublishing(TestPublisherBase):
4333 "launchpad.source-name": ["hello"],4336 "launchpad.source-name": ["hello"],
4334 "launchpad.source-version": ["1.0"],4337 "launchpad.source-version": ["1.0"],
4335 "soss.license": ["debian/copyright"],4338 "soss.license": ["debian/copyright"],
4339 "soss.type": ["source"],
4336 },4340 },
4337 tar_path.properties,4341 tar_path.properties,
4338 )4342 )
@@ -4347,6 +4351,7 @@ class TestArtifactoryPublishing(TestPublisherBase):
4347 "launchpad.source-name": ["hello"],4351 "launchpad.source-name": ["hello"],
4348 "launchpad.source-version": ["1.0"],4352 "launchpad.source-version": ["1.0"],
4349 "soss.license": ["/usr/share/doc/hello/copyright"],4353 "soss.license": ["/usr/share/doc/hello/copyright"],
4354 "soss.type": ["binary"],
4350 },4355 },
4351 binary_path.properties,4356 binary_path.properties,
4352 )4357 )
@@ -4408,6 +4413,7 @@ class TestArtifactoryPublishing(TestPublisherBase):
4408 "launchpad.source-name": ["hello"],4413 "launchpad.source-name": ["hello"],
4409 "launchpad.source-version": ["1.0"],4414 "launchpad.source-version": ["1.0"],
4410 "soss.license": ["debian/copyright"],4415 "soss.license": ["debian/copyright"],
4416 "soss.type": ["source"],
4411 },4417 },
4412 source_path.properties,4418 source_path.properties,
4413 )4419 )
@@ -4419,6 +4425,7 @@ class TestArtifactoryPublishing(TestPublisherBase):
4419 "launchpad.source-name": ["hello"],4425 "launchpad.source-name": ["hello"],
4420 "launchpad.source-version": ["1.0"],4426 "launchpad.source-version": ["1.0"],
4421 "soss.license": ["/usr/share/doc/hello/copyright"],4427 "soss.license": ["/usr/share/doc/hello/copyright"],
4428 "soss.type": ["binary"],
4422 },4429 },
4423 binary_path.properties,4430 binary_path.properties,
4424 )4431 )

Subscribers

People subscribed via source and target branches

to status/vote changes: