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

Bump MW requirements to MW 1.39+ #250

Merged
merged 4 commits into from
Dec 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 7 additions & 17 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,7 @@ jobs:

strategy:
matrix:
include:
- mediawiki_version: '1.35'
smw_version: '4.2.0'
approved_revs_version: 1.8.2
php_version: 7.4
database_type: mysql
database_image: "mysql:5.7"
coverage: true
experimental: false
- mediawiki_version: '1.35'
smw_version: '4.2.0'
approved_revs_version: 1.8.2
php_version: 7.4
database_type: sqlite
coverage: false
experimental: false
include:
- mediawiki_version: '1.39'
smw_version: '4.2.0'
approved_revs_version: 2.1
Expand All @@ -56,7 +41,7 @@ jobs:
coverage: false
experimental: false
- mediawiki_version: '1.42'
smw_version: '4.2.0'
smw_version: dev-master
approved_revs_version: master
php_version: 8.2
database_type: mysql
Expand All @@ -75,6 +60,11 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive

- name: Update submodules
run: git submodule update --init --remote

- name: Run tests
run: make ci
Expand Down
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ export
# setup for docker-compose-ci build directory
# delete "build" directory to update docker-compose-ci

ifeq (,$(wildcard ./build/Makefile))
ifeq (,$(wildcard ./build/))
$(shell git submodule update --init --remote)
endif

EXTENSION=SemanticExtraSpecialProperties

# docker images
MW_VERSION?=1.35
PHP_VERSION?=7.4
DB_TYPE?=sqlite
DB_IMAGE?=""
MW_VERSION?=1.39
PHP_VERSION?=8.1
DB_TYPE?=mysql
DB_IMAGE?="mariadb:10"

# extensions
SMW_VERSION=4.2.0
SMW_VERSION?=4.2.0

# composer
# Enables "composer update" inside of extension
Expand All @@ -28,4 +28,4 @@ COMPOSER_EXT?=true
# NODE_JS?=true

# check for build dir and git submodule init if it does not exist
include build/Makefile
include build/Makefile
2 changes: 1 addition & 1 deletion extension.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"license-name": "GPL-2.0-or-later",
"type": "semantic",
"requires": {
"MediaWiki": ">= 1.35",
"MediaWiki": ">= 1.39",
"extensions": {
"SemanticMediaWiki": "*"
}
Expand Down
7 changes: 1 addition & 6 deletions src/AppFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,8 @@ public function newWikiPage( Title $title ) {
);
}

// Pre 1.36
$services = MediaWikiServices::getInstance();
if ( !method_exists( $services, 'getWikiPageFactory' ) ) {
return WikiPage::factory( $title );
} else {
return $services->getWikiPageFactory()->newFromTitle( $title );
}
return $services->getWikiPageFactory()->newFromTitle( $title );
}

/**
Expand Down
23 changes: 4 additions & 19 deletions src/PropertyAnnotators/UserEditCountPerNsPropertyAnnotator.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,25 +117,10 @@ private function getEditsPerNs( $id, $ip ): array {
$db = $this->appFactory->getConnection();
$queryTables = [ 'revision', 'actor', 'page' ];

if ( version_compare( MW_VERSION, '1.39', '>=' ) ) {
$joinConditions = [
'page' => [ 'INNER JOIN', [ 'page_id=rev_page' ] ],
'actor' => [ 'INNER JOIN', [ 'actor_id=rev_actor' ] ]
];
} else {
$queryTables[] = 'revision_actor_temp';
$joinConditions = [
'page' => [ 'INNER JOIN', [
'page_id=rev_page'
] ],
'revision_actor_temp' => [ 'INNER JOIN', [
'revactor_rev=rev_id'
] ],
'actor' => [ 'INNER JOIN', [
'actor_id=revactor_actor'
] ]
];
}
$joinConditions = [
'page' => [ 'INNER JOIN', [ 'page_id=rev_page' ] ],
'actor' => [ 'INNER JOIN', [ 'actor_id=rev_actor' ] ]
];

$result = $db->select(
// FROM.
Expand Down