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

Add support for displaying artifacts populated via namedSetOfFiles #1356

Merged
merged 3 commits into from
Jan 3, 2022

Conversation

siggisim
Copy link
Member

@siggisim siggisim commented Jan 3, 2022

This prepares us for the impending flip of the --legacy_important_outputs flag in future bazel versions: bazelbuild/bazel#14353


Version bump: Patch

@siggisim siggisim requested a review from bduffany January 3, 2022 20:04
if (event.completed.importantOutput?.length) {
return event.completed.importantOutput;
}
return event.completed.outputGroup?.flatMap((group) => group.fileSets).flatMap((set) => this.files.get(set.id));
Copy link
Member

Choose a reason for hiding this comment

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

nit: maybe change to this.files.get(set.id) || [] just to be safe?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

Copy link
Member

Choose a reason for hiding this comment

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

Sry I meant like

.flatMap((set) => this.fileSetIDToFilesMap.get(set.id) || [])

(.get() returns undefined if the entry isn't found in the map)

Copy link
Member Author

Choose a reason for hiding this comment

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

Will send fix in another PR

@@ -29,7 +29,7 @@ export default class InvocationModel {
brokenTest: build_event_stream.BuildEvent[] = [];
flakyTest: build_event_stream.BuildEvent[] = [];
timeoutTest: build_event_stream.BuildEvent[] = [];
files: build_event_stream.NamedSetOfFiles[] = [];
files: Map<string, build_event_stream.IFile[]> = new Map();
Copy link
Member

Choose a reason for hiding this comment

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

nit: consider making this private so people don't accidentally reference this instead of getFiles

Also consider adding a comment describing what the keys represent, or rename to something like xToFilesMap

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

@siggisim siggisim merged commit cad4778 into master Jan 3, 2022
@siggisim siggisim deleted the siggi-dev-branch-31627 branch January 3, 2022 21:28
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