Skip to content

Commit

Permalink
bes: add --bes_results_url
Browse files Browse the repository at this point in the history
Closes bazelbuild#4628
Closes bazelbuild#5155.

PiperOrigin-RevId: 195662967
  • Loading branch information
buchgr authored and Copybara-Service committed May 7, 2018
1 parent b0b2d2a commit d06a366
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import static java.lang.String.format;

import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Strings;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import com.google.devtools.build.lib.authandtls.AuthAndTLSOptions;
Expand Down Expand Up @@ -218,11 +219,20 @@ private BuildEventTransport tryCreateBesTransport(
logger.fine(format("Will create BuildEventServiceTransport streaming to '%s'",
besOptions.besBackend));

commandLineReporter.handle(
Event.info(
format(
"Streaming Build Event Protocol to %s build_request_id: %s invocation_id: %s",
besOptions.besBackend, buildRequestId, invocationId)));
final String message;
if (!Strings.isNullOrEmpty(besOptions.besResultsUrl)) {
String url =
besOptions.besResultsUrl.endsWith("/")
? besOptions.besResultsUrl
: besOptions.besResultsUrl + "/";
message = "Streaming Build Event Protocol to " + url + invocationId;
} else {
message =
format(
"Streaming Build Event Protocol to %s build_request_id: %s " + "invocation_id: %s",
besOptions.besBackend, buildRequestId, invocationId);
}
commandLineReporter.handle(Event.info(message));

BuildEventTransport besTransport =
new BuildEventServiceTransport(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,15 @@ public class BuildEventServiceOptions extends OptionsBase {
+ "event, even if larger than the specified value."
)
public long besOuterrBufferSize;

@Option(
name = "bes_results_url",
defaultValue = "",
documentationCategory = OptionDocumentationCategory.LOGGING,
effectTags = {OptionEffectTag.TERMINAL_OUTPUT},
help =
"Specifies the base URL where a user can view the information streamed to the BES"
+ " backend. Bazel will output the URL appended by the invocation id to the"
+ " terminal.")
public String besResultsUrl;
}

0 comments on commit d06a366

Please sign in to comment.