Page MenuHomePhabricator

libup should not assume Gruntfile.js exists everywhere
Closed, ResolvedPublic

Description

the LangConv lib does not have grunt installed, so there is no Gruntfile.js

Look for grunt in devDependencies inside package.json?

https://libraryupgrader2.wmflabs.org/r/mediawiki/libs/LangConv

Traceback (most recent call last):
  File "/src/libup/ng.py", line 939, in main
    libup.run(args.repo, args.output)
  File "/src/libup/ng.py", line 897, in run
    self.npm_upgrade(self.output)
  File "/src/libup/ng.py", line 644, in npm_upgrade
    hooks[update.name](update)
  File "/src/libup/ng.py", line 695, in _handle_eslint
    gf = grunt.Gruntfile()
  File "/src/libup/grunt.py", line 34, in __init__
    with open(self.fname) as f:
FileNotFoundError: [Errno 2] No such file or directory: 'Gruntfile.js'

Event Timeline

MobileFrontend would have the same error, but fails at other location for the moment - https://libraryupgrader2.wmflabs.org/r/mediawiki/extensions/MobileFrontend

After I built the assets, I noticed differences in the contents to what you committed.
Try running `npm run build` again or removing the node_modules folder and running npm install with the correct node version.
npm ERR! Test failed.  See above for more details.

Traceback (most recent call last):
  File "/src/libup/ng.py", line 939, in main
    libup.run(args.repo, args.output)
  File "/src/libup/ng.py", line 889, in run
    self.npm_audit_fix(self.output['npm-audit'])
  File "/src/libup/ng.py", line 179, in npm_audit_fix
    self.check_call(['npm', 'test'])
  File "/src/libup/shell.py", line 38, in check_call
    res.check_returncode()
  File "/usr/lib/python3.7/subprocess.py", line 428, in check_returncode
    self.stderr)
subprocess.CalledProcessError: Command '['npm', 'test']' returned non-zero exit status 1.

Change 569300 had a related patch set uploaded (by Umherirrender; owner: Umherirrender):
[labs/libraryupgrader@master] Do not assume Gruntfile.js exists everywhere

https://gerrit.wikimedia.org/r/569300

Change 569300 merged by jenkins-bot:
[labs/libraryupgrader@master] Do not assume Gruntfile.js exists everywhere

https://gerrit.wikimedia.org/r/569300