From 6eb3b85e6602dd9d1f33d18344236d776bc7a006 Mon Sep 17 00:00:00 2001 From: itvi-1234 Date: Wed, 11 Nov 2026 18:30:23 +0530 Subject: [PATCH] Make the publication test archives deterministic make_assets built the test zips with ZipFile.writestr(name, data), which stamps each entry with the current time at two second resolution. The test test_unchanged_module_tag_is_reusable_after_unrelated_commits builds the assets twice around a commit, so when the builds fell into different two second windows the archives differed and promote failed with "existing release asset differs". The test failed at random, which failed the Test publication helpers step of the Publish Go bindings workflow, and the same test runs in Tests and Generate. Write the entries with a fixed timestamp, as the orchestrator's deterministic zips do. Forcing the two builds more than two seconds apart failed before this change and passes after it. --- tooling/extension-bindings/ci/test_publish.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tooling/extension-bindings/ci/test_publish.py b/tooling/extension-bindings/ci/test_publish.py index d80f510..767fd36 100644 --- a/tooling/extension-bindings/ci/test_publish.py +++ b/tooling/extension-bindings/ci/test_publish.py @@ -114,7 +114,12 @@ def make_assets(self): prefix = binding.directory + "/" if suffix == ".source.zip" else binding.module + "@v" + binding.version + "/" with zipfile.ZipFile(path, "w") as archive: for source in sorted((self.root / binding.directory).iterdir()): - archive.writestr(prefix + source.name, source.read_bytes()) + # A fixed timestamp keeps the archive identical on every build, like the + # orchestrator's deterministic zips. writestr(name, ...) would stamp the + # current time and fail the "existing release asset differs" check + # whenever two builds straddle a two second boundary. + entry = zipfile.ZipInfo(prefix + source.name, date_time=(1980, 1, 1, 0, 0, 0)) + archive.writestr(entry, source.read_bytes()) else: path.write_text("test resource\n") manifest[path.name] = hashlib.sha256(path.read_bytes()).hexdigest()