converting ForbiddenPatternsTask to .java#36194
converting ForbiddenPatternsTask to .java#36194alpar-t merged 15 commits intoelastic:masterfrom cdschneider:replace-groovy-forbidden-task
Conversation
|
Pinging @elastic/es-core-infra |
alpar-t
left a comment
There was a problem hiding this comment.
Thanks for you contribution @cdschneider !
I left a few minor comments.
Some of them were already there in the Groovy code but I think this is a good opportunity to take care of them.
buildSrc/src/main/java/org/elasticsearch/gradle/precommit/ForbiddenPatternsTask.java
Show resolved
Hide resolved
buildSrc/src/main/java/org/elasticsearch/gradle/precommit/ForbiddenPatternsTask.java
Outdated
Show resolved
Hide resolved
buildSrc/src/main/java/org/elasticsearch/gradle/precommit/ForbiddenPatternsTask.java
Outdated
Show resolved
Hide resolved
buildSrc/src/main/java/org/elasticsearch/gradle/precommit/ForbiddenPatternsTask.java
Outdated
Show resolved
Hide resolved
buildSrc/src/main/java/org/elasticsearch/gradle/precommit/ForbiddenPatternsTask.java
Outdated
Show resolved
Hide resolved
buildSrc/src/test/java/org/elasticsearch/gradle/precommit/ForbiddenPatternsTaskTests.java
Outdated
Show resolved
Hide resolved
buildSrc/src/test/java/org/elasticsearch/gradle/precommit/ForbiddenPatternsTaskTests.java
Outdated
Show resolved
Hide resolved
buildSrc/src/test/java/org/elasticsearch/gradle/precommit/ForbiddenPatternsTaskTests.java
Outdated
Show resolved
Hide resolved
|
@elasticmachine test this please |
…groovy-forbidden-task
|
@elasticmachine test this please |
…t to assert file marker name = task name
There was a problem hiding this comment.
Thanks @cdschneider ! We're almost there, I left just a few comments for small things.
buildSrc/src/main/java/org/elasticsearch/gradle/precommit/ForbiddenPatternsTask.java
Outdated
Show resolved
Hide resolved
| .stream() | ||
| .map(sourceSet -> sourceSet.getAllSource().matching(filesFilter)) | ||
| .reduce(FileTree::plus) | ||
| .orElse(getProject().files().getAsFileTree()); |
There was a problem hiding this comment.
getProject().files() returns a file collection, no need for getAsFileTree
There was a problem hiding this comment.
Because the result of reduce() is an Optional<FileTree>, doesn't the result of the .orElse() statement also need be of type FileTree?
buildSrc/src/test/java/org/elasticsearch/gradle/precommit/ForbiddenPatternsTaskTests.java
Outdated
Show resolved
Hide resolved
|
There are non UTF-8 files in other projects too it seems. Might be worth to catch the exception and wrap it to include the offending file in the error message. You'll be able to fond them all by running |
|
@elasticmachine test this please |
|
@elasticmachine test this please |
|
Thanks again for your contribution @cdschneider, we really appreciate it! |
* converting ForbiddenPatternsTask to java impl & unit tests
|
No problem! Glad I could help! 😄 I will definitely be trying to contributie again soon! |
* elastic/master: (36 commits) Add check for minimum required Docker version (elastic#36497) Minor search controller changes (elastic#36479) Add default methods to DocValueFormat (elastic#36480) Fix the mixed cluster REST test explain/11_basic_with_types. Modify `BigArrays` to take name of circuit breaker (elastic#36461) Move LoggedExec to minimumRuntime source set (elastic#36453) added 6.5.4 version Add test logging for elastic#35644 Tests- added helper methods to ESRestTestCase for checking warnings (elastic#36443) SQL: move requests' parameters to requests JSON body (elastic#36149) [Zen2] Respect the no_master_block setting (elastic#36478) Require soft-deletes when access changes snapshot (elastic#36446) Switch more tests to zen2 (elastic#36367) [Painless] Add extensive tests for def to primitive casts (elastic#36455) Add setting to bypass Rollover action (elastic#36235) Try running CI against Zulu (elastic#36391) [DOCS] Reworked the shard allocation filtering info. (elastic#36456) Log [initial_master_nodes] on formation failure (elastic#36466) converting ForbiddenPatternsTask to .java (elastic#36194) fixed typo ...
a part of #34459 specifically
ForbiddenPatternsTask