Commit d9fc24f
committed
Add test and documentation for timestamp inclusion in cache checksums
When preserveTimestamps=true, file timestamps are stored in ZIP entry headers,
making them part of the ZIP file's binary content. This ensures that hashing
the ZIP file (for cache keys) includes timestamp information, providing proper
cache invalidation when file timestamps change.
Changes:
- Added testTimestampsAffectFileHash() test verifying that ZIP files with same
content but different timestamps produce different hashes
- Added JavaDoc documentation in CacheUtils.zip() explaining that timestamps
affect cache checksums when preservation is enabled
- Behavior is analogous to Git's inclusion of file mode in tree hashes
This addresses the architectural correctness concern that metadata preserved
during cache restoration should also be part of the cache key computation.1 parent a1321b5 commit d9fc24f
File tree
2 files changed
+53
-1
lines changed- src
- main/java/org/apache/maven/buildcache
- test/java/org/apache/maven/buildcache
2 files changed
+53
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
163 | | - | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
164 | 169 | | |
165 | 170 | | |
166 | 171 | | |
| |||
Lines changed: 47 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
426 | 426 | | |
427 | 427 | | |
428 | 428 | | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
429 | 476 | | |
430 | 477 | | |
431 | 478 | | |
| |||
0 commit comments