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

Proposed by Simon Quigley
Status: Needs review
Proposed branch: ~tsimonq2/launchpad:buildinfo-lp1686242
Merge into: launchpad:master
Diff against target: 46 lines (+7/-5)
2 files modified
lib/lp/archiveuploader/dscfile.py (+2/-0)
lib/lp/archiveuploader/nascentupload.py (+5/-5)
Reviewer Review Type Date Requested Status
Colin Watson (community) Needs Fixing
Review via email: mp+448527@code.launchpad.net

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.

Description of the change

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.

To post a comment you must log in.
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

This needs unit tests, for example webui tests to check these files appear.

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

It would be best to be able to publish it in the apt archive maybe somehow.

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

I don't think this is the right approach. The buildinfo is already linked to the `SourcePackageRelease`/`BinaryPackageBuild` using dedicated columns, so we shouldn't make extra links for it via `SourcePackageReleaseFile`/`BinaryPackageFile` (especially not as a "generic" file). Instead, the API/UI layers should be changed to provide some way to get at the data that's already stored.

review: Needs Fixing
Revision history for this message
Guruprasad (lgp171188) wrote :

Hi Simon, the issue that this MP tries to fix has been fixed via https://code.launchpad.net/~wgrant/launchpad/+git/launchpad/+ref/buildinfo-exposure. So can you close this MP if there is nothing else to be done here?

Unmerged commits

e721bd2... by Simon Quigley

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.

Succeeded
[SUCCEEDED] docs:0 (build)
[SUCCEEDED] lint:0 (build)
[SUCCEEDED] mypy:0 (build)
13 of 3 results

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/lib/lp/archiveuploader/dscfile.py b/lib/lp/archiveuploader/dscfile.py
2index 59b5087..0221c51 100644
3--- a/lib/lp/archiveuploader/dscfile.py
4+++ b/lib/lp/archiveuploader/dscfile.py
5@@ -785,6 +785,8 @@ class DSCFile(SourceUploadFile, SignableTagFile):
6 buildinfo=buildinfo_lfa,
7 )
8
9+ release.addFile(buildinfo_lfa, SourcePackageFileType.GENERIC)
10+
11 # SourcePackageFiles should contain also the DSC
12 source_files = self.files + [self]
13 for uploaded_file in source_files:
14diff --git a/lib/lp/archiveuploader/nascentupload.py b/lib/lp/archiveuploader/nascentupload.py
15index e7ecb7c..6da9e3d 100644
16--- a/lib/lp/archiveuploader/nascentupload.py
17+++ b/lib/lp/archiveuploader/nascentupload.py
18@@ -49,7 +49,7 @@ from lp.soyuz.adapters.overrides import (
19 FromExistingOverridePolicy,
20 SourceOverride,
21 )
22-from lp.soyuz.enums import PackageUploadStatus
23+from lp.soyuz.enums import BinaryPackageFileType, PackageUploadStatus
24 from lp.soyuz.interfaces.binarypackagename import IBinaryPackageNameSet
25 from lp.soyuz.interfaces.component import IComponentSet
26 from lp.soyuz.interfaces.queue import QueueInconsistentStateError
27@@ -935,15 +935,15 @@ class NascentUpload:
28 assert (
29 self.queue_root.pocket == bpf_build.pocket
30 ), "Binary was not build for the claimed pocket."
31- binary_package_file.storeInDatabase(bpf_build)
32+ bpf = binary_package_file.storeInDatabase(bpf_build)
33 if (
34 self.changes.buildinfo is not None
35 and bpf_build.buildinfo is None
36 ):
37 self.changes.buildinfo.checkBuild(bpf_build)
38- bpf_build.addBuildInfo(
39- self.changes.buildinfo.storeInDatabase()
40- )
41+ buildinfo = self.changes.buildinfo.storeInDatabase()
42+ bpf_build.addBuildInfo(buildinfo)
43+ bpf.addFile(buildinfo, BinaryPackageFileType.GENERIC)
44 processed_builds.append(bpf_build)
45
46 # Store the related builds after verifying they were built

Subscribers

People subscribed via source and target branches

to status/vote changes: