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 a --fail-on-severe flag, but keep it as false #781

Merged
merged 3 commits into from
Dec 24, 2017

Conversation

matanlurey
Copy link
Contributor

Work towards #215.

We can flip this to true after better testing/validation this is a good idea.

I purposefully didn't update the CHANGELOG/pubspec yet, will do before I merge.

@googlebot googlebot added the cla: yes Google is happy with the PR contributors label Dec 23, 2017
onLog ??= stdIOLogListener;
logListener = Logger.root.onRecord.listen((r) {
if (r.level == Level.SEVERE) {
severeLogHandled = true;
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 ever reset this (for watch mode)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

And again in watch_impl.dart.

@jakemac53
Copy link
Contributor

It might be better to fail the whole build early for this case, although doing so is a bit... tricky so this is probably safer.

@matanlurey
Copy link
Contributor Author

Yeah I thought about that, but we don't have a great lifecycle right now.

If we can refactor to have a more clear start/end it will be cleaner to implement both this and lock files.

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.

I think this is fine as is - we can always improve it later if needed.

@matanlurey matanlurey merged commit 1c5c0f1 into dart-lang:master Dec 24, 2017
@matanlurey matanlurey deleted the fail-on-severe branch December 24, 2017 18:40
@@ -31,10 +33,14 @@ class BuildOptions {
// For testing only, skips the build script updates check.
bool skipBuildScriptCheck;

// For internal use only, flipped when a severe log occurred.
bool severeLogHandled = false;
Copy link
Member

Choose a reason for hiding this comment

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

This runs counter to the goal in #95 and makes me a little nervous.

Any particular reason we are using this rather than throwing at the point of the log call?

Copy link
Contributor

Choose a reason for hiding this comment

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

We can (and should) move the boolean to the BuildImpl class to remove the addition of dynamic state to BuildOptions.

The logs are coming from a stream so unless that becomes synchronous failing in the listener is sketchy.

Copy link
Contributor Author

@matanlurey matanlurey Dec 25, 2017

Choose a reason for hiding this comment

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

Do you want me to revert?

Copy link
Member

Choose a reason for hiding this comment

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

I'm fine with the change for now. We can revisit in the linked issue.

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.

4 participants