Skip to content

Do not require extension.json schema changes

Urbanecm requested to merge extension-attributes into master

Why: Prior to the patches, extension.json schema had to be modified so that it supports the CommunityConfigurationProviders key. It turns out extension.json supports arbitrary extension-defined keys via the top-level attributes key, in which arbitrary data can be passed to each extension by doing:

"attributes": {
	"ExtensionName": {
		"Key": "data"
	}
}

see [[mw:Manual:Extension.json/Schema#attributes]] for docs.

Since it is better to require less core changes than more, let's rewrite the extension so that the extension.json schema change is not required.

The patch does not change the way how ConfigurationProviderFactory learns of the defined providers. Instead, it constructs a HashConfig in ServiceWiring, sets the CommunityConfigurationProviders key to match the value loaded from attributes in extension.json, and adds it as another ServiceOptions source. This is done so that the source of this information can be easily changed in the future, if that becomes necessary.

What:

  • Load CommunityConfigurationProviders from extension.json attributes, instead of a top level key.
  • Remove CommunityConfigurationProviders key from extension.json of this extension (could be replaced by attributes, but it was empty, and usage belongs to CommunityConfigurationExample anyway).

Bug: T351227

Merge request reports