Requests for comment/Configuration database 2/IRC convo

Conversation with ^d in #wikimedia-dev. Mainly so I don't lose this. Timestamps PST. [05:29:23 PM] <^d>	 legoktm: So, initial thoughts I had.... [05:30:39 PM] <^d>	 1) If we're enumerating all default settings (metadata section), I don't see the need for $wgHiddenConfigOptions. [05:30:59 PM] <^d>	 I think we can define that info in the metadata. [05:31:02 PM] 	 Oh, just set 'hidden' => true [05:31:04 PM] 	 good point [05:31:50 PM] <^d>	 2) I'm not quite as big a fan of singletons as I was when I wrote my draft. My idea these days is putting it in RequestContext & friends (cf: https://gerrit.wikimedia.org/r/#/c/92004/) [05:32:10 PM] 	 right [05:32:12 PM] 	 I added in: [05:32:14 PM] 	 "Accessible via context: $conf = $this->getContext->getConf;" [05:32:28 PM] <^d>	 Ah, missed that :) [05:33:48 PM] 	 Right now my main concerns are: [05:34:03 PM] 	 1) Is JSON considered "fast enough" for the WMF needs, or should it also be implemented in CDB? [05:34:29 PM] <^d>	 I'd like to benchmark it, but my assumption is the latter is faster. [05:34:39 PM] <^d>	 hhvm may make it not really matter either way, but I digress :) [05:34:53 PM] 	 2) How to sanely implement crosswiki stuff [05:35:14 PM] <^d>	 That was always one of the things I struggled with. [05:35:21 PM] <^d>	 interwiki stuff is hard :) [05:35:34 PM] 	 Right now a lot of settings are by dblist, so I was thinking of implementing CentralAuth's wikisets in core, but that would get a lot more complicated than it needs to. [05:37:05 PM] 	 Otherwise I'm thinking of just doing 'value' : {'default: 'something', 'enwiki':'something else', 'wikisource': 'something for the whole family'} [05:37:10 PM] 	 and we'd keep dblists for now [05:37:25 PM] <^d>	 Yeah let's keep dblists :) [05:38:43 PM] <^d>	 legoktm: Whatever structure you choose, make sure the Cdb-backed version can do something to break it down further. It doesn't store arrays or fancy things, just key => value [05:39:01 PM] <^d>	 (But then again, if json is fine it may be no big deal and we won't have to diverge) [05:39:05 PM] 	 hm [05:39:31 PM] <^d>	 I'll try to make up some numbers on json vs cdb reads. [05:39:45 PM] <^d>	 s/make up/benchmark/ ;-) [05:39:46 PM] 	 What if we use JSON for human readable and actual master storage [05:39:59 PM] 	 and then CDB can just be 'xxwiki-wgName' => 'actual real value'? [05:40:01 PM] <^d>	 That's what I'd prefer for MW by default. [05:40:08 PM] <^d>	 I think drop the database-backed version entirely. [05:40:18 PM] <^d>	 (Then everything can be configured :)) [05:40:30 PM] 	 except for $wgEnableOnWikiConfiguration! [05:41:00 PM] <^d>	 Why not? Presumably MW would just read that from the LS.json like any other setting? [05:41:40 PM] 	 Technically it would work. Just not for sanity [05:42:07 PM] 	 change all the settings to stupid values, then disable the onwiki configuration so no one can fix it ;) [05:42:08 PM] <^d>	 Well, that's an implementation detail, no need to worry about it in the RFC. [05:42:11 PM] 	 yeah [05:42:19 PM] <^d>	 So yeah, here's the best course of action. [05:42:32 PM] <^d>	 1) Remove the remaining references to a database, we're going json-only (and maybe cdb) [05:43:02 PM] <^d>	 2) Clean up that proposed json structure (and heck, let's make DefaultSettings a .json too :)) [05:43:36 PM] 	 If its a php file, you can do cool stuff like $wgAddGroups &= User::getAllRights [05:43:51 PM] 	 or...something like that. [05:43:57 PM] <^d>	 I think a design goal of this should be removing config from code :) [05:44:11 PM] <^d>	 (which we're doing nicely, minus the DefaultSettings) [05:44:27 PM] 	 hrm. [05:44:29 PM] <^d>	 Anyway, think on it, make a few more edits, and I think we'll have a fine RFC for wider discussion. [05:44:51 PM] <^d>	 Good work so far! [05:45:15 PM] 	 thanks