[
https://issues.apache.org/jira/browse/MBUILDCACHE-79?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Olivier Lamy closed MBUILDCACHE-79.
-----------------------------------
Fix Version/s: 1.2.0
Assignee: Olivier Lamy
Resolution: Fixed
> MBUILDCACHE-67 broke the partial restore process
> ------------------------------------------------
>
> Key: MBUILDCACHE-79
> URL: https://issues.apache.org/jira/browse/MBUILDCACHE-79
> Project: Maven Build Cache Extension
> Issue Type: Bug
> Components: remote build cache
> Affects Versions: 1.1.0
> Reporter: Amir Hadadi
> Assignee: Olivier Lamy
> Priority: Critical
> Fix For: 1.2.0
>
>
> In MBUILDCACHE-67 a bug was introduced in
> BuildCacheMojosExecutionStrategy#execute. Due to the bug, after a partial
> restore from cache all executions that were restored are executed for the
> second time.
> The bug was introduced by changing:
>
> {code:java}
> boolean restorable = result.isSuccess() || result.isPartialSuccess();
> boolean restored = result.isSuccess(); // if partially restored need to save
> increment
> if (restorable) {
> restored &= restoreProject(result, mojoExecutions, mojoExecutionRunner,
> cacheConfig);
> } else {
> for (MojoExecution mojoExecution : mojoExecutions) {{code}
> to:
>
> {code:java}
> boolean restorable = result.isSuccess() || result.isPartialSuccess();
> boolean restored = result.isSuccess(); // if partially restored need to save
> increment
> if (restorable) {
> CacheRestorationStatus cacheRestorationStatus =
> restoreProject(result, mojoExecutions, mojoExecutionRunner, cacheConfig);
> restored &= CacheRestorationStatus.SUCCESS == cacheRestorationStatus;
> executeExtraCleanPhaseIfNeeded(cacheRestorationStatus, cleanPhase,
> mojoExecutionRunner);
> }
> if (!restored) {
> ...{code}
>
> Since partially restored builds have
> {code:java}
> restored == false{code}
> The
> {code:java}
> if (!restored){code}
> block is always executed, rerunning all the plugins (including the restored
> ones).
--
This message was sent by Atlassian Jira
(v8.20.10#820010)