mediawiki/services/recommendation-api (main)

sourcepatches
$ date
Wed Jun 16 12:15:05 UTC 2021

$ git clone file:///srv/git/mediawiki-services-recommendation-api.git repo --depth=1 -b master
Cloning into 'repo'...

$ git config user.name libraryupgrader

$ git config user.email tools.libraryupgrader@tools.wmflabs.org

$ git submodule update --init

$ grr init
Installed commit-msg hook.

$ git show-ref refs/heads/master
1111a8dc1c6e843144cc2048c3a48cd023ee3e3b refs/heads/master

Attempting to npm audit fix
$ npm audit fix --only=dev

> core-js@3.10.1 postinstall /src/repo/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: 
> https://opencollective.com/core-js 
> https://www.patreon.com/zloirock 

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)

added 395 packages from 1082 contributors in 8.874s

46 packages are looking for funding
  run `npm fund` for details

fixed 0 of 5 vulnerabilities in 664 scanned packages

$ npm audit fix --only=dev
npm WARN ajv-keywords@2.1.1 requires a peer of ajv@^5.0.0 but none is installed. You must install peer dependencies yourself.

up to date in 2.804s

46 packages are looking for funding
  run `npm fund` for details

fixed 0 of 5 vulnerabilities in 664 scanned packages

$ npm audit fix --only=dev
npm WARN ajv-keywords@2.1.1 requires a peer of ajv@^5.0.0 but none is installed. You must install peer dependencies yourself.

up to date in 2.631s

46 packages are looking for funding
  run `npm fund` for details

fixed 0 of 5 vulnerabilities in 664 scanned packages

$ package-lock-lint package-lock.json
0 issues found in: package-lock.json

Verifying that tests still pass
$ npm ci
npm WARN prepare removing existing node_modules/ before installation

> dtrace-provider@0.8.8 install /src/repo/node_modules/dtrace-provider
> node-gyp rebuild || node suppress-error.js

make: Entering directory '/src/repo/node_modules/dtrace-provider/build'
  TOUCH Release/obj.target/DTraceProviderStub.stamp
make: Leaving directory '/src/repo/node_modules/dtrace-provider/build'

> unix-dgram@2.0.4 install /src/repo/node_modules/unix-dgram
> node-gyp rebuild

make: Entering directory '/src/repo/node_modules/unix-dgram/build'
  CXX(target) Release/obj.target/unix_dgram/src/unix_dgram.o
In file included from ../../nan/nan.h:56,
                 from ../src/unix_dgram.cc:5:
/cache/node-gyp/10.24.0/include/node/node.h:573:43: warning: cast between incompatible function types from ‘void (*)(v8::Local<v8::Object>)’ to ‘node::addon_register_func’ {aka ‘void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)’} [-Wcast-function-type]
       (node::addon_register_func) (regfunc),                          \
                                           ^
/cache/node-gyp/10.24.0/include/node/node.h:607:3: note: in expansion of macro ‘NODE_MODULE_X’
   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
   ^~~~~~~~~~~~~
../src/unix_dgram.cc:404:1: note: in expansion of macro ‘NODE_MODULE’
 NODE_MODULE(unix_dgram, Initialize)
 ^~~~~~~~~~~
In file included from /cache/node-gyp/10.24.0/include/node/node.h:63,
                 from ../../nan/nan.h:56,
                 from ../src/unix_dgram.cc:5:
/cache/node-gyp/10.24.0/include/node/v8.h: In instantiation of ‘void v8::PersistentBase<T>::SetWeak(P*, typename v8::WeakCallbackInfo<P>::Callback, v8::WeakCallbackType) [with P = node::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo<P>::Callback = void (*)(const v8::WeakCallbackInfo<node::ObjectWrap>&)]’:
/cache/node-gyp/10.24.0/include/node/node_object_wrap.h:84:78:   required from here
/cache/node-gyp/10.24.0/include/node/v8.h:9502:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfo<node::ObjectWrap>::Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<node::ObjectWrap>&)’} to ‘Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<void>&)’} [-Wcast-function-type]
                reinterpret_cast<Callback>(callback), type);
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/cache/node-gyp/10.24.0/include/node/v8.h: In instantiation of ‘void v8::PersistentBase<T>::SetWeak(P*, typename v8::WeakCallbackInfo<P>::Callback, v8::WeakCallbackType) [with P = Nan::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo<P>::Callback = void (*)(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)]’:
../../nan/nan_object_wrap.h:65:61:   required from here
/cache/node-gyp/10.24.0/include/node/v8.h:9502:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfo<Nan::ObjectWrap>::Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)’} to ‘Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<void>&)’} [-Wcast-function-type]
  SOLINK_MODULE(target) Release/obj.target/unix_dgram.node
  COPY Release/unix_dgram.node
make: Leaving directory '/src/repo/node_modules/unix-dgram/build'

> heapdump@0.3.15 install /src/repo/node_modules/heapdump
> node-gyp rebuild

make: Entering directory '/src/repo/node_modules/heapdump/build'
  CXX(target) Release/obj.target/addon/src/heapdump.o
In file included from ../src/heapdump.cc:15:
/cache/node-gyp/10.24.0/include/node/node.h:573:43: warning: cast between incompatible function types from ‘void (*)(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)’ {aka ‘void (*)(v8::Local<v8::Object>)’} to ‘node::addon_register_func’ {aka ‘void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)’} [-Wcast-function-type]
       (node::addon_register_func) (regfunc),                          \
                                           ^
/cache/node-gyp/10.24.0/include/node/node.h:607:3: note: in expansion of macro ‘NODE_MODULE_X’
   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
   ^~~~~~~~~~~~~
../src/heapdump.cc:136:1: note: in expansion of macro ‘NODE_MODULE’
 NODE_MODULE(addon, Initialize)
 ^~~~~~~~~~~
In file included from /cache/node-gyp/10.24.0/include/node/node.h:63,
                 from ../src/heapdump.cc:15:
/cache/node-gyp/10.24.0/include/node/v8.h: In instantiation of ‘void v8::PersistentBase<T>::SetWeak(P*, typename v8::WeakCallbackInfo<P>::Callback, v8::WeakCallbackType) [with P = node::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo<P>::Callback = void (*)(const v8::WeakCallbackInfo<node::ObjectWrap>&)]’:
/cache/node-gyp/10.24.0/include/node/node_object_wrap.h:84:78:   required from here
/cache/node-gyp/10.24.0/include/node/v8.h:9502:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfo<node::ObjectWrap>::Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<node::ObjectWrap>&)’} to ‘Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<void>&)’} [-Wcast-function-type]
                reinterpret_cast<Callback>(callback), type);
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/cache/node-gyp/10.24.0/include/node/v8.h: In instantiation of ‘void v8::PersistentBase<T>::SetWeak(P*, typename v8::WeakCallbackInfo<P>::Callback, v8::WeakCallbackType) [with P = Nan::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo<P>::Callback = void (*)(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)]’:
../../nan/nan_object_wrap.h:65:61:   required from here
/cache/node-gyp/10.24.0/include/node/v8.h:9502:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfo<Nan::ObjectWrap>::Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)’} to ‘Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<void>&)’} [-Wcast-function-type]
  SOLINK_MODULE(target) Release/obj.target/addon.node
  COPY Release/addon.node
make: Leaving directory '/src/repo/node_modules/heapdump/build'

> gc-stats@1.4.0 install /src/repo/node_modules/gc-stats
> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using request for node-pre-gyp https download 
[gc-stats] Success: "/src/repo/node_modules/gc-stats/build/gcstats/v1.4.0/Release/node-v64-linux-x64/gcstats.node" is installed via remote

> core-js@3.10.1 postinstall /src/repo/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"

added 596 packages in 16.825s

$ npm test

> recommendation-api@0.6.0 test /src/repo
> PREQ_CONNECT_TIMEOUT=15 mocha && npm run lint



starting test server
  express app
    ✓ should get robots.txt (45ms)
    ✓ should set CORS headers
    ✓ should set CSP headers
    ✓ should get static content gzipped
    ✓ should get static content uncompressed

  Swagger spec
    ✓ get the spec
    ✓ spec validation
    routes
      ✓ robots.txt check
      ✓ root with no query params
      ✓ spec from root
      ✓ doc from root
      ✓ root with wrong query param
      ✓ article.creation.translation - normal source and target with seed (977ms)
      ✓ article.creation.translation - bad seed (100ms)
      ✓ article.creation.translation - invalid count
      ✓ article.creation.translation - incorrectly formatted source
      ✓ article.creation.morelike - bad article title (57ms)
      ✓ article.creation.morelike - missing models (116ms)
      ✓ Caption addition suggestions (744ms)
      ✓ Caption translation suggestions (898ms)
      ✓ Description addition suggestions (558ms)
      ✓ Description translation suggestions (616ms)

  article.creation.morelike
    ✓ should return recommendations for good article title (1016ms)

  Get missing articles
    ✓ correctly filters out existing articles

  lib:caption
    convertGlobalUsagePageIdsToInts
      ✓ converts page ID string to int
    consolidateImageData
      ✓ consolidates entity data to expected items
      ✓ handles undefined entities object
    filterPages
      ✓ filters non-image MIME types
      ✓ handles undefined pages object
    makeResult
      ✓ result is structured as expected
    makeResults
      ✓ makes results as expected

  lib:description
    wikiLangToDBName
      ✓ appends "wiki"
      ✓ converts hyphens to underscores
      ✓ converts be-tarask to be_x_oldwiki
    buildResponse
      ✓ gracefully handles undefined inputs
      ✓ gracefully handles empty inputs

  lib:suggested-edits-common
    checkRequestDomain
      ✓ allows allowed domains
      ✓ disallows disallowed domains
      ✓ handles undefined
    getWikiLangForLangCode
      ✓ translates language variants to base wiki language codes
      ✓ passed through other inputs
      ✓ handles undefined

stopping test server

  42 passing (5s)


> recommendation-api@0.6.0 lint /src/repo
> eslint --ext .js .


/src/repo/app.js
   20:0  warning  The type 'bluebird' is undefined     jsdoc/no-undefined-types
  147:0  warning  The type 'Application' is undefined  jsdoc/no-undefined-types
  149:0  warning  The type 'bluebird' is undefined     jsdoc/no-undefined-types
  200:0  warning  The type 'Application' is undefined  jsdoc/no-undefined-types
  201:0  warning  The type 'bluebird' is undefined     jsdoc/no-undefined-types
  239:0  warning  The type 'bluebird' is undefined     jsdoc/no-undefined-types

/src/repo/lib/api-util.js
   82:0  warning  The type 'Application' is undefined  jsdoc/no-undefined-types
  129:0  warning  The type 'Application' is undefined  jsdoc/no-undefined-types

/src/repo/lib/article.creation.morelike.js
  1:11  warning  'setTimeout' is already defined as a built-in global variable  no-redeclare

/src/repo/lib/article.creation.translation.js
  129:12  warning  'candidates' is already declared in the upper scope  no-shadow

/src/repo/lib/util.js
   40:0  warning  The type 'Request' is undefined      jsdoc/no-undefined-types
  109:0  warning  The type 'Application' is undefined  jsdoc/no-undefined-types
  149:0  warning  The type 'Request' is undefined      jsdoc/no-undefined-types
  150:0  warning  The type 'bool' is undefined         jsdoc/no-undefined-types
  160:0  warning  The type 'Application' is undefined  jsdoc/no-undefined-types
  255:0  warning  The type 'Router' is undefined       jsdoc/no-undefined-types
  275:0  warning  The type 'Application' is undefined  jsdoc/no-undefined-types

/src/repo/routes/article.creation.morelike.js
  75:32  warning  'ids' is already declared in the upper scope  no-shadow

/src/repo/test/features/app/app.js
   1:11  warning  'describe' is already defined as a built-in global variable                 no-redeclare
   1:21  warning  'it' is already defined as a built-in global variable                       no-redeclare
   1:25  warning  'before' is already defined as a built-in global variable                   no-redeclare
   1:33  warning  'after' is already defined as a built-in global variable                    no-redeclare
  54:13  warning  Unused eslint-disable directive (no problems were reported from 'max-len')

/src/repo/test/features/app/spec.js
  1:11  warning  'describe' is already defined as a built-in global variable  no-redeclare
  1:21  warning  'it' is already defined as a built-in global variable        no-redeclare
  1:25  warning  'before' is already defined as a built-in global variable    no-redeclare
  1:33  warning  'after' is already defined as a built-in global variable     no-redeclare

/src/repo/test/utils/assert.js
  1:1  warning  Unused eslint-disable directive (no problems were reported from 'no-console')

/src/repo/test/utils/logStream.js
   1:1   warning  Unused eslint-disable directive (no problems were reported from 'no-console')
  43:13  warning  'end' is already declared in the upper scope                                         no-shadow
  51:18  warning  'get' is already declared in the upper scope                                         no-shadow
  56:9   warning  Unused eslint-disable directive (no problems were reported from 'object-shorthand')

✖ 32 problems (0 errors, 32 warnings)


$ package-lock-lint package-lock.json
0 issues found in: package-lock.json

$ git add .

$ git commit -F /tmp/tmpb9ocgf6a
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean

npm dependencies

Dependencies
Development dependencies

Logs

Source code is licensed under the AGPL.