Page MenuHomePhabricator

MobileFrontend npm-run-lint-modules occassionally fails with message "Failed to walk"
Closed, ResolvedPublic

Description

https://gerrit.wikimedia.org/r/#/c/399910/
https://integration.wikimedia.org/ci/job/mwext-MobileFrontend-npm-run-lint-modules/1354/console

00:34:44 Error: Failed to walk resources/mediawiki.template.hogan/hogan.js
00:34:44 st.slice is not a function
00:34:44     at walk (/home/jenkins/workspace/mwext-MobileFrontend-npm-run-lint-modules/src/extensions/MobileFrontend/node_modules/resource-modules/dist/analyze.js:42:15)
00:34:44     at /home/jenkins/workspace/mwext-MobileFrontend-npm-run-lint-modules/src/extensions/MobileFrontend/node_modules/resource-modules/dist/analyze.js:12:33
00:34:44     at Array.forEach (native)
00:34:44     at /home/jenkins/workspace/mwext-MobileFrontend-npm-run-lint-modules/src/extensions/MobileFrontend/node_modules/resource-modules/dist/analyze.js:11:28

(Also https://gerrit.wikimedia.org/r/#/c/407477/ has a similar but slightly different CI error.)

Event Timeline

Jdlrobson added subscribers: Jhernandez, Jdlrobson.

@Jhernandez any idea why this is happening. Should it be walking hogan.js?

(I also can't easily replicate this so marking as low)

Jdlrobson renamed this task from MobileFrontend tests are broken to MobileFrontend npm-run-lint-modules occassionally fails with message "Failed to walk".Feb 6 2018, 12:31 AM
Jdlrobson raised the priority of this task from Low to Medium.Feb 14 2018, 11:51 PM

I'm not sure why this is happening. It should walk hogan as it is defined in the scripts field on extension.json, but for some reason the walking is failing.

I'm going to update the deps in case it is a parsing issue with acorn, although the file looks fine.

It may be one of the visitors failing, but since I shadowed the error I can't know. So I'm also going to include the stack trace of the original error, and make it a non-fatal error so that the linting continues for now.

I'll reply back here when I've made the new release and keep an eye on the logs of the jobs for a week or two to see if I see the error message again and can diagnose better what is up.

Change 411312 had a related patch set uploaded (by Jhernandez; owner: Jhernandez):
[mediawiki/extensions/MobileFrontend@master] Chore: Update resource-modules dependency to 1.0.18

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

I'll keep an eye on:

And come back in a week or so to see if I have more logs to look at.

I see there have been other files that have failed in the past so it doesn't seem related to hogan.js specifically. Example:

Error: Failed to walk resources/mobile.categories.overlays/CategoryAddOverlay.js

Change 411312 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@master] Chore: Update resource-modules dependency to 1.0.18

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

Checked the logs for the job runs from the 16th to the 22nd, didn't see any exceptions logged for now.

https://integration.wikimedia.org/ci/job/mwext-MobileFrontend-npm-run-lint-modules/buildTimeTrend

Will report back in another week.

I'm going to resolve this. I'm happy we have better debugging in place. Should help us if encountered it again (in which case let's reopen).

I've manually checked the logs of the last 20 successful jobs and didn't see any unexpected warning logs so I think this is fixed.