Skip to content

Commit 4b84df4

Browse files
author
Taniya Mathur
committed
adding bucket and prefix in checksum
1 parent 3a6e887 commit 4b84df4

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

publish.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1667,7 +1667,13 @@ def get_component_checksum(self, *paths):
16671667
if not hasattr(self, "_component_checksum_cache"):
16681668
self._component_checksum_cache = {}
16691669

1670-
cache_key = tuple(sorted(paths))
1670+
# Include bucket and prefix in cache key to force rebuild when they change
1671+
cache_key = (
1672+
tuple(sorted(paths)),
1673+
self.bucket,
1674+
self.prefix_and_version,
1675+
self.region,
1676+
)
16711677
if cache_key in self._component_checksum_cache:
16721678
return self._component_checksum_cache[cache_key]
16731679

@@ -1680,7 +1686,10 @@ def get_component_checksum(self, *paths):
16801686
# For directories, use source files checksum
16811687
checksums.append(self.get_source_files_checksum(path))
16821688

1683-
combined = "".join(checksums)
1689+
# Include deployment context in checksum calculation
1690+
combined = (
1691+
"".join(checksums) + self.bucket + self.prefix_and_version + self.region
1692+
)
16841693
result = hashlib.sha256(combined.encode()).hexdigest()
16851694

16861695
# Cache the result

0 commit comments

Comments
 (0)