-
Notifications
You must be signed in to change notification settings - Fork 58
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
Build fail issues #122
base: master
Are you sure you want to change the base?
Build fail issues #122
Conversation
Builds should fail with logging during the failure, not at the end. This reverts back to the behaviour prior to yui#115. Build fails still call the appropriate callback function.
Worked out what was going on with the tests and now everything is passing once more. Hope that this is all good for you @caridy. IMO, these changes make the failures clearer and I think that they do the right thing WRT callbacks too. |
@@ -137,7 +138,9 @@ exports.process = function (options, callback) { | |||
} | |||
}); | |||
} else { | |||
callback('no .properties files located, hit the brakes'); | |||
err = 'no .properties files located, hit the brakes'; | |||
log.err(err); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you're about to hit the brakes, why logging the error? normally the error will be logged in the callback
@andrewnicols thanks for taking the time to dig on this, much appreciated. for the sake of simplicity (I already had a hard time dealing with the situation), let's try to keep the changes to the minimum until we release the next version. my main concern at this point is the different workflow, In PR #120 we agreed to have a callback taking care of logging the error and propagating the error upstream to the parent without having to log the error everywhere in the codebase, I will like to stick to that principle. |
Hi @caridy, Thanks for taking the time to look at and review this so quickly. When I first started looking at this, I found that many of the errors which are thrown are inconsistent in format. From what I can tell, the callback work was not completed. As an example, you'll see at https://github.com/yui/shifter/blob/master/lib/module.js#L364 that the callback is called with err, but err is an object and the default callback does not handle that properly. That's why we're getting that nasty output. So in that example (on master), there's a combination of both log.err(err), and callback(err) - but neither works at all. IMO, in order for a callback to be actually useful, we must standardise the format that content passed into it follows, otherwise it's just a meaningless jumble of different types of object which some poor soul has the misfortune to work with. At present we do not do this. In my example above, this occasion of
In actual fact, and from what I can tell, it is actually an object with a structure:
As a result, this particular example of the
(this example can be reached on any version of shifter, including current master, by specifying a jsfile which does not exist) Only, sometimes it does does not fit the structure above, sometimes we get:
This is the case for any fail of the .check() function - for example in the error which is currently ignored at https://github.com/yui/shifter/blob/master/lib/module.js#L570 when we have skin files which are empty. In order to get things working in a sane and usable fashion for the moment, and since I work opposite hours to you and was unable to ask, I went for the option of making the logging work but keeping much of the current callback behaviour consistent. The alternative would be to put a load of logic into the standard callback (logAndExit), but to me this seems wrong. We should not expect anyone using the code to have to do this same calculation to catch every weird and wonderful combination we apparently support. If you want to keep with the logAndExit work, then this whole callback stuff needs finishing:
The callback also only handles log.err, so it's unclear what should happen for info and warnings. Surely the callback should be handling these as the parent app may care about them. Equally, because it currently exits if a message was specified, it's impossible to log multiple lines. IMHO, I think that all of the current callback changes should be reverted to the state at which they were in 0.4.6, and a new version released now. The callbacks work isn't there yet and, as I say, I think that the arguments to the callback need to be better defined. I'm happy to help get this going further, but I don't think that I have enough time to work on standardising the calls to callback right now. Hope that this helps, Andrew |
Hi @caridy, If you have some time, it'd be really good to try and work out the best way to progress this so we can get a new version of Shifter released. What are the best times to get hold of you on hangouts? Cheers, Andrew |
This addresses the various build fail issues that were raised in #115, #118 and #120.
Previous shifter behaviour was broken in a few places and a lot of failures were not printing the errors correctly. This patchset addresses those issues.
This patchset primarily:
It additionally:
I haven't been able to address the unit test failures yet - if someone else has time to do so that'd be good. For some reason I'm not seeing all of the unit tests running when run through npm test, and I'm not getting a list of the failures in order to fix them.
I have, however, built YUI3, and Moodle and am not seeing any shift failures on either project. I've also tested that: