-
Notifications
You must be signed in to change notification settings - Fork 59
[MBUILDCACHE-90] A "mandatory clean" option to enable the caching functionnality #103
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
Conversation
6461415 to
b66e7ce
Compare
|
@kbuntrock have you hit any real problems after skipping Clean phase? |
Not yet since I'm waiting for my evolution suggestions on outputs + maybe the next official release to adopt it on my projects. But since going through a clean phase is necessary sometimes to insure nothing from an old build interfere with the current one, I don't want to deal with a clean phase not solving this kind of issues because the faulty build is cached. I get that I'm not addressing a daily issue, but I suspect some waste of time from me or another senior dev to investigate the problem the days this occurs. |
| while (it.hasNext()) { | ||
| String line = verifier.stripAnsi((String) it.next()); | ||
| boolean matches = true; | ||
| Iterator<String> toMatchIterator = Arrays.stream(texts).iterator(); |
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.
Not a critical piece of code, but it is more elegant and efficient to use StringUtils#containsAny and Stream#anyMatch:
return Files.lines(filePath) // or lines.stream()
.anyMatch(line -> StringUtils.containsAny(line, texts));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.
Done. Slightly changed you proposal since the goal is to test the presence of all strings.
|
|
||
| @Override | ||
| public boolean isMandatoryClean() { | ||
| return getConfiguration().isMandatoryClean(); |
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.
It might be handy to add a command line property as well
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.
Done :)
b66e7ce to
d98ca59
Compare
d98ca59 to
6a3673e
Compare
6a3673e to
ae67809
Compare
|
@olamy: Merge conflicts are resolved. Please merge this one before [MBUILDCACHE-86] (which I will fix after this merge) |
|
Resolve #264 |
1 similar comment
|
Resolve #264 |
Description of this pull request
Hello everyone,
A small PR to suggest an evolution : a configuration option to make mandatory the use of the clean phase in order to cache the build result.
The goal is to offer the possibility of denying as much as possible the possibility to cache a faulty build.
What do you think of the idea? :)
EDIT : created the issue in JIRA : https://issues.apache.org/jira/browse/MBUILDCACHE-90
MR checklist
Following this checklist to help us incorporate your
contribution quickly and easily:
for the change (usually before you start working on it). Trivial changes like typos do not
require a JIRA issue. Your pull request should address just this issue, without
pulling in other changes.
[MBUILDCACHE-XXX] - Fixes bug in ApproximateQuantiles,where you replace
MBUILDCACHE-XXXwith the appropriate JIRA issue. Best practiceis to use the JIRA issue title in the pull request title and in the first line of the
commit message.
mvn clean verifyto make sure basic checks pass. A more thorough check willbe performed on your pull request automatically.
If your pull request is about ~20 lines of code you don't need to sign an
Individual Contributor License Agreement if you are unsure
please ask on the developers list.
To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.
I hereby declare this contribution to be licenced under the Apache License Version 2.0, January 2004
In any other case, please file an Apache Individual Contributor License Agreement.
NB: Not checked the lines about JIRA since getting rid of it is progress.