Skip to content

Commit 1e243c2

Browse files
authored
Add CI for MW 1.39+ (#18)
* Add CI for MW 1.39+ * Bumps minimum MW version to MW 1.39+ * Update Hooks.php * Update .gitignore * Fix * Update phpstan.neon * Update Hooks.php * Fix
1 parent 2f1a3f7 commit 1e243c2

File tree

9 files changed

+126
-91
lines changed

9 files changed

+126
-91
lines changed

Diff for: .github/workflows/ci.yml

+39-29
Original file line numberDiff line numberDiff line change
@@ -2,61 +2,72 @@ name: CI
22

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

1010
jobs:
11-
build:
12-
runs-on: ubuntu-20.04
11+
12+
test:
13+
14+
runs-on: ubuntu-22.04
1315
continue-on-error: ${{ matrix.experimental }}
1416

1517
strategy:
1618
matrix:
1719
include:
18-
- mediawiki_version: 1.35
19-
smw_version: "4.1.1"
20-
php_version: 7.4
20+
- mediawiki_version: '1.39'
21+
smw_version: dev-master
22+
php_version: 8.1
2123
database_type: mysql
22-
database_image: "mysql:5.7"
23-
coverage: true
24+
database_image: "mariadb:10"
25+
coverage: false
2426
experimental: false
25-
- mediawiki_version: 1.35
26-
smw_version: "4.1.1"
27-
php_version: 7.4
28-
database_type: sqlite
27+
- mediawiki_version: '1.39'
28+
smw_version: dev-master
29+
php_version: 8.1
30+
database_type: postgres
31+
database_image: "postgres:14"
2932
coverage: false
3033
experimental: false
31-
- mediawiki_version: 1.39
32-
smw_version: "4.1.1"
34+
- mediawiki_version: '1.40'
35+
smw_version: dev-master
3336
php_version: 8.1
3437
database_type: mysql
35-
database_image: "mysql:8"
38+
database_image: "mariadb:11.2"
39+
coverage: true
40+
experimental: false
41+
- mediawiki_version: '1.41'
42+
smw_version: dev-master
43+
php_version: 8.1
44+
database_type: mysql
45+
database_image: "mariadb:11.2"
3646
coverage: false
3747
experimental: false
38-
- mediawiki_version: 1.39
39-
smw_version: "4.1.1"
48+
- mediawiki_version: '1.42'
49+
smw_version: dev-master
4050
php_version: 8.1
4151
database_type: mysql
42-
database_image: "mariadb:latest"
52+
database_image: "mariadb:11.2"
4353
coverage: false
44-
experimental: true
45-
- mediawiki_version: 1.39
46-
smw_version: "4.1.1"
54+
experimental: false
55+
- mediawiki_version: '1.43'
56+
smw_version: dev-master
4757
php_version: 8.1
48-
database_type: postgres
49-
database_image: "postgres:14"
58+
database_type: mysql
59+
database_image: "mariadb:11.2"
5060
coverage: false
51-
experimental: true
61+
experimental: false
5262

5363
env:
54-
SMW_VERSION: ${{ matrix.smw_version }}
5564
MW_VERSION: ${{ matrix.mediawiki_version }}
65+
SMW_VERSION: ${{ matrix.smw_version }}
5666
PHP_VERSION: ${{ matrix.php_version }}
5767
DB_TYPE: ${{ matrix.database_type }}
5868
DB_IMAGE: ${{ matrix.database_image }}
5969

70+
6071
steps:
6172
- name: Checkout
6273
uses: actions/checkout@v4
@@ -75,9 +86,8 @@ jobs:
7586
if: matrix.coverage == true
7687

7788
- name: Upload code coverage
78-
uses: codecov/codecov-action@v3
79-
env:
80-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
89+
uses: codecov/codecov-action@v4
8190
with:
91+
token: ${{ secrets.CODECOV_TOKEN }}
8292
files: coverage/php/coverage.xml
8393
if: matrix.coverage == true

Diff for: .gitignore

+19-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
1+
!.*
2+
*~
3+
*.kate-swp
4+
.*.swp
5+
16
.idea/
2-
vendor
7+
8+
.envrc
39
.phpunit.result.cache
10+
11+
composer.lock
12+
composer.phar
13+
14+
npm-debug.log
15+
16+
vendor/
17+
extensions/
18+
node_modules/
19+
conf/
20+
.DS_Store
421
.env
5-
coverage
22+
coverage

Diff for: Makefile

+6-7
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ ifeq (,$(wildcard ./build/))
88
$(shell git submodule update --init --remote)
99
endif
1010

11-
EXTENSION := SemanticDependencyUpdater
11+
EXTENSION=SemanticDependencyUpdater
1212

1313
# docker images
14-
MW_VERSION?=1.35
15-
PHP_VERSION?=7.4
16-
DB_TYPE?=sqlite
17-
DB_IMAGE?=""
14+
MW_VERSION?=1.39
15+
PHP_VERSION?=8.1
16+
DB_TYPE?=mysql
17+
DB_IMAGE?="mariadb:10"
1818

1919
# extensions
20-
SMW_VERSION?=4.1.2
20+
SMW_VERSION?=dev-master
2121

2222
# composer
2323
# Enables "composer update" inside of extension
@@ -29,4 +29,3 @@ COMPOSER_EXT?=true
2929

3030
# check for build dir and git submodule init if it does not exist
3131
include build/Makefile
32-

Diff for: composer.json

+17-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
{
2+
"config": {
3+
"process-timeout": 0,
4+
"allow-plugins": {
5+
"composer/installers": true,
6+
"dealerdirect/phpcodesniffer-composer-installer": true
7+
}
8+
},
29
"require-dev": {
3-
"mediawiki/mediawiki-codesniffer": "39.0.0",
4-
"mediawiki/minus-x": "1.1.1",
10+
"mediawiki/mediawiki-codesniffer": "46.0.0",
11+
"mediawiki/minus-x": "1.1.3",
512
"php-parallel-lint/php-console-highlighter": "1.0.0",
6-
"php-parallel-lint/php-parallel-lint": "1.3.2",
7-
"phpstan/phpstan": "^1.7",
13+
"php-parallel-lint/php-parallel-lint": "1.4.0",
14+
"phpstan/phpstan": "^2.0",
815
"vimeo/psalm": "^4.23"
916
},
1017
"scripts": {
@@ -22,14 +29,18 @@
2229
"@phpstan"
2330
],
2431
"lint": "parallel-lint . --exclude vendor --exclude node_modules",
25-
"phpcs": "phpcs -p -s .",
26-
"phpcs-fix": "phpcbf .",
32+
"phpcs": "phpcs -ps -d memory_limit=2G",
33+
"phpcs-fix": "phpcbf -p",
2734
"phpstan": "phpstan analyse --configuration=phpstan.neon --memory-limit=2G",
2835
"phpstan-baseline": "phpstan analyse --configuration=phpstan.neon --memory-limit=2G --generate-baseline",
2936
"psalm": "psalm --config=psalm.xml",
3037
"psalm-baseline": "psalm --config=psalm.xml --set-baseline=psalm-baseline.xml",
3138
"phpunit": "php ../../tests/phpunit/phpunit.php -c phpunit.xml.dist --testdox",
3239
"phpunit-coverage": "php ../../tests/phpunit/phpunit.php -c phpunit.xml.dist --testdox --coverage-text --coverage-html coverage/php --coverage-clover coverage/php/coverage.xml",
40+
"post-test-coverage": [
41+
"sed -i 's|/var/www/html/extensions/SemanticDependencyUpdater/||g' coverage/php/coverage.xml",
42+
"find coverage/php -type f -name '*.html' -exec sed -i 's|/var/www/html/extensions/||g' {} +"
43+
],
3344
"minus-x": "minus-x check .",
3445
"minus-x-fix": "minus-x fix ."
3546
}

Diff for: env.template

-9
This file was deleted.

Diff for: extension.json

+36-32
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,38 @@
11
{
2-
"name": "SemanticDependencyUpdater",
3-
"version": "3.0.3",
4-
"author": [
5-
"Simon Heimler (gesinn.it GmbH & Co. KG)",
6-
"Alexander Gesinn (gesinn.it GmbH & Co. KG)",
7-
"Sebastian Schmid (gesinn.it GmbH & Co. KG)",
8-
"Rcdeboer Remco C. de Boer"
9-
],
10-
"url": "https://www.mediawiki.org/wiki/Extension:SemanticDependencyUpdater",
11-
"description": "Monitors semantic data changes and updates dependent pages",
12-
"license-name": "MIT",
13-
"type": "semantic",
14-
"requires": {
15-
"MediaWiki": ">= 1.35",
16-
"extensions": {
17-
"SemanticMediaWiki": ">= 4.0.0"
18-
}
19-
},
20-
"AutoloadNamespaces": {
21-
"SDU\\": "src/"
22-
},
23-
"Hooks": {
24-
"SMW::SQLStore::AfterDataUpdateComplete": [
25-
"SDU\\Hooks::onAfterDataUpdateComplete"
26-
]
27-
},
28-
"callback": "SDU\\Hooks::setup",
29-
"config": {
30-
"SDUProperty": "Semantic Dependency",
31-
"SDUUseJobQueue": true
32-
},
33-
"manifest_version": 1
2+
"name": "SemanticDependencyUpdater",
3+
"version": "3.0.3",
4+
"author": [
5+
"Simon Heimler (gesinn.it GmbH & Co. KG)",
6+
"Alexander Gesinn (gesinn.it GmbH & Co. KG)",
7+
"Sebastian Schmid (gesinn.it GmbH & Co. KG)",
8+
"Rcdeboer Remco C. de Boer"
9+
],
10+
"url": "https://www.mediawiki.org/wiki/Extension:SemanticDependencyUpdater",
11+
"description": "Monitors semantic data changes and updates dependent pages",
12+
"license-name": "MIT",
13+
"type": "semantic",
14+
"requires": {
15+
"MediaWiki": ">= 1.39",
16+
"extensions": {
17+
"SemanticMediaWiki": ">= 4.2.0"
18+
}
19+
},
20+
"AutoloadNamespaces": {
21+
"SDU\\": "src/"
22+
},
23+
"Hooks": {
24+
"SMW::SQLStore::AfterDataUpdateComplete": [
25+
"SDU\\Hooks::onAfterDataUpdateComplete"
26+
]
27+
},
28+
"callback": "SDU\\Hooks::setup",
29+
"config": {
30+
"SDUProperty": {
31+
"value": "Semantic Dependency"
32+
},
33+
"SDUUseJobQueue": {
34+
"value": true
35+
}
36+
},
37+
"manifest_version": 2
3438
}

Diff for: phpstan.neon

+5-3
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@ parameters:
55
level: 1
66
paths:
77
- .
8+
reportUnmatchedIgnoredErrors: false
89
excludePaths:
9-
- vendor
10-
- node_modules
11-
- coverage
10+
- vendor (?)
11+
- node_modules (?)
12+
- coverage (?)
1213
scanDirectories:
1314
- ../SemanticMediaWiki/includes
1415
- ../SemanticMediaWiki/src
16+
- ../SemanticMediaWiki/Tesa
1517
- ../../includes

Diff for: src/Hooks.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace SDU;
44

55
use DeferredUpdates;
6-
use JobQueueGroup;
6+
use MediaWiki\MediaWikiServices;
77
use SMW\MediaWiki\Jobs\UpdateJob;
88
use SMW\SemanticData;
99
use SMW\Services\ServicesFactory as ApplicationFactory;
@@ -174,9 +174,10 @@ public static function rebuildData( $triggerSemanticDependencies, $wikiPageValue
174174
);
175175
}
176176
if ( $jobs ) {
177-
JobQueueGroup::singleton()->lazyPush( $jobs );
177+
MediaWikiServices::getInstance()->getJobQueueGroup()->lazyPush( $jobs );
178178
}
179179
} else {
180+
/** @phpstan-ignore class.notFound */
180181
DeferredUpdates::addCallableUpdate( static function () use ( $jobFactory, $wikiPageValues ) {
181182
$job = $jobFactory->newUpdateJob(
182183
$wikiPageValues[0]->getTitle(),

0 commit comments

Comments
 (0)