[00:00:42] ottomata: yeah, but it fails out of the box due to dependencie [00:01:00] What's a minimal way to get it going locally? [06:57:25] Hey all. Hopefully these are easy ones, but I'm just simultaneously going in circles while banging my head against a wall, and I could use an experienced perspective. To start, can I create a category of an item at the same time as I create a page for it? For example, I create a page titled 'Earth' using the form for Category:Planets, but I would [06:57:25] like this same form to also generate a 'Category:Earth' page as well. [06:57:26] page is created it will be assigned to Category:Moons, but I would also like it to be assigned to Category:Earth by detecting it from said dropdown. [06:57:26] the steps to edit and save said new page. For example, on the page Category:Elements, I'd like a field where I can type 'Hydrogen' and click Submit (which would create a blank page titled Hydrogen and assigned to Category:Elements), after which the page would refresh, I would see the new entry Hydrogen, and could then repeat with the next entry. Is [06:57:27] such a thing doable? [08:45:54] Hey there! [08:46:10] I’ve been attempting to find a email for you guys as i wiwish for my page to be deleted. [08:46:19] How do i go about this? [08:49:54] Hello! [08:56:15] Hi noahsammak. [08:56:21] Which page? URL? [13:24:32] Krinkle: there's a docker image for eventlogging if you want to build it (not published yet) [13:25:14] just added you as a reviewer [13:30:06] Krinkle: just tried, it seems eventlogging-devserver still works with python2 [13:30:08] just not python3 [14:00:55] ottomata: hm.. so it should work with python2 virtuelenv? [14:01:04] and then python setup.py? [15:28:00] Krinkle: ya i did a python2 pip install in a venv [15:28:03] and then was able to do [15:28:13] python bin/eventlogging-devserver [15:28:15] and it started [15:32:47] Is there a way to find out if the currently logged in user has apihighlimits with javascript? [15:33:09] Something like mw.config.get( "wgPermissions" )? [15:37:23] or mw.user.getRights() ? [15:38:58] ShoeMaker: yes, mw.user.getRights() [15:39:21] https://doc.wikimedia.org/mediawiki-core/master/js/#!/api/mw.user-method-getRights [15:45:36] I think this is close, but it's not returning anything. mw.user.getRights( result => { return ( result.indexOf( 'apihighlimits' ) === -1 ? false : true ); } ); [15:54:19] ShoeMaker: The callback is asynchronous, where do you want to return it to? [15:54:26] to show it in the console, use console.log() [15:55:13] mw.user.getRights().then( result => { var has = result.indexOf( 'apihighlimits' ) === -1; console.log(has); return has; }).then(function (has) { ... use has somewhere ... } ) [15:55:26] without the logging: [15:55:39] mw.user.getRights().then( result => result.indexOf( 'apihighlimits' ) === -1; }).then( has => { ... use has somewhere ... } ) [17:54:12] ottomata: hm.. failing on mysql_config? https://gist.github.com/Krinkle/fea74d7f4727db23b1e803135ed56e4e#file-gistfile1-txt-L40 [17:55:53] heh. hm, Krinkle i guess comment out mysqlclient in requirements.txt ? [17:55:56] ottomata: I have the old version of devserver in mwext-EventLogging working stripped down to the bare minimum (only 1 jsonschema dependency). I could submit that if you'd be interested in keeping that in the mw repo for the short-medium term until EventGate is fuly adopted. [17:56:09] sure that sounds fine [17:56:46] I'll give #mysqlclient a try as well. [17:58:26] ottomata: without mysqlclient the pip linstall succeeds [17:58:32] but then: python ./bin/eventlogging-devserver [17:58:32] File "./bin/eventlogging-devserver", line 169 [17:58:32] print(highlight(pretty_json, json_lexer, formatter), end='') [17:58:32] ^ [17:58:33] SyntaxError: invalid syntax [17:58:44] looks like that part requires python3? [17:58:58] but if I try that I get "module eventlogging not installed" (since it's not in the venv) [17:59:12] oof [17:59:37] how did you invoke it? [17:59:57] maybe i have old stuff in my venv? [18:00:12] i just did [18:00:17] python bin/eventlogging-devserver [18:00:31] tbh i never use eventlogging-devserver [18:00:50] which python version do you have there (you're in the venv/activate?) [18:00:51] i also did pip install inside of mw-vagrant [18:01:28] Python 2.7.13 [18:03:07] Right. so from there, if you cd eventlogging, git status (clean?), virtualenv -p python .venv, source .venv/bin/activate, pip install ., python bin/eventlogging-devserver; that works for you? [18:03:55] will wipe and recreate virtualenv.. [18:04:25] * Krinkle learns about print(end=) [18:04:46] Look like that's py3 indeed, the internet tells me [18:07:51] btw Krinkle i think my mysqlclinet install works because I have the libmariadbclient-dev .deb installed [18:08:21] and yes Krinkle ^^ works for me [18:09:24] Hm.. so it's expecting more than just plain pip/python dependencies. Hard for local/limited dev setups or CI to run through. [18:09:37] But print end= does not exist in Python 2 right? [18:11:08] dunno iut seems to work for me [18:13:39] :/, okay. I'll clean up the stripped down version I have and submit that. I'm using Python3 for that and wil document it with built-in venv in the README. [18:17:02] sounds good thank you! [19:33:09] Krinkle: is there a in MW JS to determine if running in a development environment? [19:34:51] ottomata: yes/no. we have some specific toggles for some functionality. what is the use case? [19:35:02] There is an EL debug mode. There is a php/db debug mode. [19:35:04] https://phabricator.wikimedia.org/T240355#5999640 [19:35:14] i could make an EL specific config switch for it [19:35:32] and just set it to not require stream config in mw vagrant [19:35:42] ottomata: there is already an EL debug mode. For the old client that publishes regardless of config as well, so makes sense to use that I think. [19:35:47] oh ok [19:36:47] https://doc.wikimedia.org/EventLogging/master/js/#!/api/mw.eventLog.Debug [19:36:52] ottomata: https://imgur.com/GpiKZLk [19:37:03] That also makes dev and QA much easier [19:38:03] looking for how to enable [19:38:07] debug mode [19:38:35] by default in mw vagrant [19:39:27] no need to dig into network tab that way, it's just there on the page in the notif popup [19:39:52] https://github.com/wikimedia/mediawiki-vagrant/blob/57ef729a34620611b170d88d56afc337f0813290/settings.d/README#L33-L36 [19:40:10] hm, yeah but Krinkle i want to allow events to be sent through to eventgate in mw vagrant withoutt stream conig [19:40:14] stream config* [19:40:18] ottomata: it's based on user pref. We might not want to enable that by default as that would mean your screen will fill up with with a lot of notifications from EL when using instrumented features you aren't currently develpping. [19:40:25] oh, ok. [19:40:32] not just for the instrumenting developer but for who? [19:41:09] for the instrumenting developer? and for me? or anyone else using mw vagrant to develop? [19:41:15] ottomata: Also, how would that work once we have meaningful stream configs we can't fake easily? [19:41:20] this seems incompatible with what I've heard so far :) [19:41:30] eventgate is configured in mw vagrant to not check [19:41:36] it will validate an event with its schema [19:41:44] but it isn't worried about what schemas are allowed in what sterams [19:41:49] it just produces the event if it validates [19:41:53] for developes working on instrumented features and QA, I imagine the debug mode would be preferred, it means you don't need eventstreams or vagrant installed. You just get it client-side there. [19:42:02] hm true. [19:42:05] hmmm [19:42:15] i guess that's true. if they don't want to bother with all that stuff. [19:42:30] eventlogging role in mw vagrant does currently include eventgate [19:42:31] should it not? [19:42:35] I guess knowing whether it's valid would be good, but that's hard to do with a full setup of everything. We catch that early in Beta cluster. [19:42:38] should it be debug mode supported only? [19:42:45] not impossible but non-trivial with what I know currently. [19:42:56] hard to do without* [19:42:58] i mean, it is kinda easy in mw vagrant [19:43:03] vagrant roles enable eventlogging [19:43:11] (or wikimediaevents) [19:43:22] * Krinkle hasn't used vagrant in years. [19:43:31] and you get everything you need. i could also make it set up all the EventStreamConfig stuff exactly how it is in prod too [19:43:40] but that's extra annoying when you are just trying to dev instrumentation i thhnk [19:43:42] oh my. [19:43:53] i thought everyone use mw vagrant? [19:43:58] used* [19:44:27] not anymore I think, but I have no idea what the distrubution is nowadays. [19:44:31] hm [19:44:34] what do people do? [19:45:37] some ppl use LAMP/XAMP/MAMP, some ppl install apache+php themselves via homebrew or apt-get. some ppl do the former but in a more secure way (cgroup or a VM or something) . some ppl use mediawiki-docker-dev (since 2018) or the (as of last month) mediawiki-docker in core.git. [19:45:41] ok, perhaps i'll just make a config switch for this that defaults to false? [19:46:01] wgEventLoggingRequireStreamConfig [19:46:18] $wgUserDefaultOptions['eventlogging-display-web'] = 1 [19:46:30] That would be a way to enable EL debug mode without it requiring someone to change their user preferences. [19:47:43] hm, i don't know if this debug module will work well with new style stuff [19:47:58] IIUC it uses this custom jsonschema validation stuff inside of eventlogging [19:48:21] and iit gets scehmas from schemaApiQueryUrl [19:48:28] yes, that's what it does today. It's just a mechanism to load JS code and do something. [19:48:54] I'm just suggesting that we might not want to split that more to keep things easy for people who know EL and all the docs around it. [19:49:41] i don't mind the display log event stuff, that's cool [19:49:50] but i'm not so sure about doing the validation in browser [19:49:55] looking up the schemas, etc. [19:50:03] right. [19:50:08] we'd have to reimplement a bunch of the stuff that eventgate does inside of eventlogging client code [19:50:27] sure, np. [19:50:44] no need to do that :) [19:51:07] the optoin could be renamed to 'eventlogging-debug' perhaps to make its purpose clearer. [19:51:20] ah ok i see thise sets a debugMode inside of core.js though... [19:51:22] but having yet another thing to have to understand and enable when working with EL would be nice to avoid. [19:51:22] ok i can use that [19:51:39] yeah [19:51:47] i see.... [19:51:59] hmmmm ok let me try this, mabye i can even get the display event thing working for eventgate style events [19:52:00] and if you do want to enable it by default in vagrant, then you can set $wgUserDefaultOptions['eventlogging-display-web'] = 1 as part of the eventlogging module. [19:52:04] right [19:52:05] ok cool [20:13:14] hm Krinkle i have to be logged in eh? [20:13:24] either way, not quite working for me, either by setting in mw conf, or by entering that into browser [20:13:35] Hello. I've got a question which I can't find an answer anywhere. I looked at the FAQ, and no look either. Is it ok if I ask here? [20:13:50] OH WAIT [20:13:54] as soon as I ask [20:13:57] it is working [20:13:59] hm. [20:14:00] nm [20:14:16] Average-user: As long as it's about MediaWiki... [20:15:06] Reedy: hehe yep. So I wish to modify the account creation process. Stuff like making real name mandatory, and adding some other questions [20:15:24] But I can't find an aextension nor the file in the source to modify it [20:15:54] The only thing I bumped into was an deprecated extension. Butdon't know how risky it is to try it [20:17:17] So.. Adding other questions should be doable using hooks [20:17:42] !hook UserCreateForm [20:17:42] https://www.mediawiki.org/wiki/Manual:Hooks/UserCreateForm [20:18:02] That's no use now [20:18:34] Yep. I'm runing 1.34. So I believe that will now work [20:18:48] !hook AuthChangeFormFields [20:18:48] https://www.mediawiki.org/wiki/Manual:Hooks/AuthChangeFormFields [20:19:03] https://www.mediawiki.org/wiki/Manual:Hooks/AuthChangeFormFields [20:19:07] That might help me though [20:19:09] thanks [20:19:46] There definitely should be examples of adding fields etc [20:46:50] ottomata: shoudl work logged-out as well yeah [20:48:06] i think entering it into the console with the Api() stuff doesnt' work logged out [20:48:13] not sure why the default mw config setting wasn't working [20:48:15] i've done both now [20:48:17] so one of them worked [20:48:18] :? [20:48:20] :) [20:58:52] ottomata: yeah, anons can't save user_prefs to the DB. [20:58:57] That's only for logged-in indeed. [20:59:12] just submitted patch [20:59:15] i think its working [20:59:26] added you as reviewer