Skip to content
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

[RB] Show full child command in UI #7402

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Conversation

maggie-lou
Copy link
Contributor

@maggie-lou maggie-lou commented Sep 9, 2024

Currently, the UI will only show the command and the pattern - i.e. build //.... Show the full explicit command line to include all flags specified by the user
Related issues: N/A

@maggie-lou maggie-lou force-pushed the child_full_command branch 5 times, most recently from 341115b to 1b3d455 Compare September 9, 2024 17:56
@maggie-lou maggie-lou force-pushed the child_full_command branch 3 times, most recently from 603e33a to 325af06 Compare October 11, 2024 18:01
@maggie-lou maggie-lou changed the title WIP - Show full child command [RB] Show full child command in UI Oct 11, 2024
Comment on lines +57 to +70
// Remove the bazel command string
if (commandLine.startsWith("bazel ")) {
commandLine = commandLine.slice("bazel ".length);
}

// Strip all --remote_header flags
commandLine = commandLine.replace(/\s*--remote_header=[^\s]+/g, "");
// Strip the options we manually added
commandLine = commandLine.replace(" --config=buildbuddy_bes_backend", "");
commandLine = commandLine.replace(" --config=buildbuddy_bes_results_url", "");
commandLine = commandLine.replace(" --config=buildbuddy_remote_cache", "");
commandLine = commandLine.replace(/\s*--invocation_id=[^\s]+/g, "");

return commandLine;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have EXPLICIT_COMMAND_LINE that is intended as a way to override the bazel command displayed in the UI in cases where there is some extra arg fiddling going on (e.g. the CLI) - can we set that build metadata and use it directly instead of "undoing" the arg fiddling here?

Copy link
Contributor Author

@maggie-lou maggie-lou Oct 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realized that the redactor strips EXPLICIT_COMMAND_LINE from the build metadata, so that is actually an ineffective way to override the bazel command displayed in the UI (Here's a PR to remove the code from the CLI. Alternatively, we could add it back and risk there being places we are incorrectly redacting it, which was the original impetus to remove it)

Copy link
Member

@bduffany bduffany Oct 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the redactor strips EXPLICIT_COMMAND_LINE from the build metadata

I think the linked code is stripping one of the CommandLine events, not the BuildMetadata event?

Copy link
Member

@bduffany bduffany Oct 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

after a closer look, that linked code is stripping any nested occurrences of --build_metadata=EXPLICIT_COMMAND_LINE= within the explicit command line (which shouldn't normally happen), but the EXPLICIT_COMMAND_LINE build metadata is still preserved in the BuildMetadata event

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants