From 457c531b54124054c59b59d2a78ce1df47ed7f57 Mon Sep 17 00:00:00 2001 From: alistair3149 Date: Thu, 4 Jun 2026 13:03:54 -0400 Subject: [PATCH 1/4] Support Semantic MediaWiki 7.0 Require Semantic MediaWiki 7.0 and raise the extension to 7.0.0-alpha; the major version now tracks the supported SMW major (skipping 5.x and 6.x). Migrate Semantic MediaWiki's deprecated data-item class aliases to their canonical 7.0 namespaces (SMW\DataItems\{Property,WikiPage,Blob,Uri} and SMW\DataModel\SemanticData) in both production code and test mocks. Refresh CI to a per-row MariaDB LTS spread (10.11/11.4/11.8/12.3) across MediaWiki 1.43-1.45 and PHP 8.1-8.4, bump actions/checkout and codecov-action to v6, and make coverage status informational so it never gates CI. Remove dead legacy CI: .scrutinizer.yml, tests/travis, and the orphaned phpmd.xml. --- .github/workflows/main.yml | 16 ++-- .scrutinizer.yml | 23 ------ Makefile | 2 +- RELEASE-NOTES.md | 9 +++ codecov.yml | 14 +++- composer.json | 4 +- extension.json | 2 +- phpmd.xml | 29 ------- src/LazySemanticDataLookup.php | 2 +- src/PropertyValuesContentAggregator.php | 19 ++--- ...taTagsContentGenerationIntegrationTest.php | 6 +- .../Unit/LazySemanticDataLookupTest.php | 8 +- .../PropertyValuesContentAggregatorTest.php | 62 +++++++-------- tests/travis/install-mediawiki.sh | 43 ----------- tests/travis/install-semantic-meta-tags.sh | 77 ------------------- tests/travis/run-tests.sh | 14 ---- tests/travis/upload-coverage-report.sh | 10 --- 17 files changed, 83 insertions(+), 257 deletions(-) delete mode 100644 .scrutinizer.yml delete mode 100644 phpmd.xml delete mode 100644 tests/travis/install-mediawiki.sh delete mode 100644 tests/travis/install-semantic-meta-tags.sh delete mode 100644 tests/travis/run-tests.sh delete mode 100644 tests/travis/upload-coverage-report.sh diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9074cb4..3e00d67 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,28 +21,28 @@ jobs: smw_version: dev-master php_version: 8.1 database_type: mysql - database_image: "mariadb:10" + database_image: "mariadb:10.11" coverage: true experimental: false - mediawiki_version: '1.43' smw_version: dev-master - php_version: 8.1 + php_version: 8.2 database_type: mysql - database_image: "mariadb:10" + database_image: "mariadb:11.4" coverage: false experimental: false - mediawiki_version: '1.44' smw_version: dev-master - php_version: 8.2 + php_version: 8.3 database_type: mysql database_image: "mariadb:11.8" coverage: false experimental: false - mediawiki_version: '1.45' smw_version: dev-master - php_version: 8.3 + php_version: 8.4 database_type: mysql - database_image: "mariadb:11.8" + database_image: "mariadb:12.3" coverage: false experimental: false @@ -55,7 +55,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: submodules: recursive @@ -71,7 +71,7 @@ jobs: if: matrix.coverage == true - name: Upload code coverage - uses: codecov/codecov-action@v4 + uses: codecov/codecov-action@v6 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage/php/coverage.xml diff --git a/.scrutinizer.yml b/.scrutinizer.yml deleted file mode 100644 index 2aa77c5..0000000 --- a/.scrutinizer.yml +++ /dev/null @@ -1,23 +0,0 @@ -filter: - excluded_paths: - - 'vendor/*' - -tools: - php_mess_detector: - config: - controversial_rules: { superglobals: false } - php_cpd: true - php_pdepend: true - php_code_coverage: false - php_code_sniffer: true - php_cs_fixer: true - php_loc: true - php_analyzer: true - sensiolabs_security_checker: true - external_code_coverage: - timeout: '900' - -checks: - php: - code_rating: true - duplication: true \ No newline at end of file diff --git a/Makefile b/Makefile index 6f53adf..270690d 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ EXTENSION=SemanticMetaTags MW_VERSION?=1.43 PHP_VERSION?=8.3 DB_TYPE?=mysql -DB_IMAGE?="mariadb:11.2" +DB_IMAGE?="mariadb:11.8" # extensions SMW_VERSION?=dev-master diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index da0feb2..41e5358 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -1,5 +1,14 @@ This file contains the RELEASE-NOTES of the **Semantic Meta Tags** (a.k.a. SMT) extension. +### 7.0.0-alpha + +* Added support for Semantic MediaWiki 7.0 +* Raised the minimum requirement for + * Semantic MediaWiki to version 7.0 and later + * MediaWiki to version 1.43 and later +* Updated to Semantic MediaWiki 7.0's namespaced data-item classes +* The major version jumps from 4.x to 7.0 to track the Semantic MediaWiki release it supports + ### 4.1.1 Released on November 28, 2025. diff --git a/codecov.yml b/codecov.yml index 60c7338..4d86289 100644 --- a/codecov.yml +++ b/codecov.yml @@ -1,2 +1,12 @@ -fixes: - - "/var/www/html/extensions/SemanticMetaTags/::" \ No newline at end of file +coverage: + status: + project: + default: + informational: true + patch: + default: + informational: true + removed_code_behavior: adjust_base + +fixes: + - "/var/www/html/extensions/SemanticMetaTags/::" diff --git a/composer.json b/composer.json index 06f5628..f78a186 100644 --- a/composer.json +++ b/composer.json @@ -50,7 +50,7 @@ }, "extra": { "branch-alias": { - "dev-master": "4.x-dev" + "dev-master": "7.0.0-dev" } }, "config": { @@ -75,6 +75,8 @@ "@minus-x" ], "phpunit": "php ${MW_INSTALL_PATH:-../..}/tests/phpunit/phpunit.php -c phpunit.xml.dist", + "unit": "php ${MW_INSTALL_PATH:-../..}/tests/phpunit/phpunit.php -c phpunit.xml.dist --testsuite semantic-meta-tags-unit", + "integration": "php ${MW_INSTALL_PATH:-../..}/tests/phpunit/phpunit.php -c phpunit.xml.dist --testsuite semantic-meta-tags-integration", "phpunit-coverage": "php ${MW_INSTALL_PATH:-../..}/tests/phpunit/phpunit.php -c phpunit.xml.dist --testdox --coverage-text --coverage-html coverage/php --coverage-clover coverage/php/coverage.xml", "post-test-coverage": [ "sed -i 's|/var/www/html/extensions/SemanticMetaTags/||g' coverage/php/coverage.xml", diff --git a/extension.json b/extension.json index bc0088b..a6d3fcc 100644 --- a/extension.json +++ b/extension.json @@ -1,6 +1,6 @@ { "name": "SemanticMetaTags", - "version": "4.1.1", + "version": "7.0.0-alpha", "author": [ "James Hong Kong" ], diff --git a/phpmd.xml b/phpmd.xml deleted file mode 100644 index 1bc93f2..0000000 --- a/phpmd.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/LazySemanticDataLookup.php b/src/LazySemanticDataLookup.php index 59b4222..ac4212c 100644 --- a/src/LazySemanticDataLookup.php +++ b/src/LazySemanticDataLookup.php @@ -2,9 +2,9 @@ namespace SMT; +use SMW\DataModel\SemanticData; use SMW\ParserData; use SMW\RequestOptions; -use SMW\SemanticData; use SMW\Store; /** diff --git a/src/PropertyValuesContentAggregator.php b/src/PropertyValuesContentAggregator.php index 61ae03a..58d99d1 100644 --- a/src/PropertyValuesContentAggregator.php +++ b/src/PropertyValuesContentAggregator.php @@ -2,10 +2,11 @@ namespace SMT; -use SMW\DIProperty; -use SMW\DIWikiPage; -use SMWDIBlob as DIBlob; -use SMWDIUri as DIUri; +use MediaWiki\Output\OutputPage; +use SMW\DataItems\Blob; +use SMW\DataItems\Property; +use SMW\DataItems\Uri; +use SMW\DataItems\WikiPage; /** * @license GPL-2.0-or-later @@ -21,7 +22,7 @@ class PropertyValuesContentAggregator { private $lazySemanticDataLookup; /** - * @var \OutputPage + * @var OutputPage */ private $mOutputPage; @@ -40,7 +41,7 @@ class PropertyValuesContentAggregator { * @param LazySemanticDataLookup $lazySemanticDataLookup * @param OutputPage $outputPage */ - public function __construct( LazySemanticDataLookup $lazySemanticDataLookup, \OutputPage $outputPage ) { + public function __construct( LazySemanticDataLookup $lazySemanticDataLookup, OutputPage $outputPage ) { $this->lazySemanticDataLookup = $lazySemanticDataLookup; $this->mOutputPage = $outputPage; } @@ -92,7 +93,7 @@ private function fetchContentForProperty( $property, array &$values ) { } } else { // This is a real property. - $property = DIProperty::newFromUserLabel( $property ); + $property = Property::newFromUserLabel( $property ); $semanticData = $this->lazySemanticDataLookup->getSemanticData(); $this->iterateToCollectPropertyValues( @@ -114,9 +115,9 @@ private function iterateToCollectPropertyValues( array $propertyValues, &$values // Content escaping (htmlspecialchars) is being carried out // by the instance that adds the content - if ( $value instanceof DIBlob ) { + if ( $value instanceof Blob ) { $values[$value->getHash()] = $value->getString(); - } elseif ( $value instanceof DIWikiPage || $value instanceof DIUri ) { + } elseif ( $value instanceof WikiPage || $value instanceof Uri ) { $values[$value->getHash()] = $value->getSortKey(); } } diff --git a/tests/phpunit/Integration/MetaTagsContentGenerationIntegrationTest.php b/tests/phpunit/Integration/MetaTagsContentGenerationIntegrationTest.php index 677e4be..2fc7500 100644 --- a/tests/phpunit/Integration/MetaTagsContentGenerationIntegrationTest.php +++ b/tests/phpunit/Integration/MetaTagsContentGenerationIntegrationTest.php @@ -4,7 +4,7 @@ use SMT\HookRegistry; use SMT\Options; -use SMW\DIWikiPage; +use SMW\DataItems\WikiPage; use SMW\Tests\SMWIntegrationTestCase; use SMW\Tests\Utils\UtilityFactory; @@ -78,7 +78,7 @@ public function testAddStandardMetaTag() { $this->markTestSkipped( 'OutputPage::getMetaTags does not exist for this MW version' ); } - $subject = new DIWikiPage( __METHOD__, NS_MAIN ); + $subject = new WikiPage( __METHOD__, NS_MAIN ); $requestContext->setTitle( $subject->getTitle() ); $this->pageCreator @@ -118,7 +118,7 @@ public function testAddOpenGraphMetaTag() { $this->markTestSkipped( 'OutputPage::addParserOutputMetadata does not exist for this MW version' ); } - $subject = new DIWikiPage( __METHOD__, NS_MAIN ); + $subject = new WikiPage( __METHOD__, NS_MAIN ); $requestContext->setTitle( $subject->getTitle() ); $this->pageCreator diff --git a/tests/phpunit/Unit/LazySemanticDataLookupTest.php b/tests/phpunit/Unit/LazySemanticDataLookupTest.php index 8da2eb5..b4efc29 100644 --- a/tests/phpunit/Unit/LazySemanticDataLookupTest.php +++ b/tests/phpunit/Unit/LazySemanticDataLookupTest.php @@ -3,7 +3,7 @@ namespace SMT\Tests; use SMT\LazySemanticDataLookup; -use SMW\DIWikiPage; +use SMW\DataItems\WikiPage; /** * @covers \SMT\LazySemanticDataLookup @@ -32,7 +32,7 @@ public function testCanConstruct() { } public function testGetSemanticDataFromParserOutput() { - $semanticData = $this->getMockBuilder( '\SMW\SemanticData' ) + $semanticData = $this->getMockBuilder( '\SMW\DataModel\SemanticData' ) ->disableOriginalConstructor() ->getMock(); @@ -63,7 +63,7 @@ public function testGetSemanticDataFromParserOutput() { } public function testGetSemanticDataFromStore() { - $semanticData = $this->getMockBuilder( '\SMW\SemanticData' ) + $semanticData = $this->getMockBuilder( '\SMW\DataModel\SemanticData' ) ->disableOriginalConstructor() ->getMock(); @@ -72,7 +72,7 @@ public function testGetSemanticDataFromStore() { $semanticData->expects( $this->once() ) ->method( 'getSubject' ) - ->willReturn( new DIWikiPage( 'Foo', NS_MAIN ) ); + ->willReturn( new WikiPage( 'Foo', NS_MAIN ) ); $parserData = $this->getMockBuilder( '\SMW\ParserData' ) ->disableOriginalConstructor() diff --git a/tests/phpunit/Unit/PropertyValuesContentAggregatorTest.php b/tests/phpunit/Unit/PropertyValuesContentAggregatorTest.php index 549a3e8..ab6df7d 100644 --- a/tests/phpunit/Unit/PropertyValuesContentAggregatorTest.php +++ b/tests/phpunit/Unit/PropertyValuesContentAggregatorTest.php @@ -3,10 +3,10 @@ namespace SMT\Tests; use SMT\PropertyValuesContentAggregator; -use SMW\DIProperty; -use SMW\DIWikiPage; -use SMWDIBlob as DIBlob; -use SMWDIUri as DIUri; +use SMW\DataItems\Blob; +use SMW\DataItems\Property; +use SMW\DataItems\Uri; +use SMW\DataItems\WikiPage; /** * @covers \SMT\PropertyValuesContentAggregator @@ -37,7 +37,7 @@ public function testCanConstruct() { public function testFindContentForProperty() { $properties = [ 'foobar' ]; - $semanticData = $this->getMockBuilder( '\SMW\SemanticData' ) + $semanticData = $this->getMockBuilder( '\SMW\DataModel\SemanticData' ) ->disableOriginalConstructor() ->getMock(); @@ -47,8 +47,8 @@ public function testFindContentForProperty() { $semanticData->expects( $this->once() ) ->method( 'getPropertyValues' ) - ->with( DIProperty::newFromUserLabel( 'foobar' ) ) - ->willReturn( [ new DIWikiPage( 'Foo', NS_MAIN ) ] ); + ->with( Property::newFromUserLabel( 'foobar' ) ) + ->willReturn( [ new WikiPage( 'Foo', NS_MAIN ) ] ); $lazySemanticDataLookup = $this->getMockBuilder( '\SMT\LazySemanticDataLookup' ) ->disableOriginalConstructor() @@ -73,7 +73,7 @@ public function testFindContentForProperty() { public function testAggregatePropertyValueContentWithSameHash() { $properties = [ 'foobar' ]; - $semanticData = $this->getMockBuilder( '\SMW\SemanticData' ) + $semanticData = $this->getMockBuilder( '\SMW\DataModel\SemanticData' ) ->disableOriginalConstructor() ->getMock(); @@ -83,12 +83,12 @@ public function testAggregatePropertyValueContentWithSameHash() { $semanticData->expects( $this->once() ) ->method( 'getPropertyValues' ) - ->with( DIProperty::newFromUserLabel( 'foobar' ) ) + ->with( Property::newFromUserLabel( 'foobar' ) ) ->willReturn( [ - DIUri::doUnserialize( 'http://username@example.org/foo' ), - DIUri::doUnserialize( 'http://username@example.org/foo' ), - new DIWikiPage( 'Foo', NS_MAIN ), - new DIWikiPage( 'Foo', NS_MAIN ) ] ); + Uri::doUnserialize( 'http://username@example.org/foo' ), + Uri::doUnserialize( 'http://username@example.org/foo' ), + new WikiPage( 'Foo', NS_MAIN ), + new WikiPage( 'Foo', NS_MAIN ) ] ); $lazySemanticDataLookup = $this->getMockBuilder( '\SMT\LazySemanticDataLookup' ) ->disableOriginalConstructor() @@ -113,16 +113,16 @@ public function testAggregatePropertyValueContentWithSameHash() { public function testFindContentForSubobjectProperty() { $properties = [ 'bar' ]; - $subSemanticData = $this->getMockBuilder( '\SMW\SemanticData' ) + $subSemanticData = $this->getMockBuilder( '\SMW\DataModel\SemanticData' ) ->disableOriginalConstructor() ->getMock(); $subSemanticData->expects( $this->once() ) ->method( 'getPropertyValues' ) - ->with( DIProperty::newFromUserLabel( 'bar' ) ) - ->willReturn( [ new DIBlob( 'Foo-with-html-"<>"-escaping-to-happen-somewhere-else' ) ] ); + ->with( Property::newFromUserLabel( 'bar' ) ) + ->willReturn( [ new Blob( 'Foo-with-html-"<>"-escaping-to-happen-somewhere-else' ) ] ); - $semanticData = $this->getMockBuilder( '\SMW\SemanticData' ) + $semanticData = $this->getMockBuilder( '\SMW\DataModel\SemanticData' ) ->disableOriginalConstructor() ->getMock(); @@ -159,24 +159,24 @@ public function testFindContentForMultiplePropertiesToUseFullContentAggregation( $propertyValues = [ 0 => [ - DIUri::doUnserialize( 'http://username@example.org/foo' ), - new DIWikiPage( '"Foo"', NS_MAIN ) + Uri::doUnserialize( 'http://username@example.org/foo' ), + new WikiPage( '"Foo"', NS_MAIN ) ], 2 => [ - new DIBlob( 'Mo' ), - new DIBlob( 'Mo' ), - new DIBlob( 'fo' ) + new Blob( 'Mo' ), + new Blob( 'Mo' ), + new Blob( 'fo' ) ] ]; - $semanticData = $this->getMockBuilder( '\SMW\SemanticData' ) + $semanticData = $this->getMockBuilder( '\SMW\DataModel\SemanticData' ) ->disableOriginalConstructor() ->getMock(); $semanticData->method( 'getPropertyValues' ) ->withConsecutive( - [ DIProperty::newFromUserLabel( 'foo' ) ], - [ DIProperty::newFromUserLabel( 'bar' ) ] + [ Property::newFromUserLabel( 'foo' ) ], + [ Property::newFromUserLabel( 'bar' ) ] ) ->willReturnOnConsecutiveCalls( $propertyValues[0], @@ -200,22 +200,22 @@ public function testFindContentForMultiplePropertiesToUseFallbackChain() { $propertyValues = [ [ - DIUri::doUnserialize( 'http://username@example.org/foo' ), - new DIWikiPage( '"Foo"', NS_MAIN ) + Uri::doUnserialize( 'http://username@example.org/foo' ), + new WikiPage( '"Foo"', NS_MAIN ) ], [ - new DIBlob( 'Mo' ), - new DIBlob( 'fo' ) + new Blob( 'Mo' ), + new Blob( 'fo' ) ] ]; - $semanticData = $this->getMockBuilder( '\SMW\SemanticData' ) + $semanticData = $this->getMockBuilder( '\SMW\DataModel\SemanticData' ) ->disableOriginalConstructor() ->getMock(); $semanticData->expects( $this->once() ) ->method( 'getPropertyValues' ) - ->with( DIProperty::newFromUserLabel( 'foo' ) ) + ->with( Property::newFromUserLabel( 'foo' ) ) ->willReturnOnConsecutiveCalls( $propertyValues[0], $propertyValues[1] ); $semanticData->expects( $this->any() ) diff --git a/tests/travis/install-mediawiki.sh b/tests/travis/install-mediawiki.sh deleted file mode 100644 index 0a74e31..0000000 --- a/tests/travis/install-mediawiki.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash -set -ex - -cd .. - -## Use sha (master@5cc1f1d) to download a particular commit to avoid breakages -## introduced by MediaWiki core -if [[ "$MW" == *@* ]] -then - arrMw=(${MW//@/ }) - MW=${arrMw[0]} - SOURCE=${arrMw[1]} -else - MW=$MW - SOURCE=$MW -fi - -wget https://github.com/wikimedia/mediawiki/archive/$SOURCE.tar.gz -O $MW.tar.gz - -tar -zxf $MW.tar.gz -mv mediawiki-* mw - -cd mw - -## MW 1.25+ requires Psr\Logger -if [ -f composer.json ] -then - composer self-update - composer install --prefer-source -fi - -if [ "$DB" == "postgres" ] -then - # See #458 - sudo /etc/init.d/postgresql stop - sudo /etc/init.d/postgresql start - - psql -c 'create database its_a_mw;' -U postgres - php maintenance/install.php --dbtype $DB --dbuser postgres --dbname its_a_mw --pass AdminPassword TravisWiki admin --scriptpath /TravisWiki -else - mysql -e 'create database its_a_mw;' - php maintenance/install.php --dbtype $DB --dbuser root --dbname its_a_mw --dbpath $(pwd) --pass AdminPassword TravisWiki admin --scriptpath /TravisWiki -fi diff --git a/tests/travis/install-semantic-meta-tags.sh b/tests/travis/install-semantic-meta-tags.sh deleted file mode 100644 index 8cbf687..0000000 --- a/tests/travis/install-semantic-meta-tags.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/bin/bash -set -ex - -BASE_PATH=$(pwd) -MW_INSTALL_PATH=$BASE_PATH/../mw - -# Run Composer installation from the MW root directory -function installToMediaWikiRoot { - echo -e "Running MW root composer install build on $TRAVIS_BRANCH \n" - - cd $MW_INSTALL_PATH - - if [ "$PHPUNIT" != "" ] - then - composer require 'phpunit/phpunit='$PHPUNIT --update-with-dependencies - else - composer require 'phpunit/phpunit=6.5.*' --update-with-dependencies - fi - - if [ "$SMT" != "" ] - then - composer require 'mediawiki/semantic-meta-tags='$SMT --update-with-dependencies - else - composer init --stability dev - composer require mediawiki/semantic-meta-tags "dev-master" --dev --update-with-dependencies - - cd extensions - cd SemanticMetaTags - - # Pull request number, "false" if it's not a pull request - # After the install via composer an additional get fetch is carried out to - # update th repository to make sure that the latests code changes are - # deployed for testing - if [ "$TRAVIS_PULL_REQUEST" != "false" ] - then - git fetch origin +refs/pull/"$TRAVIS_PULL_REQUEST"/merge: - git checkout -qf FETCH_HEAD - else - git fetch origin "$TRAVIS_BRANCH" - git checkout -qf FETCH_HEAD - fi - - cd ../.. - fi - - # Rebuild the class map for added classes during git fetch - composer dump-autoload -} - -function updateConfiguration { - - cd $MW_INSTALL_PATH - - # SMW#1732 - echo 'wfLoadExtension( "SemanticMediaWiki" );' >> LocalSettings.php - - echo 'wfLoadExtension( "SemanticMetaTags" );' >> LocalSettings.php - - # Site language - if [ "$SITELANG" != "" ] - then - echo '$wgLanguageCode = "'$SITELANG'";' >> LocalSettings.php - fi - - echo 'define("SMW_PHPUNIT_PULL_VERSION_FROM_GITHUB", true);' >> LocalSettings.php - - echo 'error_reporting(E_ALL| E_STRICT);' >> LocalSettings.php - echo 'ini_set("display_errors", 1);' >> LocalSettings.php - echo '$wgShowExceptionDetails = true;' >> LocalSettings.php - echo '$wgDevelopmentWarnings = true;' >> LocalSettings.php - echo "putenv( 'MW_INSTALL_PATH=$(pwd)' );" >> LocalSettings.php - - php maintenance/update.php --quick -} - -installToMediaWikiRoot -updateConfiguration diff --git a/tests/travis/run-tests.sh b/tests/travis/run-tests.sh deleted file mode 100644 index b81600c..0000000 --- a/tests/travis/run-tests.sh +++ /dev/null @@ -1,14 +0,0 @@ -#! /bin/bash -set -ex - -BASE_PATH=$(pwd) -MW_INSTALL_PATH=$BASE_PATH/../mw - -cd $MW_INSTALL_PATH/extensions/SemanticMetaTags - -if [ "$TYPE" == "coverage" ] -then - composer phpunit -- --coverage-clover $BASE_PATH/build/coverage.clover -else - composer phpunit -fi diff --git a/tests/travis/upload-coverage-report.sh b/tests/travis/upload-coverage-report.sh deleted file mode 100644 index aff95cf..0000000 --- a/tests/travis/upload-coverage-report.sh +++ /dev/null @@ -1,10 +0,0 @@ -#! /bin/bash -set -ex - -BASE_PATH=$(pwd) - -if [ "$TYPE" == "coverage" ] -then - wget https://scrutinizer-ci.com/ocular.phar - php ocular.phar code-coverage:upload --format=php-clover $BASE_PATH/build/coverage.clover -fi \ No newline at end of file From 89fecbdca6d7a0d45af622065a97d7bce43040d6 Mon Sep 17 00:00:00 2001 From: alistair3149 Date: Thu, 4 Jun 2026 13:04:03 -0400 Subject: [PATCH 2/4] Fix undefined static property in JsonLDSerializer error handling The EasyRdf catch branch referenced an undeclared `self::$Logger`, so any EasyRdf failure during JSON-LD generation raised an "undeclared static property" Error on a normal page view instead of degrading gracefully. Route the message through MediaWiki's LoggerFactory instead. --- src/JsonLDSerializer.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/JsonLDSerializer.php b/src/JsonLDSerializer.php index 150801d..a4e7fc0 100644 --- a/src/JsonLDSerializer.php +++ b/src/JsonLDSerializer.php @@ -9,6 +9,7 @@ use Exception; use MediaWiki\Html\Html; +use MediaWiki\Logger\LoggerFactory; use MediaWiki\Output\OutputPage; use MediaWiki\SpecialPage\SpecialPage; use MediaWiki\Title\Title; @@ -65,7 +66,7 @@ public static function setJsonLD( $title, $outputPage ) { ] ); } catch ( Exception $e ) { - self::$Logger->error( 'EasyRdf error: ' . $export_url ); + LoggerFactory::getInstance( 'smt' )->error( 'EasyRdf error: ' . $export_url ); return; } From f95467cde5736dc2049b59ef6dbe39f5c6029f17 Mon Sep 17 00:00:00 2001 From: alistair3149 Date: Thu, 4 Jun 2026 13:04:25 -0400 Subject: [PATCH 3/4] Add security policy Document how to report vulnerabilities privately via GitHub private vulnerability reporting, the disclosure process, and where to report issues that actually belong to MediaWiki or Semantic MediaWiki. --- SECURITY.md | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 SECURITY.md diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..18169f9 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,51 @@ +# Security Policy + +## Supported versions + +Security fixes are provided for the latest major version of Semantic Meta Tags. +Please upgrade to the current release before reporting an issue. Fixes ship in a +new release rather than as backports to older versions. + +## Reporting a vulnerability + +Please do **not** report security vulnerabilities through public GitHub issues, +pull requests, the mailing list, or the project wiki. + +Instead, report them privately using GitHub's +[private vulnerability reporting](https://github.com/SemanticMediaWiki/SemanticMetaTags/security/advisories/new). +Please include the affected version, steps to reproduce, and the potential +impact. + +A maintainer will respond to your report, keep you informed of the progress +towards a fix, and may ask for additional information. + +## Disclosure process + +To minimise the risk of exploitation, please give us a reasonable opportunity to +release a fix before any public disclosure. After a report is submitted, we aim +to: + +- Acknowledge the report within 15 days. +- Confirm the issue and assess its severity and impact. +- Prepare and release a fix, prioritised by severity, keeping the reporter + informed of progress. +- Publish a security advisory once a fix is available, crediting the reporter + unless they prefer to remain anonymous. + +Remediation time depends on the severity and complexity of the issue. For +coordinated disclosure we aim to release a fix within 90 days where feasible. + +Because the repository is public and can be watched by potential attackers, +please avoid describing the vulnerability in public channels, including commit +messages and issue comments, until a fix has been released. + +## Vulnerabilities in MediaWiki or Semantic MediaWiki + +Semantic Meta Tags is an extension to MediaWiki that builds on Semantic +MediaWiki. If the issue is actually in one of those rather than in Semantic Meta +Tags itself, please report it there instead: + +- For Semantic MediaWiki, use its + [private vulnerability reporting](https://github.com/SemanticMediaWiki/SemanticMediaWiki/security/advisories/new). +- For MediaWiki core or another extension, contact the + [Wikimedia security team](https://www.mediawiki.org/wiki/Reporting_security_bugs). From aa15344d101ae527b8dbc2905e1a2e84be99b6e8 Mon Sep 17 00:00:00 2001 From: paladox Date: Thu, 4 Jun 2026 18:33:00 +0100 Subject: [PATCH 4/4] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index f78a186..3f70c52 100644 --- a/composer.json +++ b/composer.json @@ -50,7 +50,7 @@ }, "extra": { "branch-alias": { - "dev-master": "7.0.0-dev" + "dev-master": "7.x-dev" } }, "config": {