grunt build should warn/abort if specified files are not found

RESOLVED FIXED

Status

P3
normal
RESOLVED FIXED
5 years ago
4 years ago

People

(Reporter: emorley, Assigned: emorley)

Tracking

Details

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
The missing file in bug 1063451 would have been noticed sooner, if |grunt build| gave some indication that it was missing - preferably an abort, but even some log output at all would be better than the current situation.

Looking at the grunt docs, there doesn't seem to be a global way to set this, which is pretty crappy.

Instead we have to specify |nonull: true| on each file/resource - which will then cause the job to fail:
https://github.com/gruntjs/grunt-contrib-concat#invalid-or-missing-files-warning
http://gruntjs.com/configuring-tasks#files
https://github.com/gruntjs/grunt-contrib-concat/issues/17
https://github.com/gruntjs/grunt-contrib-concat/issues/15
https://github.com/gruntjs/grunt-contrib-uglify/issues/3

Now there is a workaround for making this global, discussed here:
http://stackoverflow.com/questions/21142515/grunt-files-set-nonull-to-true-by-default

However:
a) It seems a bit hacky, given our Gruntfile.js doesn't specify that many files, so doing per file/resource isn't too excessive.
b) The comments there imply it only works on files-array format whereas we use a mixture, so we'll have to convert them all & are at risk of this breaking in the future if people don't realise.

So I think it's best to just set per-file/resource for now.

Side note: WTF upstream?! Even if you're worried about annoying people by making this abort, they could have at least made it warn in the output by default... *facepalm*
(Assignee)

Updated

5 years ago
Blocks: 1063451
(Assignee)

Comment 1

5 years ago
Created attachment 8484906 [details] [diff] [review]
Abort grunt build if files/directories are missing

There currently is no reliable way to set this globally & by default
missing files are ignored :-( 
See comment 0 for more info.
Attachment #8484906 - Flags: review?(cdawson)
Attachment #8484906 - Flags: review?(cdawson) → review+
(Assignee)

Comment 2

5 years ago
https://github.com/mozilla/treeherder-ui/commit/f3e78f6120ba2a3c8c8bcb83e22348ceba0a3fbd
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED

Comment 3

4 years ago
Commit pushed to master at https://github.com/mozilla/treeherder

https://github.com/mozilla/treeherder/commit/ba12c3f9ff1658c9ae55b567ac5d07990acb2a8a
Bug 1063464 - Abort grunt build if files/directories are missing

There currently is no reliable way to set this globally & by default
missing files are ignored :-(
You need to log in before you can comment on or make changes to this bug.