Skip to content
This repository was archived by the owner on Feb 26, 2025. It is now read-only.

Commit 2a90577

Browse files
authored
Do not include preview bucket data in startup.zip (#1496)
1 parent d123c3c commit 2a90577

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

commands/build_bundles.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ def build_bundles(event, context):
226226
)
227227
for changeset in all_changesets
228228
if "startup" in changeset["metadata"].get("flags", [])
229+
and "preview" not in changeset["metadata"]["bucket"]
229230
],
230231
)
231232
bundles_to_upload.append("startup.zip")

tests/test_build_bundles.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,11 @@ def test_build_bundles(mock_fetch_all_changesets, mock_write_zip, mock_sync_clou
201201
"metadata": {"id": "collection5", "bucket": "bucket5", "flags": ["startup"]},
202202
"timestamp": 1720004688000 + 10,
203203
},
204+
{ # collection with startup flag but preview bucket
205+
"changes": [{"id": "record5"}],
206+
"metadata": {"id": "collection5", "bucket": "preview-bucket5", "flags": ["startup"]},
207+
"timestamp": 1720004688000 + 10,
208+
},
204209
{ # collection newly marked as bundled
205210
"changes": [{"id": "record5"}],
206211
"metadata": {"id": "collection6", "bucket": "bucket6", "attachment": {"bundle": True}},
@@ -231,13 +236,14 @@ def test_build_bundles(mock_fetch_all_changesets, mock_write_zip, mock_sync_clou
231236
# Assert the second call (changesets.zip)
232237
changesets_zip_path, changesets_zip_files = calls[1][0]
233238
assert changesets_zip_path == "changesets.zip"
234-
assert len(changesets_zip_files) == 7
239+
assert len(changesets_zip_files) == 8
235240
assert changesets_zip_files[0][0] == "bucket0--collection0.json"
236241
assert changesets_zip_files[1][0] == "bucket1--collection1.json"
237242
assert changesets_zip_files[2][0] == "bucket2--collection2.json"
238243
assert changesets_zip_files[3][0] == "bucket3--collection3.json"
239244
assert changesets_zip_files[4][0] == "bucket4--collection4.json"
240245
assert changesets_zip_files[5][0] == "bucket5--collection5.json"
246+
assert changesets_zip_files[6][0] == "preview-bucket5--collection5.json"
241247

242248
# Assert the third call (startup.zip)
243249
startup_zip_path, startup_zip_files = calls[2][0]
@@ -257,6 +263,7 @@ def test_build_bundles(mock_fetch_all_changesets, mock_write_zip, mock_sync_clou
257263
"bucket2--collection2.zip",
258264
"bucket3--collection3.zip",
259265
"bucket5--collection5.zip",
266+
"preview-bucket5--collection5.zip",
260267
"bucket6--collection6.zip",
261268
],
262269
)

0 commit comments

Comments
 (0)