You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Amir Hadadi (Jira)" <ji...@apache.org> on 2024/01/28 16:30:00 UTC

[jira] [Created] (MBUILDCACHE-79) MBUILDCACHE-67 broke the partial restore process

Amir Hadadi created MBUILDCACHE-79:
--------------------------------------

             Summary: 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


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)