Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support MediaWiki 1.39 for actor and templatelinks migration #188

Merged
merged 67 commits into from
Dec 7, 2022

Conversation

Universal-Omega
Copy link
Owner

@Universal-Omega Universal-Omega commented Jun 23, 2022

This adds support for 1.39, and drops support for older versions, since 1.39 is the current LTS release.

@Universal-Omega Universal-Omega changed the title Drop revision_actor_temp support Drop revision_actor_temp and <MediaWiki 1.38.0 support Jun 23, 2022
@Universal-Omega Universal-Omega changed the title Drop revision_actor_temp and <MediaWiki 1.38.0 support Drop revision_actor_temp and < MediaWiki 1.38.0 support Jun 23, 2022
@codecov-commenter
Copy link

codecov-commenter commented Jun 23, 2022

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 36.58537% with 78 lines in your changes missing coverage. Please review.

Project coverage is 8.59%. Comparing base (bd6e23d) to head (25f9eae).
Report is 93 commits behind head on master.

Files with missing lines Patch % Lines
includes/Query.php 54.21% 38 Missing ⚠️
includes/Parse.php 0.00% 16 Missing ⚠️
includes/UpdateArticle.php 0.00% 10 Missing ⚠️
includes/Article.php 0.00% 6 Missing ⚠️
includes/LST.php 0.00% 5 Missing ⚠️
maintenance/createTemplate.php 0.00% 2 Missing ⚠️
includes/Hooks.php 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             master    #188      +/-   ##
===========================================
+ Coverage      5.99%   8.59%   +2.60%     
- Complexity     1565    1568       +3     
===========================================
  Files            23      23              
  Lines          4357    3839     -518     
===========================================
+ Hits            261     330      +69     
+ Misses         4096    3509     -587     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Universal-Omega Universal-Omega changed the title Drop revision_actor_temp and < MediaWiki 1.38.0 support Drop revision_actor_temp and < MediaWiki 1.38.0 support; and support MediaWiki 1.39+ Jun 23, 2022
@Universal-Omega Universal-Omega changed the title Drop revision_actor_temp and < MediaWiki 1.38.0 support; and support MediaWiki 1.39+ Drop revision_actor_temp and < MediaWiki 1.38.0 support; and support MediaWiki 1.39 Jun 23, 2022
@Universal-Omega Universal-Omega marked this pull request as draft June 23, 2022 21:00
@Universal-Omega Universal-Omega force-pushed the revision branch 3 times, most recently from c1f5cbf to 7d4b063 Compare June 28, 2022 17:10
@Universal-Omega Universal-Omega force-pushed the revision branch 2 times, most recently from 9de7eb9 to 382ce35 Compare July 13, 2022 15:18
CHANGELOG.md Fixed Show fixed Hide fixed
CHANGELOG.md Fixed Show fixed Hide fixed
@@ -787,3 +787,9 @@
* Updated CreateTemplate to mention DPL3, not DPL
* Used database update maintenance script for creating VIEW
* Added additional isset check for mTemplatePath

# Version 3.4.7
* Dropped `revision_actor_temp` support and completed actor migration

Check notice

Code scanning

Lists should be surrounded by blank lines

Lists should be surrounded by blank lines

return $this->getFullOutput();
}

// Check if DPL shall only be executed from protected pages.
if ( Config::getSetting( 'runFromProtectedPagesOnly' ) === true && !$parser->getTitle()->isProtected( 'edit' ) ) {
if ( Config::getSetting( 'runFromProtectedPagesOnly' ) === true && !$parser->getPage()->isProtected( 'edit' ) ) {

Check warning

Code scanning / Phpmd (reported by Codacy)

Static access leads to hard to test code

Avoid using static access to class 'MediaWiki\Extension\DynamicPageList3\Config' in method 'parse'.
@@ -405,7 +405,7 @@
}

$title = Title::makeTitle( $pageNamespace, $pageTitle );
$thisTitle = $parser->getTitle();
$thisTitle = Title::castFromPageReference( $parser->getPage() );

Check warning

Code scanning / Phpmd (reported by Codacy)

Static access leads to hard to test code

Avoid using static access to class '\Title' in method 'processQueryResults'.
*/
public function parse( $input, Parser $parser, &$reset, &$eliminate, $isParserTag = false ) {
$dplStartTime = microtime( true );

// Reset headings when being ran more than once in the same page load.
Article::resetHeadings();

$title = Title::castFromPageReference( $parser->getPage() );

Check warning

Code scanning / Phpmd (reported by Codacy)

Static access leads to hard to test code

Avoid using static access to class '\Title' in method 'parse'.

return $this->getFullOutput();
}

// Check if DPL shall only be executed from protected pages.
if ( Config::getSetting( 'runFromProtectedPagesOnly' ) === true && !$parser->getTitle()->isProtected( 'edit' ) ) {
if ( Config::getSetting( 'runFromProtectedPagesOnly' ) === true && !$title->isProtected( 'edit' ) ) {

Check warning

Code scanning / Phpmd (reported by Codacy)

Static access leads to hard to test code

Avoid using static access to class 'MediaWiki\Extension\DynamicPageList3\Config' in method 'parse'.
@@ -124,7 +120,8 @@
return $text;
}
} else {
return "[[" . $parser->getTitle()->getPrefixedText() . "]]" . "<!-- WARNING: LST loop detected -->";
$title = Title::castFromPageReference( $parser->getPage() );

Check warning

Code scanning / Phpmd (reported by Codacy)

Static access leads to hard to test code

Avoid using static access to class '\Title' in method 'parse'.
// Check if DPL shall only be executed from protected pages.
if ( Config::getSetting( 'runFromProtectedPagesOnly' ) === true && !$parser->getTitle()->isProtected( 'edit' ) ) {
if ( Config::getSetting( 'runFromProtectedPagesOnly' ) === true && $title && !$restrictionStore->isProtected( $title, 'edit' ) ) {

Check warning

Code scanning / Phpmd (reported by Codacy)

Static access leads to hard to test code

Avoid using static access to class 'MediaWiki\Extension\DynamicPageList3\Config' in method 'parse'.
includes/Query.php Outdated Show resolved Hide resolved
Universal-Omega and others added 2 commits December 6, 2022 16:16
@Universal-Omega Universal-Omega marked this pull request as ready for review December 6, 2022 23:16
@@ -787,3 +787,19 @@
* Updated CreateTemplate to mention DPL3, not DPL
* Used database update maintenance script for creating VIEW
* Added additional isset check for mTemplatePath

# Version 3.5.0

Check warning

Code scanning / Markdownlint (reported by Codacy)

Multiple top-level headings in the same document

Multiple top-level headings in the same document
@@ -787,3 +787,19 @@
* Updated CreateTemplate to mention DPL3, not DPL
* Used database update maintenance script for creating VIEW
* Added additional isset check for mTemplatePath

# Version 3.5.0

Check warning

Code scanning / Markdownlint (reported by Codacy)

Expected: 1; Actual: 0; Below

Expected: 1; Actual: 0; Below
* Replaced usage of deprecated `Title::isProtected()`
* Replaced usage of deprecated `User::matchEditToken()`
* Replaced usage of deprecated `Article::doDelete()`
* Added `null` checks on `Parser::getPage()` and `ParserOutput` before using to avoid fatals

Check warning

Code scanning / Markdownlint (reported by Codacy)

Expected: 80; Actual: 92

Expected: 80; Actual: 92
@Universal-Omega Universal-Omega merged commit 8dd8d03 into master Dec 7, 2022
@Universal-Omega Universal-Omega deleted the revision branch December 7, 2022 00:10
@Universal-Omega Universal-Omega restored the revision branch December 7, 2022 00:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants