Skip to content

Commit

Permalink
Copy 'flags' collection metadata field to published collections (#641)
Browse files Browse the repository at this point in the history
  • Loading branch information
leplatrem authored Jul 18, 2024
1 parent ef60e35 commit ec57392
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,14 @@
FIELD_ID = "id"
FIELD_LAST_MODIFIED = "last_modified"
# Source collection fields to be copied to destination.
PUBLISHED_COLLECTION_FIELDS = ("schema", "sort", "displayFields", "attachment")
PUBLISHED_COLLECTION_FIELDS = (
"flags", # used in build_bundles lambda.
# Admin UI fields
"attachment", # also used in build_bundles lambda.
"schema",
"sort",
"displayFields",
)


class TRACKING_FIELDS(Enum):
Expand Down
22 changes: 22 additions & 0 deletions kinto-remote-settings/tests/signer/test_updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,28 @@ def test_set_destination_signature_copies_kinto_admin_ui_fields(self):
},
)

def test_set_destination_signature_copies_flags_field(self):
self.storage.get.return_value = {
"id": 1234,
"last_modified": 1234,
}
self.updater.set_destination_signature(
mock.sentinel.signature,
{"flags": ["startup"]},
DummyRequest(),
)

self.storage.update.assert_called_with(
resource_name="collection",
object_id="destcollection",
parent_id="/buckets/destbucket",
obj={
"id": 1234,
"signature": mock.sentinel.signature,
"flags": ["startup"],
},
)

def test_update_source_status_modifies_the_source_collection(self):
self.storage.get.return_value = {
"id": 1234,
Expand Down

0 comments on commit ec57392

Please sign in to comment.