Page MenuHomePhabricator

Jenkins: *-npm jobs broken for mediawiki-core and extensions
Closed, ResolvedPublic

Details

Reference
bz71314

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 3:57 AM
bzimport set Reference to bz71314.

I depooled integration-slave1006.eqiad.wmflabs and a rebuild of the last failed mediawiki-core-npm job succeeded: https://integration.wikimedia.org/ci/job/mediawiki-core-npm/2471/

Timo wrote:

Hi Antoine,

https://integration.wikimedia.org/ci/job/mediawiki-core-npm/

As of build 2463[1], it's broken with some git error (there seems to be
a stray extension directory even though it's against master).
The previous build 2462[2] passed fine.

FYI: This is not related to switching to Ubuntu Trusty, since the jobs
before that were working fine and also on Trusty.

— Timo

[1] https://integration.wikimedia.org/ci/job/mediawiki-core-npm/2463/console
[2] https://integration.wikimedia.org/ci/job/mediawiki-core-npm/2462/console

I noticed it attempt to submodule update and fails on AbuseFilter which
is the first submodule in core wmf branches.

My assumption is that a job previously ran for a wmf branch which has
submodule which were initialized. Then a job against master is created,
the Jenkins git plugin clean the repo but does not uninitialise
submodules though they are not existant, so it bails out.

That is probably a behaviour change in git (Precise has 1.7.9.x while
Trusty has 1.9.1).

I would recommend to revert the npm jobs back to Precise nodes. Will
look at migrating the job from the evil Jenkins git plugin to the Zuul
cloner.

Do NOT upgrade the Jenkins git plugin. It is terribly bugged and would
kill everything (I tried on labs, does not work :-D).

gerritadmin wrote:

Change 163119 had a related patch set uploaded by Hashar:
Migrate mediawiki-core-npm to Zuul cloner

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

Fixed by migrating the job to Zuul cloner which does not fetch submodules.

gerritadmin wrote:

Change 163119 merged by jenkins-bot:
Migrate mediawiki-core-npm to Zuul cloner

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

Seems to be an entirely different issue:

00:00:03.045 [mediawiki-core-npm] $ /bin/bash -xe /tmp/hudson6526668683101242560.sh
00:00:03.051 + cd /mnt/jenkins-workspace/workspace/mediawiki-core-npm/src/tests/frontend
00:00:03.052 + npm --version
00:00:03.346 1.3.10
00:00:03.351 + npm install
00:00:03.850 npm WARN package.json mediawiki@0.0.0 No description
00:00:03.851 npm WARN package.json mediawiki@0.0.0 No repository field.
00:00:03.852 npm WARN package.json mediawiki@0.0.0 No README data
00:00:03.910 + npm test
00:00:04.290
00:00:04.290 > mediawiki@0.0.0 test /mnt/jenkins-workspace/workspace/mediawiki-core-npm/src/tests/frontend
00:00:04.290 > grunt test
00:00:04.291
00:00:04.390
00:00:04.390 module.js:340
00:00:04.390 throw err;
00:00:04.391 ^
00:00:04.392 Error: Cannot find module 'coffee-script'

I have took a snapshot of the workspace on integration-slave1006 in /home/hashar/bug71314/ and the issue is reproduced.

Looking at the dependencies:

$ npm list
mediawiki@0.0.0 /home/hashar/bug71314/src/tests/frontend
├─┬ grunt@0.4.2
│ ├── UNMET DEPENDENCY async ~0.1.22
│ ├── UNMET DEPENDENCY coffee-script ~1.3.3
│ ├── UNMET DEPENDENCY colors ~0.6.2
...

$ ls -1 node_modules/
grunt/
grunt-banana-checker/
grunt-contrib-jshint/
grunt-contrib-watch/
grunt-jscs/
grunt-jsonlint/
$

There are no 'node_modules' subdirectories below.

So somehow npm install does not install the dependencies :-/ Maybe it considers them as already installed because they are in the ~/.npm cache ? I gave it a try by deleting my /home/hashar/.npm and running npm install. That managed to pull all the needed dependencies and npm test is runnable.

I then deleted the node_modules sub directory and ran npm install again. It installed the dependencies properly.

Maybe it is a cache corruption and we should delete the /mnt/home/jenkins-deploy/.npm/ directory?

I've purged the .npm cache. The coffee-scripts dependency seems to have been a result of cache corruption.

https://integration.wikimedia.org/ci/job/mediawiki-core-npm/2489/console

Passing now on integration-slave1006.