Page MenuHomePhabricator

Allow specification of version limits for optional dependencies
Closed, ResolvedPublic

Description

Currently we can specify that one extension depends on another, or a specific version of another. But if there is an optional dependency there is no simple way to specify which version.

For example Cite is compatible with a specific version of VE, or can be used without VE completely.

Proposals:

"requires": {
	"MediaWiki": ">= 1.32.0",
	"extensions": {
		"UniversalLanguageSelector": "*"
	},
	"optionalExtensions": {
		"VisualEditor": ">= 0.1.1",
	}
}
"requires": {
	"MediaWiki": ">= 1.32.0",
	"extensions": {
		"UniversalLanguageSelector": "*"
	}
},
"optionals": {
	"extensions": {
		"VisualEditor": ">= 0.1.1"
	},
}
"requires": {
	"MediaWiki": ">= 1.32.0",
	"extensions": {
		"UniversalLanguageSelector": "*"
	}
},
"optionalExtensions": {
	"VisualEditor": ">= 0.1.1",
}

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

I believe this is about extension registry dependencies, not module dependencies.

This is similar to T182472 and might be resolved using the same mechanism.

So would the idea be that if the optional thing exists, but the version doesn't match, it errors?

It's a slightly awkward semantic as optional doesn't mean it's required... It's possible they have an older version for other usages... Should it be erroring out in that situation?

Reedy claimed this task.

I believe... The patch in T182472: Allow extension registration to suggest optional extension/skin or MediaWiki version that fixed this in the patch at https://gerrit.wikimedia.org/r/c/mediawiki/core/+/591897/9/docs/extension.schema.v2.json because that allows constraints...

We don't actually do any validation of those (currently), hence that task still being open.