-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BREAKING-CHANGE] [NCL-6230] store and share sizes of not built artifacts #297
Conversation
Codecov Report
@@ Coverage Diff @@
## master #297 +/- ##
============================================
- Coverage 69.00% 68.55% -0.45%
- Complexity 622 629 +7
============================================
Files 38 39 +1
Lines 3049 3101 +52
Branches 378 379 +1
============================================
+ Hits 2104 2126 +22
- Misses 769 801 +32
+ Partials 176 174 -2
Continue to review full report at Codecov.
|
core/src/main/java/org/jboss/pnc/build/finder/core/LocalFile.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/jboss/pnc/build/finder/core/LocalFile.java
Outdated
Show resolved
Hide resolved
core/src/test/java/org/jboss/pnc/build/finder/core/CompletedBuildTest.java
Outdated
Show resolved
Hide resolved
core/src/test/java/org/jboss/pnc/build/finder/core/it/FileErrorIT.java
Outdated
Show resolved
Hide resolved
core/src/test/java/org/jboss/pnc/build/finder/core/it/RpmBuildIdNotFoundIT.java
Outdated
Show resolved
Hide resolved
core/src/test/java/org/jboss/pnc/build/finder/core/it/RpmIT.java
Outdated
Show resolved
Hide resolved
core/src/test/java/org/jboss/pnc/build/finder/core/it/RpmNvrNotFoundIT.java
Outdated
Show resolved
Hide resolved
report/src/test/java/org/jboss/pnc/build/finder/report/it/RpmBuildIdNotFoundReportIT.java
Outdated
Show resolved
Hide resolved
report/src/test/java/org/jboss/pnc/build/finder/report/it/RpmReportIT.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One final comment on the breaking cache change. Unfortunately, while we have a version for the externalizer, we do not store a version for the cache itself.
Can we at least catch the exception thrown when the old version of build-finder cannot load the new cache (given that this is a breaking change) and at least print an error to better inform the user what to do? Something like:
LOGGER.error("Error loading cache {}: {}. The cache format has changed and you will have to manually delete the existing cache", boldRed(pathToCache), boldRed(e.getMessage()), e);
I'll see what I can do. |
core/src/main/java/org/jboss/pnc/build/finder/core/Checksum.java
Outdated
Show resolved
Hide resolved
@@ -318,6 +327,10 @@ private static boolean isJar(FileObject fo) { | |||
return Collections.unmodifiableMap(map); | |||
} | |||
|
|||
private String getCacheLocation() { | |||
return new File(ConfigDefaults.CONFIG_PATH, "cache").getAbsolutePath(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I guess you got this from Main.initCaches
which has String location = new File(ConfigDefaults.CONFIG_PATH, "cache").getAbsolutePath();
.
But, here is not the right place for it. We need the actual value it has been set to.
Then we have Main
call something to set it, and only return the default path if unset.
Also, we could define a global default in ConfigDefaults
, but defaulting to CONFIG_PATH, "cache"
is OK, too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added an option to specify cache location so that we take the value from config instead of creating it on the spot. Is this a suitable solution? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current value appears to be ConfigDefaults.CONFIG_PATH + "/cache"
.
Rather than specify the cache directory, we should just specify on the command line the default app home directory, which is normally ${user.home}/.build-finder
and allow the user to change this location, but then the cache path would always be relative to that location. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I was initially against having the option to specify the cache-location because I didn't like the implementation but it is not that ugly I suppose. Keeping it relative to the app-directory is better, I agree.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I like your proposal much more. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to change the cache location now? Looking at the code, I wasn't sure, the ConfigDefaults
file was changed, but these paths should be immutable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it shouldn't be possible to change cache location. The cache location is bound to the root path (app home directory), which is unchangeable.
…ld ISPN cache format
36b8d30
to
b6752b8
Compare
ee0d731
to
eb1b549
Compare
This is a breaking change for 3 reasons: