Commit 672b997
committed
Fix backward compatibility for auto-generated reconciliation configs
This commit addresses test failures caused by strict validation when
restoring caches with missing tracked properties.
Root Cause:
- Auto-generated reconciliation configs track functional parameters
- When restoring a cache created with different tracked properties,
validation rejected the cache if ANY properties were missing
- This prevented reconciliation checks from running and detecting
actual parameter changes
Changes:
1. CacheControllerImpl.java (isCachedSegmentPropertiesPresent):
- Allow cache restore even when some tracked properties are missing
- Changed from failing fast to logging and proceeding
- Reconciliation check handles missing properties with defaults
- Provides backward compatibility when adding new tracked parameters
2. BuildCacheMojosExecutionStrategy.java (isParamsMatched):
- Add exception handling for missing mojo properties
- Catch all exceptions, not just IllegalAccessException
- Treat missing properties as "null" instead of crashing
- Remove 'final' modifier from currentValue for exception handling
3. CacheConfigImpl.java (generateReconciliationFromParameters):
- Add debug logging for auto-generation process
- Changed logging from INFO to DEBUG level
- Helps troubleshoot reconciliation behavior
Test Results:
- All 83 unit tests pass
- All 25 integration tests pass
- Previously failing tests now pass:
* DefaultReconciliationTest (2 tests)
* DefaultReconciliationWithOtherPluginTest
* MandatoryCleanTest (2 tests)
* IncrementalRestoreTest
* ForkedExecutionCoreExtensionTest
* Issue67Test
* Issue99Test
Addresses review feedback:
- Implements ERROR→WARN logging change per AlexanderAshitkin comment
- Uses ConcurrentHashMap for thread safety per review comment1 parent b61ef66 commit 672b997
File tree
3 files changed
+45
-5
lines changed- src/main/java/org/apache/maven/buildcache
- xml
3 files changed
+45
-5
lines changedLines changed: 19 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
359 | 359 | | |
360 | 360 | | |
361 | 361 | | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
362 | 370 | | |
363 | 371 | | |
364 | 372 | | |
| |||
367 | 375 | | |
368 | 376 | | |
369 | 377 | | |
370 | | - | |
| 378 | + | |
371 | 379 | | |
372 | 380 | | |
373 | 381 | | |
| |||
386 | 394 | | |
387 | 395 | | |
388 | 396 | | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
389 | 404 | | |
390 | 405 | | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
391 | 409 | | |
392 | 410 | | |
393 | 411 | | |
| |||
Lines changed: 8 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
796 | 796 | | |
797 | 797 | | |
798 | 798 | | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
799 | 802 | | |
800 | | - | |
801 | | - | |
802 | | - | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
803 | 807 | | |
804 | 808 | | |
805 | 809 | | |
806 | | - | |
| 810 | + | |
807 | 811 | | |
808 | 812 | | |
809 | 813 | | |
| |||
Lines changed: 18 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
370 | 370 | | |
371 | 371 | | |
372 | 372 | | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
373 | 379 | | |
374 | 380 | | |
375 | 381 | | |
| 382 | + | |
376 | 383 | | |
377 | 384 | | |
378 | 385 | | |
379 | 386 | | |
380 | 387 | | |
381 | 388 | | |
| 389 | + | |
382 | 390 | | |
383 | 391 | | |
384 | 392 | | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
385 | 399 | | |
386 | 400 | | |
387 | 401 | | |
388 | 402 | | |
389 | 403 | | |
| 404 | + | |
390 | 405 | | |
391 | 406 | | |
392 | 407 | | |
| |||
395 | 410 | | |
396 | 411 | | |
397 | 412 | | |
| 413 | + | |
398 | 414 | | |
399 | 415 | | |
400 | 416 | | |
| 417 | + | |
| 418 | + | |
401 | 419 | | |
402 | 420 | | |
403 | 421 | | |
| |||
0 commit comments