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 storage and re-reporting of previous errors #1581

Merged
merged 10 commits into from
Jun 20, 2018

Conversation

natebosch
Copy link
Member

@natebosch natebosch commented Jun 18, 2018

Closes #910

The main benefit of the proposed --rerun-failing-actions is to be able
to see errors again from previous builds that have scrolled off screen.
The downside to rerunning is that it is a pattern encouraging retrying
non-hermetic actions. Instead we will store and re-print previous error
messages which more directly addresses the need.

This commit sketches out the interaction between the failure reporter
and the build - storage of errors to individual files will happen in a
followup.

Towards #910

The main benefit of the proposed `--rerun-failing-actions` is to be able
to see errors again from previous builds that have scrolled off screen.
The downside to rerunning is that it is a pattern encouraging retrying
non-hermetic actions. Instead we will store and re-print previous error
messages which more directly addresses the need.

This commit sketches out the interaction between the failure reporter
and the build - storage of errors to individual files will happen in a
followup.
@natebosch natebosch requested a review from jakemac53 June 18, 2018 18:12
@googlebot googlebot added the cla: yes Google is happy with the PR contributors label Jun 18, 2018
Copy link
Contributor

@jakemac53 jakemac53 left a comment

Choose a reason for hiding this comment

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

general approach lgtm


import '../asset_graph/node.dart';

/// A tracker for the errors which have already been reported during the current
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: 80 chars (same below)

Copy link
Member Author

Choose a reason for hiding this comment

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

This is at 80 :)

Copy link
Contributor

Choose a reason for hiding this comment

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

🤦‍♂️

await tracker.track(
() => runBuilder(builder, [input], wrappedReader, wrappedWriter,
new PerformanceTrackingResolvers(_resolvers, tracker),
logger: logger,
resourceManager: _resourceManager).catchError((_) {
errorThrown = true;
// Errors tracked throug logger
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to clean up the previous errors before running this builder again? See the _cleanupStaleOutputs call on line 413 above

Copy link
Member Author

Choose a reason for hiding this comment

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

oh yeah, I had put in FailureReporter.clean but forgot to call it. Calling it from within _cleanUpStaleOutputs now.

- Change less in constants.dart
- Clean by primary input instead of by output since for
  PostProcessBuilders there might not be an output
return new Future.value(null);
}));
await FailureReporter.clean(nodes.first);
Copy link
Contributor

Choose a reason for hiding this comment

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

lets leave a comment about why we only call this for the first node

Copy link
Member Author

Choose a reason for hiding this comment

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

ended up removing this approach and it's cleaning based on the primary input now.

/// Log stored errors for any build steps which would output nodes in
/// [failingNodes] which haven't already been reported.
Future<void> reportErrors(Iterable<GeneratedAssetNode> failingNodes) async {
for (final failure in failingNodes) {
Copy link
Contributor

Choose a reason for hiding this comment

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

it is probably worth parallelizing this

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. Do you think I should add a file handle pool? This isn't really in the critical path for a build so it might not make much difference.

Copy link
Contributor

Choose a reason for hiding this comment

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

hmm, you could just use the asset reader as well which would handle this? If somebody has a lot of cascading errors it could cause problems.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'd prefer to leave it using dart:io for now, for consistency.

Since we do directory level work we can't use asset reader/writer for everything.

@natebosch natebosch added this to the build_runner 0.9 milestone Jun 20, 2018
@natebosch natebosch merged commit e6bb538 into master Jun 20, 2018
@natebosch natebosch deleted the report-previous-errors branch June 20, 2018 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Google is happy with the PR contributors
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants