← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~tsimonq2/launchpad:buildinfo-lp1686242 into launchpad:master

 

Simon Quigley has proposed merging ~tsimonq2/launchpad:buildinfo-lp1686242 into launchpad:master.

Commit message:
Include buildinfo files in source and binary records for an upload (LP: #1686242)
    
When buildinfo files are uploaded, either by the packager or the buildd daemon,
they are stored by the librarian but not referenced in SourcePackageReleaseFile or
BinaryPackageFile appropriately. This adds the appropriate references, allowing the
files to be shown on the page.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #1686242 in Launchpad itself: ".changes files reference .buildinfo files that aren't exposed"
  https://bugs.launchpad.net/launchpad/+bug/1686242

For more details, see:
https://code.launchpad.net/~tsimonq2/launchpad/+git/launchpad/+merge/448527

Include buildinfo files in source and binary records for an upload (LP: #1686242)
    
When buildinfo files are uploaded, either by the packager or the buildd daemon, they are stored by the librarian but not referenced in SourcePackageReleaseFile or BinaryPackageFile appropriately. This adds the appropriate references, allowing the files to be shown on the page.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~tsimonq2/launchpad:buildinfo-lp1686242 into launchpad:master.
diff --git a/lib/lp/archiveuploader/dscfile.py b/lib/lp/archiveuploader/dscfile.py
index 59b5087..0221c51 100644
--- a/lib/lp/archiveuploader/dscfile.py
+++ b/lib/lp/archiveuploader/dscfile.py
@@ -785,6 +785,8 @@ class DSCFile(SourceUploadFile, SignableTagFile):
             buildinfo=buildinfo_lfa,
         )
 
+        release.addFile(buildinfo_lfa, SourcePackageFileType.GENERIC)
+
         # SourcePackageFiles should contain also the DSC
         source_files = self.files + [self]
         for uploaded_file in source_files:
diff --git a/lib/lp/archiveuploader/nascentupload.py b/lib/lp/archiveuploader/nascentupload.py
index e7ecb7c..6da9e3d 100644
--- a/lib/lp/archiveuploader/nascentupload.py
+++ b/lib/lp/archiveuploader/nascentupload.py
@@ -49,7 +49,7 @@ from lp.soyuz.adapters.overrides import (
     FromExistingOverridePolicy,
     SourceOverride,
 )
-from lp.soyuz.enums import PackageUploadStatus
+from lp.soyuz.enums import BinaryPackageFileType, PackageUploadStatus
 from lp.soyuz.interfaces.binarypackagename import IBinaryPackageNameSet
 from lp.soyuz.interfaces.component import IComponentSet
 from lp.soyuz.interfaces.queue import QueueInconsistentStateError
@@ -935,15 +935,15 @@ class NascentUpload:
                 assert (
                     self.queue_root.pocket == bpf_build.pocket
                 ), "Binary was not build for the claimed pocket."
-                binary_package_file.storeInDatabase(bpf_build)
+                bpf = binary_package_file.storeInDatabase(bpf_build)
                 if (
                     self.changes.buildinfo is not None
                     and bpf_build.buildinfo is None
                 ):
                     self.changes.buildinfo.checkBuild(bpf_build)
-                    bpf_build.addBuildInfo(
-                        self.changes.buildinfo.storeInDatabase()
-                    )
+                    buildinfo = self.changes.buildinfo.storeInDatabase()
+                    bpf_build.addBuildInfo(buildinfo)
+                    bpf.addFile(buildinfo, BinaryPackageFileType.GENERIC)
                 processed_builds.append(bpf_build)
 
             # Store the related builds after verifying they were built

Follow ups