launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #30991
[Merge] ~ruinedyourlife/launchpad:feat-archive-metadata-overrides into launchpad:master
Quentin Debhi has proposed merging ~ruinedyourlife/launchpad:feat-archive-metadata-overrides into launchpad:master.
Commit message:
Add new field Archive.metadata_overrides to models and interfaces
This field can be used for storing per-archive metadata overrides
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~ruinedyourlife/launchpad/+git/launchpad/+merge/463030
--
Your team Launchpad code reviewers is requested to review the proposed merge of ~ruinedyourlife/launchpad:feat-archive-metadata-overrides into launchpad:master.
diff --git a/lib/lp/soyuz/interfaces/archive.py b/lib/lp/soyuz/interfaces/archive.py
index e1521ce..cc48143 100644
--- a/lib/lp/soyuz/interfaces/archive.py
+++ b/lib/lp/soyuz/interfaces/archive.py
@@ -1021,6 +1021,8 @@ class IArchiveView(IHasBuildRecords):
"pending publications."
)
+ metada_overrides = Attribute("A dict of data about the archive.")
+
processors = exported(
CollectionField(
title=_("Processors"),
@@ -2772,6 +2774,7 @@ class IArchiveSet(Interface):
processors=None,
publishing_method=None,
repository_format=None,
+ metadata_overrides=None,
):
"""Create a new archive.
diff --git a/lib/lp/soyuz/model/archive.py b/lib/lp/soyuz/model/archive.py
index b86c2e9..fad0440 100644
--- a/lib/lp/soyuz/model/archive.py
+++ b/lib/lp/soyuz/model/archive.py
@@ -364,6 +364,8 @@ class Archive(StormBase):
dirty_suites = JSON(name="dirty_suites", allow_none=True)
+ metadata_overrides = JSON(name="metadata_overrides", allow_none=True)
+
_publishing_method = DBEnum(
name="publishing_method", allow_none=True, enum=ArchivePublishingMethod
)
@@ -388,6 +390,7 @@ class Archive(StormBase):
signing_key_fingerprint=None,
publishing_method=None,
repository_format=None,
+ metadata_overrides=None,
):
super().__init__()
try:
@@ -404,6 +407,7 @@ class Archive(StormBase):
self.signing_key_fingerprint = signing_key_fingerprint
self.publishing_method = publishing_method
self.repository_format = repository_format
+ self.metadata_overrides = metadata_overrides
except Exception:
# If validating references such as `owner` fails, then the new
# object may have been added to the store first. Remove it
@@ -3428,6 +3432,7 @@ class ArchiveSet:
processors=None,
publishing_method=ArchivePublishingMethod.LOCAL,
repository_format=ArchiveRepositoryFormat.DEBIAN,
+ metadata_overrides=None,
):
"""See `IArchiveSet`."""
if distribution is None:
@@ -3514,6 +3519,7 @@ class ArchiveSet:
require_virtualized=require_virtualized,
publishing_method=publishing_method,
repository_format=repository_format,
+ metadata_overrides=metadata_overrides,
)
# Upon creation archives are enabled by default.
diff --git a/lib/lp/testing/factory.py b/lib/lp/testing/factory.py
index 57d1d45..dfcab70 100644
--- a/lib/lp/testing/factory.py
+++ b/lib/lp/testing/factory.py
@@ -3702,6 +3702,7 @@ class LaunchpadObjectFactory(ObjectFactory):
processors=None,
publishing_method=ArchivePublishingMethod.LOCAL,
repository_format=ArchiveRepositoryFormat.DEBIAN,
+ metadata_overrides=None,
):
"""Create and return a new arbitrary archive.
@@ -3761,6 +3762,7 @@ class LaunchpadObjectFactory(ObjectFactory):
processors=processors,
publishing_method=publishing_method,
repository_format=repository_format,
+ metadata_overrides=metadata_overrides,
)
if private:
Follow ups