Skip to content

Commit e3cc24f

Browse files
authored
Merge pull request #18 from Wikia/PLATFORM-11180_dpl_upgrade
PLATFORM-11180 dpl upgrade
2 parents 09becf1 + 18fffff commit e3cc24f

23 files changed

+354
-378
lines changed

.github/workflows/codacy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ name: Codacy Security Scan
1515

1616
on:
1717
push:
18-
branches: [ master ]
18+
branches: [ main ]
1919
pull_request:
2020
# The branches below must be a subset of the branches above
21-
branches: [ master ]
21+
branches: [ main ]
2222
schedule:
2323
- cron: '31 7 * * 0'
2424

.github/workflows/mediawiki-tests.yml

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: Quibble and Phan
22

33
on:
44
push:
5-
branches: [ master ]
5+
branches: [ main ]
66
pull_request:
7-
branches: [ master ]
7+
branches: [ main ]
88

99
jobs:
1010
test:
@@ -13,33 +13,47 @@ jobs:
1313
strategy:
1414
matrix:
1515
include:
16-
# Latest stable MediaWiki - PHP 8.1 (phan)
16+
# Latest MediaWiki LTS - PHP 8.1 (phan)
1717
- mw: 'REL1_43'
1818
php: 8.1
1919
php-docker: 81
2020
experimental: false
2121
stage: phan
2222

23+
# Latest stable MediaWiki - PHP 8.1 (phan)
24+
- mw: 'REL1_44'
25+
php: 8.1
26+
php-docker: 81
27+
experimental: true
28+
stage: phan
29+
2330
# Latest MediaWiki master - PHP 8.1 (phan)
2431
- mw: 'master'
2532
php: 8.1
2633
php-docker: 81
2734
experimental: true
2835
stage: phan
2936

30-
# Latest MediaWiki master - PHP 7.4 (coverage)
37+
# Latest MediaWiki master - PHP 8.1 (coverage)
3138
- mw: 'master'
32-
php: 7.4
33-
php-docker: 74
39+
php: 8.1
40+
php-docker: 81
3441
experimental: false
3542
stage: coverage
3643

37-
# Latest stable MediaWiki - PHP 8.1 (phpunit)
44+
# Latest MediaWiki LTS - PHP 8.1 (phpunit)
3845
- mw: 'REL1_43'
3946
php: 8.1
4047
php-docker: 81
4148
experimental: false
4249
stage: phpunit
50+
51+
# Latest stable MediaWiki - PHP 8.1 (phpunit)
52+
- mw: 'REL1_44'
53+
php: 8.1
54+
php-docker: 81
55+
experimental: false
56+
stage: phpunit
4357

4458
# Latest MediaWiki master - PHP 8.1 (phpunit)
4559
- mw: 'master'
@@ -74,8 +88,8 @@ jobs:
7488
env:
7589
DOCKER_REGISTRY: docker-registry.wikimedia.org
7690
DOCKER_ORG: releng
77-
QUIBBLE_DOCKER_IMAGE: quibble-buster-php${{ matrix.php-docker }}
78-
COVERAGE_DOCKER_IMAGE: quibble-buster-php${{ matrix.php-docker }}-coverage
91+
QUIBBLE_DOCKER_IMAGE: quibble-bullseye-php${{ matrix.php-docker }}
92+
COVERAGE_DOCKER_IMAGE: quibble-bullseye-php${{ matrix.php-docker }}-coverage
7993
PHAN_DOCKER_IMAGE: mediawiki-phan-php${{ matrix.php-docker }}
8094
MEDIAWIKI_VERSION: ${{ matrix.mw }}
8195

@@ -121,7 +135,7 @@ jobs:
121135
curl -sL https://raw.githubusercontent.com/wikimedia/integration-config/master/zuul/dependencies.yaml -o dependencies.yaml
122136
curl -sL https://raw.githubusercontent.com/wikimedia/integration-config/master/zuul/phan_dependencies.yaml -o phan_dependencies.yaml
123137
curl -sL https://raw.githubusercontent.com/wikimedia/integration-config/master/zuul/parameter_functions.py -o pf.py
124-
curl -sL https://raw.githubusercontent.com/miraheze/ci-scripts/master/mediawiki/resolve_dependencies.py -o rd.py
138+
curl -sL https://raw.githubusercontent.com/miraheze/ci-scripts/main/mediawiki/resolve_dependencies.py -o rd.py
125139
if [ -e dependencies ]; then
126140
echo "DEPENDENCIES=$(python3 rd.py dependencies)" >> $GITHUB_ENV
127141
fi

.phan/config.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
$cfg = require __DIR__ . '/../vendor/mediawiki/mediawiki-phan-config/src/config.php';
44

5+
$cfg['minimum_target_php_version'] = '8.1';
6+
57
$cfg['directory_list'] = array_merge(
68
$cfg['directory_list'], [
79
'../../extensions/Variables',

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -838,3 +838,22 @@ Many thanks to GreenReaper on GitHub for reporting and finding issues with core
838838
* Replaced the deprecated `ExtVariables::VERSION` with using `ExtensionRegistry` to check if the Variables extension is installed.
839839
* Replaced usages of `intval()` with `(int)` in all remaining places within this extension. This was started in version 3.5.0 and completed in this version.
840840
* Replaced usages of `boolval()` with `(bool)` throughout the entire extension.
841+
842+
# Version 3.6.2
843+
* Fixed Heading's attribute setters (hlistattr, hitemattr may be null).
844+
* Restored partial support for `linkstoexternal` and introduced replacement via `linkstoexternaldomain` and `linkstoexternalpath`.
845+
* Fixed type mismatch between what is returned by `getLinkList` (list of arrays that contained non-serializable TitleValue) and what is expected by ParserOutput.
846+
847+
# Version 3.6.3
848+
* Applied some performance improvements to LST from downstream (which added the new configuration option `$wgDplSettings['recursivePreprocess']`).
849+
* Now shows raw query exception if the request is not made.
850+
* Fixed CI compatibility with PHP 8.1 (which upstream MediaWiki master now requires).
851+
* Added REL1_44 to CI.
852+
* Fixed tests, replacing `ParserOutput::getText` with `ParserOutput::getContentHolderText`.
853+
* Removed `Query::getTableNames` and associated properties, replacing calls with `$this->dbr->tableName`.
854+
* Fixed compatability with upstream backported changes to use raw table names where necessary (by passing the second parameter of `$this->dbr->tableName` as `'raw'` where needed).
855+
856+
# Version 3.6.4
857+
* Fixed a PHP warning in `nottitleregexp` (uninitialised array/key).
858+
* Removed some unused parameters, methods, and variables.
859+
* SECURITY: Fixed leakage of hidden/suppressed usernames ([GHSA-7pgw-q3qp-6pgq](https://github.com/Universal-Omega/DynamicPageList3/security/advisories/GHSA-7pgw-q3qp-6pgq)).

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ These are DPL3's configuration settings and along with their default values. To
3333
| $wgDplSettings['maxCategoryCount'] | 4 | Maximum number of categories to allow in queries. |
3434
| $wgDplSettings['minCategoryCount'] | 0 | Minimum number of categories to allow in queries. |
3535
| $wgDplSettings['maxResultCount'] | 500 | Maximum number of results to return from a query. |
36-
| $wgDplSettings['recursiveTagParse'] | false | Do recursive tag parsing on <dpl> parser tags converting tags and functions such as magic words like {{PAGENAME}}. This is similar to the {{#dpl}} parser function call, but may not work exactly the same in all cases. |
36+
| $wgDplSettings['recursiveTagParse'] | false | Do recursive tag parsing on <dpl> parser tags converting tags and functions such as magic words like {{PAGENAME}}. This is similar to the {{#dpl}} parser function call, but may not work exactly the same in all cases. |
37+
| $wgDplSettings['recursivePreprocess'] | false | Use `Parser::recursivePreprocess()` to improve performance by preserving the internal cache, reducing redundant template parsing. |
3738
| $wgDplSettings['runFromProtectedPagesOnly'] | false | Set this to true to allow DPL3 to run from protected pages only. This is recommend if wiki administrators are having issues with malicious users creating computationally intensive queries. |
3839
| $wgDplSettings['handleSectionTag'] | false | Set this to true to have DPL3 handle <section> tags outside of the parser tags provided by DPL3. |
3940
| $wgDplSettings['maxQueryTime'] | 10000 | Maximum allowed time for database queries in milliseconds. |

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
"composer/installers": ">=1.0.1"
99
},
1010
"require-dev": {
11-
"mediawiki/mediawiki-codesniffer": "46.0.0",
12-
"mediawiki/mediawiki-phan-config": "0.15.1",
11+
"mediawiki/mediawiki-codesniffer": "47.0.0",
12+
"mediawiki/mediawiki-phan-config": "0.16.0",
1313
"mediawiki/minus-x": "1.1.3",
1414
"php-parallel-lint/php-console-highlighter": "1.0.0",
1515
"php-parallel-lint/php-parallel-lint": "1.4.0"

extension.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "DynamicPageList3",
3-
"version": "3.6.1",
3+
"version": "3.6.4",
44
"author": [
55
"'''Universal Omega'''",
66
"Alexia E. Smith",
@@ -58,6 +58,7 @@
5858
"minCategoryCount": 0,
5959
"maxResultCount": 500,
6060
"recursiveTagParse": false,
61+
"recursivePreprocess": false,
6162
"runFromProtectedPagesOnly": false,
6263
"handleSectionTag": false,
6364
"alwaysCacheResults": false,

i18n/de.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"Justman10000",
66
"Magiczocker",
77
"MarkusRost",
8+
"Talex42",
89
"TomatoCake"
910
]
1011
},

includes/Article.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use MediaWiki\Context\RequestContext;
66
use MediaWiki\MediaWikiServices;
7+
use MediaWiki\Revision\RevisionRecord;
78
use MediaWiki\Title\Title;
89
use MediaWiki\User\ActorStore;
910
use stdClass;
@@ -211,8 +212,11 @@ public static function newFromRow(
211212
$article = new self( $title, $pageNamespace );
212213

213214
$revActorName = ActorStore::UNKNOWN_USER_NAME;
214-
if ( isset( $row->rev_actor ) && $row->rev_actor !== '0' ) {
215-
$revActorName = $userFactory->newFromActorId( $row->rev_actor )->getName();
215+
if ( isset( $row->rev_actor ) && (int)$row->rev_actor !== 0 ) {
216+
$revUser = $userFactory->newFromActorId( $row->rev_actor );
217+
$revUserDeleted = $row->rev_deleted & RevisionRecord::DELETED_USER;
218+
$revActorName = $revUser->isHidden() || $revUserDeleted ?
219+
wfMessage( 'rev-deleted-user' )->escaped() : $revUser->getName();
216220
}
217221

218222
$titleText = $title->getText();
@@ -342,9 +346,10 @@ public static function newFromRow(
342346
// CONTRIBUTION, CONTRIBUTOR
343347
if ( $parameters->getParameter( 'addcontribution' ) ) {
344348
$article->mContribution = $row->contribution;
345-
346-
$article->mContributor = $userFactory->newFromActorId( $row->contributor )->getName();
347-
349+
$contribUser = $userFactory->newFromActorId( $row->contributor );
350+
$contribUserDeleted = $row->contrib_deleted & RevisionRecord::DELETED_USER;
351+
$article->mContributor = $contribUser->isHidden() || $contribUserDeleted ?
352+
wfMessage( 'rev-deleted-user' )->escaped() : $contribUser->getName();
348353
$article->mContrib = substr( '*****************', 0, (int)round( log( $row->contribution ) ) );
349354
}
350355

includes/Config.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace MediaWiki\Extension\DynamicPageList3;
44

5-
use ConfigException;
5+
use MediaWiki\Config\ConfigException;
66

77
class Config {
88
/**

0 commit comments

Comments
 (0)