Repository navigation
Replace deprecated InterwikiLoadPrefix hook with InterwikiLookup serv… - #51
Merged
Merged
Conversation
Contributor
|
You'll want to rebase, MW 1.46 added to ci and minimum php raised to 8.2. |
Contributor
Author
I had bumped |
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
alistair3149
requested changes
Nov 18, 2026
alistair3149
left a comment
Member
There was a problem hiding this comment.
I have listed the blocking issues for merging this PR, overall it looks good
…ice decorator The InterwikiLoadPrefix hook, through which this extension published $seqlgExternalRepositoryEndpoints as resolvable interwiki prefixes, has been deprecated since MediaWiki 1.36 and emits a deprecation warning on every interwiki resolution under MediaWiki 1.43. With Semantic MediaWiki 7.0 requiring MediaWiki 1.43 or later, the warning fired on every page view, which is unacceptable for current and future MediaWiki versions. The hook mechanism is therefore replaced by a decorator on the InterwikiLookup service (src/InterwikiLookupDecorator.php), installed through the supported MediaWikiServices hook (src/MediaWikiServicesHandler.php, declared in extension.json). The decorator preserves both consumers of interwiki registration: ByHttpRequestQueryLookup endpoint resolution and external-link rendering of mw-foo:Page titles via MediaWikiTitleCodec. Prefix matching stays case-insensitive by routing through the content language, and null/empty prefixes delegate unaltered to the inner lookup to avoid PHP 8.1 deprecations. The deprecated InterwikiLoadPrefix registration is removed from HookRegistry, which now only carries the smwAskParserFunction and smwShowParserFunction hooks. Transport failures and undecodable JSON responses in the ByHttpRequest pipeline are no longer swallowed into silent empty results: they are reported as distinct query errors (seql-http-request-failed / seql-http-response-invalid) that identify the repository by the label of the configured query source, never by its endpoint URL, so rendered error text does not leak infrastructure details into page output. Only responses that decode as JSON are written to the HTTP response cache, so failed fetches are retried instead of being frozen for the cache lifetime. The configuration documentation gains a "Names must align" section: the source= value, the $smwgQuerySources key, and the $seqlgExternalRepositoryEndpoints prefix must carry the same name, and a mismatch (or a later wholesale re-assignment of $smwgQuerySources) silently falls back to the local store. The extension version is bumped to 2.0.1. The development toolchain is pinned to mediawiki/mediawiki-codesniffer 48.0.2, the last release supporting PHP 8.1, matching the PHP floor declared in composer.json. Verified on MediaWiki 1.43 with Semantic MediaWiki 7.0: composer test green (117 tests), in-page and Special:Ask queries against an external repository render correctly, and no deprecation warnings are emitted. Authored with assistance from an AI coding assistant (OpenCode / GLM). Fixes: SemanticMediaWiki#42
alistair3149
approved these changes
Nov 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…ice decorator
The InterwikiLoadPrefix hook, through which this extension published $seqlgExternalRepositoryEndpoints as resolvable interwiki prefixes, has been deprecated since MediaWiki 1.36 and emits a deprecation warning on every interwiki resolution under MediaWiki 1.43. With Semantic MediaWiki 7.0 requiring MediaWiki 1.43 or later, the warning fired on every page view, which is unacceptable for current and future MediaWiki versions.
The hook mechanism is therefore replaced by a decorator on the InterwikiLookup service (src/InterwikiLookupDecorator.php), installed through the supported MediaWikiServices hook (src/MediaWikiServicesHandler.php, declared in extension.json). The decorator preserves both consumers of interwiki registration: ByHttpRequestQueryLookup endpoint resolution and external-link rendering of mw-foo:Page titles via MediaWikiTitleCodec. Prefix matching stays case-insensitive by routing through the content language, and null/empty prefixes delegate unaltered to the inner lookup to avoid PHP 8.1 deprecations. The deprecated InterwikiLoadPrefix registration is removed from HookRegistry, which now only carries the smwAskParserFunction and smwShowParserFunction hooks.
Transport failures and undecodable JSON responses in the ByHttpRequest pipeline are no longer swallowed into silent empty results: they are reported as distinct query errors (seql-http-request-failed / seql-http-response-invalid), and only responses that decode as JSON are written to the HTTP response cache, so failed fetches are retried instead of being frozen for the cache lifetime.
The configuration documentation gains a "Names must align" section: the source= value, the $smwgQuerySources key, and the
$seqlgExternalRepositoryEndpoints prefix must carry the same name, and a mismatch (or a later wholesale re-assignment of $smwgQuerySources) silently falls back to the local store.
Verified on MediaWiki 1.43 with Semantic MediaWiki 7.0: composer test green (117 tests), in-page and Special:Ask queries against an external repository render correctly, and no deprecation warnings are emitted.
Authored with assistance from an AI coding assistant (OpenCode / GLM).
Fixes: #42