kbuntrock commented on code in PR #92:
URL:
https://github.com/apache/maven-build-cache-extension/pull/92#discussion_r1310736018
##########
src/main/java/org/apache/maven/buildcache/BuildCacheMojosExecutionStrategy.java:
##########
@@ -129,7 +129,8 @@ public void execute(
boolean restored = result.isSuccess(); // if partially restored
need to save increment
if (restorable) {
restored &= restoreProject(result, mojoExecutions,
mojoExecutionRunner, cacheConfig);
- } else {
+ }
+ if (!restored) {
Review Comment:
Alright, finally had some time to work on what you pointed out
@AlexanderAshitkin : regular build after a failed try to use the cache was
handled differently depending the situation.
I will add comments on some lines of this commit to improve your ability to
review it effectively. But here are some global points :
- I moved the part where we check cached mojos consistency before artifact
restoration. There are two benefits : this steps is faster than restoration
over the network. So if we can't use the cache because of mojos parameters,
better to know it before downloading artifacts. And secondly: there are no more
"things" to rollback since setting artifacts of the project is done at the very
end of the restoration.
- I kept the regular build execution outside the "restoreProject" function.
- I execute an extra clean phase only if two conditions are met : clean
phase was requested in the build + there are potentially files restored in the
project directory (it does not happen if we don't restore generated resources,
"outputArtifacts" or if an error occurs before)
I'm removing the draft on this PR since I don't want anymore to link it with
my other PR. The duplicated 3 line function used in IT test can be remove in a
very small 3rd PR.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]