Unverified Commit 079e52d7 authored by Jeremy Morrell's avatar Jeremy Morrell Committed by GitHub

Add more detection for known error types (#534)

parent b576b2c6
...@@ -273,45 +273,139 @@ log_other_failures() { ...@@ -273,45 +273,139 @@ log_other_failures() {
local log_file="$1" local log_file="$1"
if grep -qi "sh: 1: .*: not found" "$log_file"; then if grep -qi "sh: 1: .*: not found" "$log_file"; then
mcount "failures.dev-dependency-tool-not-installed" mcount "failures.dev-dependency-tool-not-installed"
return 0
fi fi
if grep -qi "Failed at the bcrypt@\d.\d.\d install script" "$log_file"; then if grep -qi "Failed at the bcrypt@\d.\d.\d install script" "$log_file"; then
mcount "failures.bcrypt-permissions-issue" mcount "failures.bcrypt-permissions-issue"
return 0
fi fi
if grep -qi "Versions of @angular/compiler-cli and typescript could not be determined" "$log_file"; then if grep -qi "Versions of @angular/compiler-cli and typescript could not be determined" "$log_file"; then
mcount "failures.ng-cli-version-issue" mcount "failures.ng-cli-version-issue"
return 0
fi fi
if grep -qi "Cannot read property '0' of undefined" "$log_file"; then if grep -qi "Cannot read property '0' of undefined" "$log_file"; then
mcount "failures.npm-property-zero-issue" mcount "failures.npm-property-zero-issue"
return 0
fi fi
if grep -qi "npm is known not to run on Node.js v\d.\d.\d" "$log_file"; then if grep -qi "npm is known not to run on Node.js v\d.\d.\d" "$log_file"; then
mcount "failures.npm-known-bad-version" mcount "failures.npm-known-bad-version"
return 0
fi fi
# "notarget No matching version found for" = npm # "notarget No matching version found for" = npm
# "error Couldn't find any versions for" = yarn # "error Couldn't find any versions for" = yarn
if grep -q -e "notarget No matching version found for" -e "error Couldn't find any versions for" "$log_file"; then if grep -q -e "notarget No matching version found for" -e "error Couldn't find any versions for" "$log_file"; then
mcount "failures.bad-version-for-dependency" mcount "failures.bad-version-for-dependency"
fi return 0
if grep -qi "Module not found: Error: Can't resolve" "$log_file"; then
mcount "failures.webpack-module-not-found"
fi fi
if grep -qi "You are likely using a version of node-tar or npm that is incompatible with this version of Node.js" "$log_file"; then if grep -qi "You are likely using a version of node-tar or npm that is incompatible with this version of Node.js" "$log_file"; then
mcount "failures.node-9-npm-issue" mcount "failures.node-9-npm-issue"
return 0
fi fi
if grep -qi "console.error(\`a bug known to break npm" "$log_file"; then if grep -qi "console.error(\`a bug known to break npm" "$log_file"; then
mcount "failures.old-node-new-npm" mcount "failures.old-node-new-npm"
return 0
fi
if grep -qi "CALL_AND_RETRY_LAST Allocation failed" "$log_file"; then
mcount "failures.build-out-of-memory-error"
return 0
fi
if grep -qi "enoent ENOENT: no such file or directory" "$log_file"; then
mcount "failures.npm-enoent"
return 0
fi
if grep -qi "ERROR in [^ ]* from UglifyJs" "$log_file"; then
mcount "failures.uglifyjs"
return 0
fi
# https://github.com/angular/angular-cli/issues/4551
if grep -qi "Module not found: Error: Can't resolve '\.\/\$\$_gendir\/app\/app\.module\.ngfactory'" "$log_file"; then
mcount "failures.ng-cli-issue-4551"
return 0
fi
if grep -qi "Host key verification failed" "$log_file"; then
mcount "failures.private-git-dependency-without-auth"
return 0
fi
# same as the next test, but isolate bcyrpt specifically
if grep -qi "Failed at the bcrypt@\d\.\d\.\d install" "$log_file"; then
mcount "failures.bcrypt-failed-to-build"
return 0
fi
if grep -qi "Failed at the [^ ]* install script" "$log_file"; then
mcount "failures.dependency-failed-to-build"
return 0
fi
if grep -qi "Line \d*: '.*' is not defined" "$log_file"; then
mcount "failures.undefined-variable-lint"
return 0
fi
if grep -qi "npm ERR! code EBADPLATFORM" "$log_file"; then
mcount "failures.npm-ebadplatform"
return 0
fi
if grep -qi "npm ERR! code EINVALIDPACKAGENAME" "$log_file"; then
mcount "failures.npm-package-name-typo"
return 0
fi
if grep -qi "sh: 1: cd: can't cd to" "$log_file"; then
mcount "failures.cd-command-fail"
return 0
fi
# Webpack Errors
if grep -qi "Module not found: Error: Can't resolve" "$log_file"; then
mcount "failures.webpack.module-not-found"
return 0
fi fi
if grep -qi "sass-loader/lib/loader.js:3:14" "$log_file"; then if grep -qi "sass-loader/lib/loader.js:3:14" "$log_file"; then
mcount "failures.webpack-sass-loader-error" mcount "failures.webpack.sass-loader-error"
return 0
fi fi
# Typescript errors
if grep -qi "Property '.*' does not exist on type '.*'" "$log_file"; then
mcount "failures.typescript.missing-property"
return 0
fi
if grep -qi "Property '.*' is private and only accessible within class '.*'" "$log_file"; then
mcount "failures.typescript.private-property"
return 0
fi
if grep -qi "error TS2307: Cannot find module '.*'" "$log_file"; then
mcount "failures.typescript.missing-module"
return 0
fi
if grep -qi "error TS2688: Cannot find type definition file for '.*'" "$log_file"; then
mcount "failures.typescript.missing-type-definition"
return 0
fi
# If we've made it this far it's not an error we've added detection for yet
mcount "failures.unknown"
} }
warning() { warning() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment