mediawiki/extensions/Thanks (master)

sourcepatches
From 24338224cb50e488d8af5dec58b84363b847ff3d Mon Sep 17 00:00:00 2001
From: libraryupgrader <tools.libraryupgrader@tools.wmflabs.org>
Date: Thu, 6 May 2021 23:03:49 +0000
Subject: [PATCH] build: Updating dependencies
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

composer:
* mediawiki/mediawiki-codesniffer: 35.0.0 → 36.0.0
* php-parallel-lint/php-parallel-lint: 1.2.0 → 1.3.0

npm:
* lodash: 4.17.19 → 4.17.21
  * https://npmjs.com/advisories/1673 (CVE-2021-23337)

Change-Id: I96595519d503a0a21cded7d3227d036991ac3aae
---
 composer.json                                 |  4 ++--
 includes/ApiThank.php                         |  2 +-
 package-lock.json                             | 18 +++++++++---------
 tests/phpunit/ApiFlowThankIntegrationTest.php |  2 +-
 4 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/composer.json b/composer.json
index d63d8f2..fdd2f14 100644
--- a/composer.json
+++ b/composer.json
@@ -1,10 +1,10 @@
 {
 	"require-dev": {
-		"mediawiki/mediawiki-codesniffer": "35.0.0",
+		"mediawiki/mediawiki-codesniffer": "36.0.0",
 		"mediawiki/mediawiki-phan-config": "0.10.6",
 		"mediawiki/minus-x": "1.1.1",
 		"php-parallel-lint/php-console-highlighter": "0.5.0",
-		"php-parallel-lint/php-parallel-lint": "1.2.0"
+		"php-parallel-lint/php-parallel-lint": "1.3.0"
 	},
 	"scripts": {
 		"test": [
diff --git a/includes/ApiThank.php b/includes/ApiThank.php
index f7ddeb1..8f82925 100644
--- a/includes/ApiThank.php
+++ b/includes/ApiThank.php
@@ -82,7 +82,7 @@ abstract class ApiThank extends ApiBase {
 	 * @return bool Whether thanks has already been sent
 	 */
 	protected function haveAlreadyThanked( User $thanker, $uniqueId ) {
-		$dbw = wfGetDB( DB_MASTER );
+		$dbw = wfGetDB( DB_PRIMARY );
 		$thankerActor = MediaWikiServices::getInstance()->getActorNormalization()
 			->acquireActorId( $thanker, $dbw );
 		return (bool)$dbw->selectRow(
diff --git a/package-lock.json b/package-lock.json
index c9e210c..339fc45 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1607,9 +1607,9 @@
 					}
 				},
 				"lodash": {
-					"version": "4.17.19",
-					"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz",
-					"integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==",
+					"version": "4.17.21",
+					"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
+					"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
 					"dev": true
 				}
 			}
@@ -1668,9 +1668,9 @@
 			},
 			"dependencies": {
 				"lodash": {
-					"version": "4.17.20",
-					"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz",
-					"integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==",
+					"version": "4.17.21",
+					"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
+					"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
 					"dev": true
 				},
 				"which": {
@@ -2080,9 +2080,9 @@
 			}
 		},
 		"lodash": {
-			"version": "4.17.19",
-			"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz",
-			"integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==",
+			"version": "4.17.21",
+			"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
+			"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
 			"dev": true
 		},
 		"lodash.memoize": {
diff --git a/tests/phpunit/ApiFlowThankIntegrationTest.php b/tests/phpunit/ApiFlowThankIntegrationTest.php
index 3655813..b663390 100644
--- a/tests/phpunit/ApiFlowThankIntegrationTest.php
+++ b/tests/phpunit/ApiFlowThankIntegrationTest.php
@@ -68,7 +68,7 @@ class ApiFlowThankIntegrationTest extends ApiTestCase {
 		$mockLoader->expects( $this->any() )
 			->method( 'getWithRoot' )
 			->willReturnCallback(
-				function ( $postId ) use ( $that ) {
+				static function ( $postId ) use ( $that ) {
 					switch ( $postId ) {
 						case $that->postByOtherUser->getPostId():
 							return [
-- 
2.20.1

$ date
Thu May  6 23:02:30 UTC 2021

$ git clone file:///srv/git/mediawiki-extensions-Thanks.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
b65ce9d5cc54a532b3013fd12ef3374b1fe3d648 refs/heads/master

$ composer install
Loading composer repositories with package information
Warning from https://repo.packagist.org: You are using an outdated version of Composer. Composer 2 is now available and you should upgrade. See https://getcomposer.org/2
Updating dependencies (including require-dev)
Package operations: 31 installs, 0 updates, 0 removals
  - Installing squizlabs/php_codesniffer (3.5.8): Loading from cache
  - Installing composer/spdx-licenses (1.5.5): Loading from cache
  - Installing composer/semver (3.2.4): Loading from cache
  - Installing mediawiki/mediawiki-codesniffer (v35.0.0): Loading from cache
  - Installing symfony/polyfill-php80 (v1.22.1): Loading from cache
  - Installing symfony/polyfill-mbstring (v1.22.1): Loading from cache
  - Installing symfony/polyfill-intl-normalizer (v1.22.1): Loading from cache
  - Installing symfony/polyfill-intl-grapheme (v1.22.1): Loading from cache
  - Installing symfony/polyfill-ctype (v1.22.1): Loading from cache
  - Installing symfony/string (v5.2.6): Loading from cache
  - Installing psr/container (1.1.1): Loading from cache
  - Installing symfony/service-contracts (v2.4.0): Loading from cache
  - Installing symfony/polyfill-php73 (v1.22.1): Loading from cache
  - Installing symfony/console (v5.2.7): Loading from cache
  - Installing psr/log (1.1.4): Loading from cache
  - Installing sabre/event (5.1.2): Loading from cache
  - Installing netresearch/jsonmapper (v2.1.0): Loading from cache
  - Installing microsoft/tolerant-php-parser (v0.0.23): Loading from cache
  - Installing phpdocumentor/reflection-common (2.2.0): Loading from cache
  - Installing webmozart/assert (1.10.0): Loading from cache
  - Installing phpdocumentor/type-resolver (1.4.0): Loading from cache
  - Installing phpdocumentor/reflection-docblock (5.2.2): Loading from cache
  - Installing felixfbecker/advanced-json-rpc (v3.2.0): Loading from cache
  - Installing composer/xdebug-handler (1.4.6): Loading from cache
  - Installing phan/phan (3.2.6): Loading from cache
  - Installing mediawiki/phan-taint-check-plugin (3.2.1): Loading from cache
  - Installing mediawiki/mediawiki-phan-config (0.10.6): Loading from cache
  - Installing mediawiki/minus-x (1.1.1): Loading from cache
  - Installing php-parallel-lint/php-console-color (v0.3): Loading from cache
  - Installing php-parallel-lint/php-console-highlighter (v0.5): Loading from cache
  - Installing php-parallel-lint/php-parallel-lint (v1.2.0): Loading from cache
symfony/service-contracts suggests installing symfony/service-implementation
symfony/console suggests installing symfony/event-dispatcher
symfony/console suggests installing symfony/lock
symfony/console suggests installing symfony/process
phan/phan suggests installing ext-ast (Needed for parsing ASTs (unless --use-fallback-parser is used). 1.0.1+ is needed, 1.0.8+ is recommended.)
Writing lock file
Generating autoload files
12 packages you are using are looking for funding.
Use the `composer fund` command to find out more!

Upgrading c:mediawiki/mediawiki-codesniffer from 35.0.0 -> 36.0.0
Upgrading c:php-parallel-lint/php-parallel-lint from 1.2.0 -> 1.3.0
$ composer update
Loading composer repositories with package information
Warning from https://repo.packagist.org: You are using an outdated version of Composer. Composer 2 is now available and you should upgrade. See https://getcomposer.org/2
Updating dependencies (including require-dev)
Package operations: 0 installs, 3 updates, 0 removals
  - Updating squizlabs/php_codesniffer (3.5.8 => 3.6.0): Loading from cache
  - Updating mediawiki/mediawiki-codesniffer (v35.0.0 => v36.0.0): Loading from cache
  - Updating php-parallel-lint/php-parallel-lint (v1.2.0 => v1.3.0): Loading from cache
Writing lock file
Generating autoload files
12 packages you are using are looking for funding.
Use the `composer fund` command to find out more!

{'MediaWiki.Commenting.FunctionComment.MissingDocumentationPrivate', 'MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic', 'MediaWiki.Commenting.FunctionComment.MissingDocumentationProtected', 'MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment'}
Tests fail!
$ vendor/bin/phpcbf

PHPCBF RESULT SUMMARY
----------------------------------------------------------------------
FILE                                                  FIXED  REMAINING
----------------------------------------------------------------------
...epo/tests/phpunit/ApiFlowThankIntegrationTest.php  1      0
/src/repo/includes/ApiThank.php                       1      3
----------------------------------------------------------------------
A TOTAL OF 2 ERRORS WERE FIXED IN 2 FILES
----------------------------------------------------------------------

Time: 388ms; Memory: 12MB



$ git checkout .phpcs.xml

$ composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Generating autoload files
12 packages you are using are looking for funding.
Use the `composer fund` command to find out more!

$ composer test
> parallel-lint . --exclude vendor --exclude node_modules
PHP 7.3.27 | 10 parallel jobs
.............                                                13/13 (100 %)


Checked 13 files in 0.1 seconds
No syntax error found
> phpcs -p -s
............. 13 / 13 (100%)


Time: 297ms; Memory: 12MB

> minus-x check .
MinusX
======
Processing /src/repo...
.............................................................
.............................................................
.............................................................
.............................................................
.............................................................
............................................................
All good!

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 365 packages from 263 contributors in 13.13s

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

fixed 8 of 8 vulnerabilities in 365 scanned packages

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

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

added 365 packages in 7.956s

$ npm test

> @ test /src/repo
> grunt test

Running "eslint:all" (eslint) task

/src/repo/modules/jquery.findWithParent.js
  51:33  warning  'selector' is already declared in the upper scope on line 46 column 35  no-shadow

✖ 1 problem (0 errors, 1 warning)


Running "banana:Thanks" (banana) task
>> 2 message directories checked.

Done.

Upgrading n:lodash from 4.17.19 -> 4.17.21
$ git add .

$ git commit -F /tmp/tmps3pou0qd
[master 2433822] build: Updating dependencies
 4 files changed, 13 insertions(+), 13 deletions(-)

$ git format-patch HEAD~1 --stdout
From 24338224cb50e488d8af5dec58b84363b847ff3d Mon Sep 17 00:00:00 2001
From: libraryupgrader <tools.libraryupgrader@tools.wmflabs.org>
Date: Thu, 6 May 2021 23:03:49 +0000
Subject: [PATCH] build: Updating dependencies
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

composer:
* mediawiki/mediawiki-codesniffer: 35.0.0 → 36.0.0
* php-parallel-lint/php-parallel-lint: 1.2.0 → 1.3.0

npm:
* lodash: 4.17.19 → 4.17.21
  * https://npmjs.com/advisories/1673 (CVE-2021-23337)

Change-Id: I96595519d503a0a21cded7d3227d036991ac3aae
---
 composer.json                                 |  4 ++--
 includes/ApiThank.php                         |  2 +-
 package-lock.json                             | 18 +++++++++---------
 tests/phpunit/ApiFlowThankIntegrationTest.php |  2 +-
 4 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/composer.json b/composer.json
index d63d8f2..fdd2f14 100644
--- a/composer.json
+++ b/composer.json
@@ -1,10 +1,10 @@
 {
 	"require-dev": {
-		"mediawiki/mediawiki-codesniffer": "35.0.0",
+		"mediawiki/mediawiki-codesniffer": "36.0.0",
 		"mediawiki/mediawiki-phan-config": "0.10.6",
 		"mediawiki/minus-x": "1.1.1",
 		"php-parallel-lint/php-console-highlighter": "0.5.0",
-		"php-parallel-lint/php-parallel-lint": "1.2.0"
+		"php-parallel-lint/php-parallel-lint": "1.3.0"
 	},
 	"scripts": {
 		"test": [
diff --git a/includes/ApiThank.php b/includes/ApiThank.php
index f7ddeb1..8f82925 100644
--- a/includes/ApiThank.php
+++ b/includes/ApiThank.php
@@ -82,7 +82,7 @@ abstract class ApiThank extends ApiBase {
 	 * @return bool Whether thanks has already been sent
 	 */
 	protected function haveAlreadyThanked( User $thanker, $uniqueId ) {
-		$dbw = wfGetDB( DB_MASTER );
+		$dbw = wfGetDB( DB_PRIMARY );
 		$thankerActor = MediaWikiServices::getInstance()->getActorNormalization()
 			->acquireActorId( $thanker, $dbw );
 		return (bool)$dbw->selectRow(
diff --git a/package-lock.json b/package-lock.json
index c9e210c..339fc45 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1607,9 +1607,9 @@
 					}
 				},
 				"lodash": {
-					"version": "4.17.19",
-					"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz",
-					"integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==",
+					"version": "4.17.21",
+					"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
+					"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
 					"dev": true
 				}
 			}
@@ -1668,9 +1668,9 @@
 			},
 			"dependencies": {
 				"lodash": {
-					"version": "4.17.20",
-					"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz",
-					"integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==",
+					"version": "4.17.21",
+					"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
+					"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
 					"dev": true
 				},
 				"which": {
@@ -2080,9 +2080,9 @@
 			}
 		},
 		"lodash": {
-			"version": "4.17.19",
-			"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz",
-			"integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==",
+			"version": "4.17.21",
+			"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
+			"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
 			"dev": true
 		},
 		"lodash.memoize": {
diff --git a/tests/phpunit/ApiFlowThankIntegrationTest.php b/tests/phpunit/ApiFlowThankIntegrationTest.php
index 3655813..b663390 100644
--- a/tests/phpunit/ApiFlowThankIntegrationTest.php
+++ b/tests/phpunit/ApiFlowThankIntegrationTest.php
@@ -68,7 +68,7 @@ class ApiFlowThankIntegrationTest extends ApiTestCase {
 		$mockLoader->expects( $this->any() )
 			->method( 'getWithRoot' )
 			->willReturnCallback(
-				function ( $postId ) use ( $that ) {
+				static function ( $postId ) use ( $that ) {
 					switch ( $postId ) {
 						case $that->postByOtherUser->getPostId():
 							return [
-- 
2.20.1

composer dependencies

Development dependencies

npm dependencies

Development dependencies

Logs

Source code is licensed under the AGPL.