Page MenuHomePhabricator

Allow adding metadata to config options in extension.json
Closed, ResolvedPublic


Right now the "config" section is a simple mapping of name → value. We also have "magic" keys like _prefix and _merge_strategy. I'd like us to be able to add more metadata to individual config options in the future, so something like:

	"config": {
		"FooBar": {
			"public": true,
			"value": "baz",
			"merge_strategy": "array_plus"

Mostly this would give us significantly more flexibility in the future instead of using hacky underscore prefixed keys. This would be part of manifest_version 2, and I'd like to get it into 1.27.

Event Timeline

Legoktm created this task.Apr 26 2016, 1:02 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptApr 26 2016, 1:02 AM

I'm pretty sure you've something in mind with the "public" key, but I'm not sure what? :)

Generally speaken: I would welcome this, as it definitely gives us a lot more flexibility in this part of extension registration.

"public" was just an example of something I want to add in the future for when we start displaying config settings and their values on-wiki as part of config db, it wouldn't be part of this bug.

Florian added a comment.EditedMay 5 2016, 12:38 PM

@Legoktm: I'm not entirely sure what "would be part of manifest_version 2" mean from an implemantation point of view. My idea would be to still support string values only

FooBar": "value

but encourage anyone to use the "new" way

FooBar": {
  "value": "value"

What do you mean? :)

demon added a subscriber: demon.May 31 2016, 3:59 PM

This isn't a 1.27 blocker is it?

Jdforrester-WMF added a subscriber: Jdforrester-WMF.

At this point it can't.

Paladox added a subscriber: Paladox.Jun 6 2016, 6:32 PM

Change 295648 had a related patch set uploaded (by Legoktm):
registration: Convert "config" into an object with metadata

Change 295648 merged by jenkins-bot:
registration: Convert "config" into an object with metadata