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

invocation_action_card: render expected outputs #6554

Merged
merged 8 commits into from
May 17, 2024

Conversation

sluongng
Copy link
Contributor

@sluongng sluongng commented May 12, 2024

Render the command's expected outputs so that users can compare them
against the actual outputs in the ActionResult.

Base on #6545

@sluongng sluongng changed the title sluongng/expected outputs invocation_action_card: render expected outputs May 12, 2024
@sluongng
Copy link
Contributor Author

Preview
image

@sluongng
Copy link
Contributor Author

In the case of output_files and output_directories, we can tell whether the client expected a file or a dir. However, these are deprecated in favor of output_paths, which is not possible to tell whether they are files or dirs.

@sluongng
Copy link
Contributor Author

A potentially nice addition to this would be if the ActionResult is available, we could

(a) check if the expected output was created and display a ✅ or ❓ to indicate output available/missing.

(b) display the file type (directory, file, symlink) of the expected output

@sluongng
Copy link
Contributor Author

Hmm, I am not implementing either (a) or (b) because... I can't come up with a design that looks right. 😆

image
image

@sluongng
Copy link
Contributor Author

Hmm, it looks a bit better?
image

@sluongng
Copy link
Contributor Author

Preview of the latest changes

image

@sluongng sluongng marked this pull request as ready for review May 13, 2024 15:05
@siggisim
Copy link
Member

I feel like expected outputs is going to be the same as outputs 99%+ of the time.

If that's the case, then we should just render expected outputs that didn't get created beneath our current list of outputs - maybe in red or something.

@sluongng
Copy link
Contributor Author

@siggisim Oh I think changing this to "Missing Outputs" is a great idea!

But in the case when the Action Result is not available, we should still display the Expected Outputs?

@bduffany
Copy link
Member

bduffany commented May 13, 2024

I kind of like having this flat list of outputs - the outputs tree is a bit clunkier because you can't see all the outputs at a glance and instead have to keep clicking on each directory which has some latency.

(edit: actually, is this right? do we render a nested tree starting from the root dir, or do we render each output path as a separate tree?)

@sluongng
Copy link
Contributor Author

@bduffany currently we only render output directories as trees. Output files and output symlinks are rendered as flat list still. And for the directory, we do 1 tree per dir. So no clicking is required to see all the actual outputs. Only when you want to explore the contents of the output dirs, you can now click for more.

This PR is more about the Expected Outputs. For example, we do render Actions which dont have attached Action Result. In such case, user might still be interested in reviewing what the build rules was expecting the Command to produce.

If Action Result does exist, then there are some duplicated information between the Expected Outputs and actual (File, Dir, Symlink) Outputs like Siggi suggested.

@siggisim
Copy link
Member

@bduffany currently we only render output directories as trees. Output files and output symlinks are rendered as flat list still. And for the directory, we do 1 tree per dir. So no clicking is required to see all the actual outputs. Only when you want to explore the contents of the output dirs, you can now click for more.

This PR is more about the Expected Outputs. For example, we do render Actions which dont have attached Action Result. In such case, user might still be interested in reviewing what the build rules was expecting the Command to produce.

If Action Result does exist, then there are some duplicated information between the Expected Outputs and actual (File, Dir, Symlink) Outputs like Siggi suggested.

I think we should only show expected outputs in two cases:

  1. We don't have the list of actual outputs (i.e. the Action Result isn't present)
  2. The actual outputs and the expected outputs differ (i.e. there is a missing output)

If we show it in other cases, it's a little confusing why they're not clickable, why there are two sets, etc.

@sluongng
Copy link
Contributor Author

sluongng commented May 14, 2024

Preview

  • Expected Outputs:
    image

This could be shown by not registering any Executor.
Actions sent to app will be queued and eventually timeout, thus no Action Result.

  • Missing Outputs:
    image

Tested this by creating an invalid rule which declared an output file, but never created it.
Turns out that the output directory is always created by newer Bazel versions as part of the input root tree. So it's unlikely for the expected output directory to be missing.

@bduffany
Copy link
Member

bduffany commented May 14, 2024

Can you fix the text alignment? The icon alignment looks OK but the alignment of filenames vs. dir names looks off.

Also can we show directories first, then files? Most file UIs that I've used will render them in that order.

image

@sluongng
Copy link
Contributor Author

Latest previews:

  1. Expected outputs

image

  1. Missing outputs

image

@jdhollen jdhollen removed their request for review May 15, 2024 16:46
app/invocation/invocation.css Outdated Show resolved Hide resolved
app/invocation/invocation_action_card.tsx Outdated Show resolved Hide resolved
app/invocation/invocation_action_card.tsx Outdated Show resolved Hide resolved
@sluongng
Copy link
Contributor Author

With the "red" class

image

@sluongng sluongng merged commit 8688199 into master May 17, 2024
17 of 18 checks passed
@sluongng sluongng deleted the sluongng/expected-outputs branch May 17, 2024 13:29
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.

None yet

3 participants