Skip to content

Commit

Permalink
Revert to using matches insted of find with remote_download_regex
Browse files Browse the repository at this point in the history
Reverts a change made in e8278ed alongside enabling `allowMultiple` for `--experimental_remote_download_regex`.

It is much easier to accidentally write regexes with pathological performance with `find` than with `matches`. If needed, the `find` functionality can always be obtained with `matches` by prepending and appending `.*` as needed.

In addition, common usage scenarios such as matching by file extension are easier to get right: With `matches`, `jar` will visibly fail to have an effect and is easily corrected to `.*jar` (or even `.*\.jar`), whereas with `find` it will silently fetch entire directories that contain the substring `jar`, potentially causing performance regressions.

Closes #16476.

PiperOrigin-RevId: 481186900
Change-Id: Iaa92c04c42bd4aebc33e7dc268225ab7722cd405
  • Loading branch information
fmeum authored and copybara-github committed Oct 14, 2022
1 parent 021c2a0 commit f499e04
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ public RemoteExecutionService(
this.shouldForceDownloadPredicate =
path -> {
for (Pattern pattern : patterns) {
if (pattern.matcher(path).find()) {
if (pattern.matcher(path).matches()) {
return true;
}
}
Expand Down

0 comments on commit f499e04

Please sign in to comment.