[Launchpad-reviewers] [Merge] ~pelpsi/launchpad:add-fetch-service-certificate-to-secrets into launchpad:master

2024-04-23 Thread Simone Pelosi
Simone Pelosi has proposed merging 
~pelpsi/launchpad:add-fetch-service-certificate-to-secrets into 
launchpad:master.

Commit message:
Add fetch_service_mitm_certificate to secrets

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~pelpsi/launchpad/+git/launchpad/+merge/464850
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of 
~pelpsi/launchpad:add-fetch-service-certificate-to-secrets into 
launchpad:master.
diff --git a/charm/launchpad-buildd-manager/templates/launchpad-buildd-manager-secrets-lazr.conf b/charm/launchpad-buildd-manager/templates/launchpad-buildd-manager-secrets-lazr.conf
index 7637fcb..9b306c1 100644
--- a/charm/launchpad-buildd-manager/templates/launchpad-buildd-manager-secrets-lazr.conf
+++ b/charm/launchpad-buildd-manager/templates/launchpad-buildd-manager-secrets-lazr.conf
@@ -16,3 +16,4 @@
 [builddmaster]
 {{- opt("builder_proxy_auth_api_admin_secret", builder_proxy_auth_api_admin_secret) }}
 {{- opt("fetch_service_control_admin_secret", fetch_service_control_admin_secret) }}
+{{- opt("fetch_service_mitm_certificate", fetch_service_mitm_certificate) }}
___
Mailing list: https://launchpad.net/~launchpad-reviewers
Post to : launchpad-reviewers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~launchpad-reviewers
More help   : https://help.launchpad.net/ListHelp


Re: [Launchpad-reviewers] [Merge] ~tchavadar/launchpad-buildd:use-ubuntu-images-deb into launchpad-buildd:master

2024-04-23 Thread Talha Can Havadar
Yep just rebased, it was weird maybe from the fork I dont know but it 
should be ok now

On 23-04-2024 16:53, Hector CAO wrote:
> The unmerged commits list seems strange, perhaps is it work to rebase 
> properly 
> onhttps://code.launchpad.net/~launchpad/launchpad-buildd/+git/launchpad-buildd/+ref/master
>   ?
-- 
Canonical-20th-anniversary

Talha Can Havadar

Email:



talha.can.hava...@canonical.com

Location:



The Netherlands

canonical.com



ubuntu.com



https://code.launchpad.net/~tchavadar/launchpad-buildd/+git/launchpad-buildd/+merge/464761
Your team Launchpad code reviewers is requested to review the proposed merge of 
~tchavadar/launchpad-buildd:use-ubuntu-images-deb into launchpad-buildd:master.


___
Mailing list: https://launchpad.net/~launchpad-reviewers
Post to : launchpad-reviewers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~launchpad-reviewers
More help   : https://help.launchpad.net/ListHelp


Re: [Launchpad-reviewers] [Merge] ~tchavadar/launchpad-buildd:use-ubuntu-images-deb into launchpad-buildd:master

2024-04-23 Thread Hector CAO
The unmerged commits list seems strange, perhaps is it work to rebase properly 
on 
https://code.launchpad.net/~launchpad/launchpad-buildd/+git/launchpad-buildd/+ref/master
 ?
-- 
https://code.launchpad.net/~tchavadar/launchpad-buildd/+git/launchpad-buildd/+merge/464761
Your team Launchpad code reviewers is requested to review the proposed merge of 
~tchavadar/launchpad-buildd:use-ubuntu-images-deb into launchpad-buildd:master.


___
Mailing list: https://launchpad.net/~launchpad-reviewers
Post to : launchpad-reviewers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~launchpad-reviewers
More help   : https://help.launchpad.net/ListHelp


[Launchpad-reviewers] [Merge] ~pelpsi/launchpad-mojo-specs/+git/private:fetch-service-charmhub-configuration into ~launchpad/launchpad-mojo-specs/+git/private:master

2024-04-23 Thread mp+464821
The proposal to merge 
~pelpsi/launchpad-mojo-specs/+git/private:fetch-service-charmhub-configuration 
into ~launchpad/launchpad-mojo-specs/+git/private:master has been updated.

Status: Approved => Merged

For more details, see:
https://code.launchpad.net/~pelpsi/launchpad-mojo-specs/+git/private/+merge/464821
-- 
Your team Launchpad code reviewers is subscribed to branch 
~launchpad/launchpad-mojo-specs/+git/private:master.


___
Mailing list: https://launchpad.net/~launchpad-reviewers
Post to : launchpad-reviewers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~launchpad-reviewers
More help   : https://help.launchpad.net/ListHelp


[Launchpad-reviewers] [Merge] ~pelpsi/launchpad-mojo-specs/+git/private:fetch-service-charmhub-configuration into ~launchpad/launchpad-mojo-specs/+git/private:master

2024-04-23 Thread Simone Pelosi
The proposal to merge 
~pelpsi/launchpad-mojo-specs/+git/private:fetch-service-charmhub-configuration 
into ~launchpad/launchpad-mojo-specs/+git/private:master has been updated.

Status: Needs review => Approved

For more details, see:
https://code.launchpad.net/~pelpsi/launchpad-mojo-specs/+git/private/+merge/464821
-- 
Your team Launchpad code reviewers is subscribed to branch 
~launchpad/launchpad-mojo-specs/+git/private:master.


___
Mailing list: https://launchpad.net/~launchpad-reviewers
Post to : launchpad-reviewers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~launchpad-reviewers
More help   : https://help.launchpad.net/ListHelp


[Launchpad-reviewers] [Merge] ~pelpsi/launchpad-mojo-specs/+git/private:fetch-service-charmhub-configuration into ~launchpad/launchpad-mojo-specs/+git/private:master

2024-04-23 Thread Simone Pelosi
The proposal to merge 
~pelpsi/launchpad-mojo-specs/+git/private:fetch-service-charmhub-configuration 
into ~launchpad/launchpad-mojo-specs/+git/private:master has been updated.

Commit message changed to:

lp-fetch-service: Deploy fetch-service charm from Charmhub

For more details, see:
https://code.launchpad.net/~pelpsi/launchpad-mojo-specs/+git/private/+merge/464821
-- 
Your team Launchpad code reviewers is subscribed to branch 
~launchpad/launchpad-mojo-specs/+git/private:master.


___
Mailing list: https://launchpad.net/~launchpad-reviewers
Post to : launchpad-reviewers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~launchpad-reviewers
More help   : https://help.launchpad.net/ListHelp


[Launchpad-reviewers] [Merge] ~ines-almeida/launchpad:fetch-service-update-build-metadata-url into launchpad:master

2024-04-23 Thread Ines Almeida
Ines Almeida has proposed merging 
~ines-almeida/launchpad:fetch-service-update-build-metadata-url into 
launchpad:master.

Commit message:
Add DB load bulk load for `build_metadata_url` attributes when getting multiple 
builds

This reduces the number of DB queries made in the case for where a snap has 
multiple builds.
Also: revert commit that commented out a test that verified the snap.builds 
queries number



Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~ines-almeida/launchpad/+git/launchpad/+merge/464839

The test that was previously commented out now runs successfully.
Also added a new test, and re-ran the old `build_metadata_url` related tests 
succesfully.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of 
~ines-almeida/launchpad:fetch-service-update-build-metadata-url into 
launchpad:master.
diff --git a/lib/lp/snappy/model/snapbuild.py b/lib/lp/snappy/model/snapbuild.py
index ea7bf99..842b142 100644
--- a/lib/lp/snappy/model/snapbuild.py
+++ b/lib/lp/snappy/model/snapbuild.py
@@ -6,6 +6,7 @@ __all__ = [
 "SnapFile",
 ]
 
+from collections import defaultdict
 from datetime import timedelta, timezone
 from operator import attrgetter
 
@@ -51,7 +52,7 @@ from lp.registry.model.distribution import Distribution
 from lp.registry.model.distroseries import DistroSeries
 from lp.registry.model.person import Person
 from lp.services.config import config
-from lp.services.database.bulk import load_related
+from lp.services.database.bulk import load_referencing, load_related
 from lp.services.database.constants import DEFAULT
 from lp.services.database.decoratedresultset import DecoratedResultSet
 from lp.services.database.enumcol import DBEnum
@@ -427,12 +428,15 @@ class SnapBuild(PackageBuildMixin, StormBase):
 return [self.lfaUrl(lfa) for _, lfa, _ in self.getFiles()]
 
 @property
-def build_metadata_url(self):
-metadata_filename = BUILD_METADATA_FILENAME_FORMAT.format(
+def metadata_filename(self):
+return BUILD_METADATA_FILENAME_FORMAT.format(
 build_id=self.build_cookie
 )
+
+@cachedproperty
+def build_metadata_url(self):
 try:
-return self.lfaUrl(self.getFileByName(metadata_filename))
+return self.lfaUrl(self.getFileByName(self.metadata_filename))
 except NotFoundError:
 return None
 
@@ -663,6 +667,24 @@ class SnapBuildSet(SpecificBuildFarmJobSourceMixin):
 )
 load_related(Job, sbjs, ["job_id"])
 
+# Prefetch all snaps metadata files
+snap_files = load_referencing(SnapFile, builds, ["snapbuild_id"])
+lfas = load_related(LibraryFileAlias, snap_files, ["libraryfile_id"])
+
+metadata_files = defaultdict(list)
+for snap_file in snap_files:
+if (
+snap_file.libraryfile.filename
+== snap_file.snapbuild.metadata_filename
+):
+metadata_files[snap_file.snapbuild_id] = snap_file.libraryfile
+
+for build in builds:
+cache = get_property_cache(build)
+cache.build_metadata_url = build.lfaUrl(
+metadata_files.get(build.id)
+)
+
 def getByBuildFarmJobs(self, build_farm_jobs):
 """See `ISpecificBuildFarmJobSource`."""
 if len(build_farm_jobs) == 0:
diff --git a/lib/lp/snappy/tests/test_snap.py b/lib/lp/snappy/tests/test_snap.py
index eace8dd..7aa8c29 100644
--- a/lib/lp/snappy/tests/test_snap.py
+++ b/lib/lp/snappy/tests/test_snap.py
@@ -5798,70 +5798,121 @@ class TestSnapWebservice(TestCaseWithFactory):
 self.webservice.get(url)
 self.assertThat(recorder, HasQueryCount(Equals(15)))
 
-# XXX ines-almeida 2024-04-22: after adding the new API attribute
-# `build_metadata_url` to the snap builds, we actually perform an extra
-# query per build. We need to make a decision on whether we are OK with
-# this (and in such case, this test should be reworked or eventually
-# removed)
-#
-# def test_builds_query_count(self):
-# # The query count of Snap.builds is constant in the number of
-# # builds, even if they have store upload jobs.
-# self.pushConfig(
-# "snappy",
-# store_url="http://sca.example/;,
-# store_upload_url="http://updown.example/;,
-# )
-# with admin_logged_in():
-# snappyseries = self.factory.makeSnappySeries()
-# distroseries = self.factory.makeDistroSeries(
-# distribution=getUtility(IDistributionSet)["ubuntu"],
-# registrant=self.person,
-# )
-# processor = self.factory.makeProcessor(supports_virtualized=True)
-# distroarchseries = self.makeBuildableDistroArchSeries(
-# distroseries=distroseries, processor=processor, owner=self.person
-# )
-# with 

[Launchpad-reviewers] [Merge] ~pelpsi/launchpad:unembargo-buildinfo-file into launchpad:master

2024-04-23 Thread Simone Pelosi
Simone Pelosi has proposed merging ~pelpsi/launchpad:unembargo-buildinfo-file 
into launchpad:master.

Commit message:
Unembargo build info

Added buildinfo to unembargoed files.

LP: #2052796

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #2052796 in Launchpad itself: "MIssing buildinfo file for Jammy 
grub2-unsigned 2.06-2ubuntu14.4"
  https://bugs.launchpad.net/launchpad/+bug/2052796

For more details, see:
https://code.launchpad.net/~pelpsi/launchpad/+git/launchpad/+merge/464838
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of 
~pelpsi/launchpad:unembargo-buildinfo-file into launchpad:master.
diff --git a/lib/lp/soyuz/scripts/packagecopier.py b/lib/lp/soyuz/scripts/packagecopier.py
index f377107..bc31af0 100644
--- a/lib/lp/soyuz/scripts/packagecopier.py
+++ b/lib/lp/soyuz/scripts/packagecopier.py
@@ -87,6 +87,8 @@ def update_files_privacy(pub_record):
 package_files.append((package_upload, "changesfile"))
 # Unrestrict the buildlog file as necessary.
 package_files.append((build, "log"))
+# Unrestrict the buildinfo file as necessary.
+package_files.append((build, "buildinfo"))
 elif IPackageUploadCustom.providedBy(pub_record):
 # Unrestrict the custom files included
 package_files.append((pub_record, "libraryfilealias"))
diff --git a/lib/lp/soyuz/tests/test_packagecopyjob.py b/lib/lp/soyuz/tests/test_packagecopyjob.py
index 26fdd08..033dd6a 100644
--- a/lib/lp/soyuz/tests/test_packagecopyjob.py
+++ b/lib/lp/soyuz/tests/test_packagecopyjob.py
@@ -1757,6 +1757,12 @@ class PlainPackageCopyJobTests(TestCaseWithFactory, LocalTestHelper):
 distroseries=self.distroseries,
 status=PackagePublishingStatus.PUBLISHED,
 )
+[build] = spph.getBuilds()
+build.addBuildInfo(
+self.factory.makeLibraryFileAlias(
+filename="build_info.info", restricted=True
+)
+)
 spr = spph.sourcepackagerelease
 for source_file in spr.files:
 self.assertTrue(source_file.libraryfile.restricted)
@@ -1837,6 +1843,7 @@ class PlainPackageCopyJobTests(TestCaseWithFactory, LocalTestHelper):
 copied_build = copied_binary.binarypackagerelease.build
 self.assertFalse(copied_build.upload_changesfile.restricted)
 self.assertFalse(copied_build.log.restricted)
+self.assertFalse(copied_build.buildinfo.restricted)
 
 def test_copy_custom_upload_files(self):
 # Copyable custom upload files are queued for republication when
___
Mailing list: https://launchpad.net/~launchpad-reviewers
Post to : launchpad-reviewers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~launchpad-reviewers
More help   : https://help.launchpad.net/ListHelp


Re: [Launchpad-reviewers] [Merge] ~pelpsi/launchpad-mojo-specs/+git/private:fetch-service-charmhub-configuration into ~launchpad/launchpad-mojo-specs/+git/private:master

2024-04-23 Thread Ines Almeida
Review: Approve

Looks good!

Can you update the commit message to start with the model in question?

I.e.
```
lp-fetch-service: Deploy fetch-service charm from Charmhub
```

Diff comments:

> diff --git a/lp-fetch-service/bundle.yaml b/lp-fetch-service/bundle.yaml
> index 8bd8dd3..67472ee 100644
> --- a/lp-fetch-service/bundle.yaml
> +++ b/lp-fetch-service/bundle.yaml
> @@ -16,9 +16,11 @@ applications:
>  public. Currently, this expects the charm and snap to be copied to 
> the
>  path where the bundle.yaml is rendered, in the mojo project folder 
> (eg.
>  .../mojo/lp-fetch-service/jammy/devel/charms/lp-fetch-service/). #}
> -charm: "./fetch-service_ubuntu-22.04-amd64.charm"
> -resources:
> -  snap: "./fetch-service.snap"
> +charm: ch:fetch-service
> +channel: edge
> +revision: 4
>  num_units: 1
>  expose: true
> +options:
> +channel: "latest/edge"

I'm guessing this is the snap channel? If so can you add a quick comment here 
saying so?

>  {%- endif %}


-- 
https://code.launchpad.net/~pelpsi/launchpad-mojo-specs/+git/private/+merge/464821
Your team Launchpad code reviewers is subscribed to branch 
~launchpad/launchpad-mojo-specs/+git/private:master.


___
Mailing list: https://launchpad.net/~launchpad-reviewers
Post to : launchpad-reviewers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~launchpad-reviewers
More help   : https://help.launchpad.net/ListHelp


[Launchpad-reviewers] [Merge] ~pelpsi/launchpad-mojo-specs/+git/private:fetch-service-charmhub-configuration into ~launchpad/launchpad-mojo-specs/+git/private:master

2024-04-23 Thread Simone Pelosi
Simone Pelosi has proposed merging 
~pelpsi/launchpad-mojo-specs/+git/private:fetch-service-charmhub-configuration 
into ~launchpad/launchpad-mojo-specs/+git/private:master.

Commit message:
Get fetch-service from Charmhub

Requested reviews:
  Canonical Launchpad Engineering (launchpad)

For more details, see:
https://code.launchpad.net/~pelpsi/launchpad-mojo-specs/+git/private/+merge/464821
-- 
Your team Launchpad code reviewers is subscribed to branch 
~launchpad/launchpad-mojo-specs/+git/private:master.
diff --git a/lp-fetch-service/bundle.yaml b/lp-fetch-service/bundle.yaml
index 8bd8dd3..67472ee 100644
--- a/lp-fetch-service/bundle.yaml
+++ b/lp-fetch-service/bundle.yaml
@@ -16,9 +16,11 @@ applications:
 public. Currently, this expects the charm and snap to be copied to the
 path where the bundle.yaml is rendered, in the mojo project folder (eg.
 .../mojo/lp-fetch-service/jammy/devel/charms/lp-fetch-service/). #}
-charm: "./fetch-service_ubuntu-22.04-amd64.charm"
-resources:
-  snap: "./fetch-service.snap"
+charm: ch:fetch-service
+channel: edge
+revision: 4
 num_units: 1
 expose: true
+options:
+channel: "latest/edge"
 {%- endif %}
___
Mailing list: https://launchpad.net/~launchpad-reviewers
Post to : launchpad-reviewers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~launchpad-reviewers
More help   : https://help.launchpad.net/ListHelp