Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
H
heroku-buildpack-nodejs
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Python-Dev
heroku-buildpack-nodejs
Commits
56c249bf
Unverified
Commit
56c249bf
authored
Jan 25, 2018
by
Jeremy Morrell
Committed by
GitHub
Jan 25, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add metrics for more types of failures (#509)
Add metrics for more types of failures
parent
6c52af1e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
2 deletions
+50
-2
compile
bin/compile
+1
-0
failure.sh
lib/failure.sh
+48
-1
run
test/run
+1
-1
No files found.
bin/compile
View file @
56c249bf
...
...
@@ -49,6 +49,7 @@ handle_failure() {
fail_node_install
"
$LOG_FILE
"
fail_yarn_install
"
$LOG_FILE
"
fail_invalid_semver
"
$LOG_FILE
"
log_other_failures
"
$LOG_FILE
"
warn_untracked_dependencies
"
$LOG_FILE
"
warn_angular_resolution
"
$LOG_FILE
"
warn_missing_devdeps
"
$LOG_FILE
"
...
...
lib/failure.sh
View file @
56c249bf
...
...
@@ -37,6 +37,7 @@ fail_invalid_package_json() {
fail_dot_heroku
()
{
if
[
-f
"
${
1
:-}
/.heroku"
]
;
then
mcount
"failures.dot-heroku"
header
"Build failed"
warn
"The directory .heroku could not be created
...
...
@@ -51,6 +52,7 @@ fail_dot_heroku() {
fail_dot_heroku_node
()
{
if
[
-f
"
${
1
:-}
/.heroku/node"
]
;
then
mcount
"failures.dot-heroku-node"
header
"Build failed"
warn
"The directory .heroku/node could not be created
...
...
@@ -118,7 +120,7 @@ fail_multiple_lockfiles() {
fail_yarn_lockfile_outdated
()
{
local
log_file
=
"
$1
"
if
grep
-qi
'
error
Your lockfile needs to be updated'
"
$log_file
"
;
then
if
grep
-qi
'Your lockfile needs to be updated'
"
$log_file
"
;
then
mcount
"failures.outdated-yarn-lockfile"
echo
""
warn
"Outdated Yarn lockfile
...
...
@@ -245,6 +247,51 @@ fail_invalid_semver() {
fi
}
log_other_failures
()
{
local
log_file
=
"
$1
"
if
grep
-qi
"sh: 1: .*: not found"
"
$log_file
"
;
then
mcount
"failures.dev-dependency-tool-not-installed"
fi
if
grep
-qi
"Failed at the bcrypt@
\d
.
\d
.
\d
install script"
"
$log_file
"
;
then
mcount
"failures.bcrypt-permissions-issue"
fi
if
grep
-qi
"Versions of @angular/compiler-cli and typescript could not be determined"
"
$log_file
"
;
then
mcount
"failures.ng-cli-version-issue"
fi
if
grep
-qi
"Cannot read property '0' of undefined"
"
$log_file
"
;
then
mcount
"failures.npm-property-zero-issue"
fi
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"
fi
# "notarget No matching version found for" = npm
# "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
mcount
"failures.bad-version-for-dependency"
fi
if
grep
-qi
"Module not found: Error: Can't resolve"
"
$log_file
"
;
then
mcount
"failures.webpack-module-not-found"
fi
if
greq
-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"
fi
if
grep
-qi
"console.error(
\`
a bug known to break npm"
"
$log_file
"
;
then
mcount
"failures.old-node-new-npm"
fi
if
grep
-qi
"sass-loader/lib/loader.js:3:14"
"
$log_file
"
;
then
mcount
"failures.webpack-sass-loader-error"
fi
}
warning
()
{
local
tip
=
${
1
:-}
local
url
=
${
2
:-
https
://devcenter.heroku.com/articles/nodejs-support
}
...
...
test/run
View file @
56c249bf
...
...
@@ -181,7 +181,7 @@ testErrorYarnAndNpmShrinkwrap() {
testYarnLockfileOutOfDate
()
{
compile
"yarn-lockfile-out-of-date"
assertCaptured
"
error
Your lockfile needs to be updated"
assertCaptured
"Your lockfile needs to be updated"
assertCaptured
"Outdated Yarn lockfile"
assertCaptured
"https://kb.heroku.com/why-is-my-node-js-build-failing-because-of-an-outdated-yarn-lockfile"
assertCapturedError
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment