diff --git a/src/main/java/com/google/devtools/build/lib/remote/ByteStreamBuildEventArtifactUploader.java b/src/main/java/com/google/devtools/build/lib/remote/ByteStreamBuildEventArtifactUploader.java index 2593a677a967d5..3efae51ce6dde6 100644 --- a/src/main/java/com/google/devtools/build/lib/remote/ByteStreamBuildEventArtifactUploader.java +++ b/src/main/java/com/google/devtools/build/lib/remote/ByteStreamBuildEventArtifactUploader.java @@ -212,14 +212,15 @@ private boolean shouldQuery(PathMetadata path) { } private boolean shouldUpload(PathMetadata path) { - boolean result = - path.getDigest() != null && !path.isRemote() && !path.isDirectory() && !path.isOmitted(); + return path.getDigest() != null && !path.isRemote() && !path.isDirectory() && !path.isOmitted(); + } + private boolean shouldUploadBasedOnUploadMode(PathMetadata path) { if (remoteBuildEventUploadMode == RemoteBuildEventUploadMode.MINIMAL) { - result = result && (isTestLog(path) || isProfile(path)); + return isTestLog(path) || isProfile(path); } - return result; + return true; } private boolean isTestLog(PathMetadata path) { @@ -236,7 +237,9 @@ private Single> queryRemoteCache( List filesToQuery = new ArrayList<>(); Set digestsToQuery = new HashSet<>(); for (PathMetadata path : paths) { - if (shouldQuery(path)) { + if (!shouldUploadBasedOnUploadMode(path)) { + continue; + } else if (shouldQuery(path)) { filesToQuery.add(path); digestsToQuery.add(path.getDigest()); } else {