[15:56:39] mdholloway: how do i verify that my swagger spec is valid? [16:02:49] coreyfloyd: we set up nagios checking locally as described here: https://www.mediawiki.org/wiki/Wikimedia_Apps/Team/RESTBase_services_for_apps/Ubuntu_setup_notes#Nagios_Setup [16:03:56] actually, that's probably a bit out of date since we're not building in ubuntu anymore, the important point is to download the service checker script at the link there and run it as indicated, the setup probably won't be relevant [16:04:14] or will be different for homebrew if there's stuff you need [16:05:51] i'm just about to take a look at your service patch btw [16:09:42] mdholloway: thanks [16:09:50] just pushed the swagger spec [16:10:10] mdholloway: I just got done using: http://editor.swagger.io/#/ [16:11:13] coreyfloyd: no problem. like i said, you can probably disregard most of the setup stuff at that link and just download the checker plugin at https://raw.githubusercontent.com/wikimedia/operations-puppet/production/modules/service/files/checker.py and run it in a new terminal with the service running and it should Just Work. [16:12:22] the instructions were from when we were building the deploy repo in docker in an ubuntu vm, but i'm running docker natively now and doing the checker script step and don't remember having to do any of that stuff when i made the switch. [16:12:33] mdholloway: thanks - will check out [16:13:14] mdholloway: i am hoping to get the rest of the content today so we can get this wrapped up [18:38:52] niedzielski: you mind pulling my patch down? I changed the name of the startTime -> start_time… but now my test is failing. I swear I changed it in the response - do you see anything obvious? [18:39:23] coreyfloyd: sure, i can do that. sometimes you just need to hose out the ol cache [18:40:19] niedzielski: thanks… how do I kill the cache? Seems like jenkins is pissed about it as well [18:40:52] coreyfloyd: i normally just remove fixtures/ [18:41:14] coreyfloyd: you can also check what would die doing a `git clean -n -dffx` [18:41:32] coreyfloyd: the test are failing for me too [18:41:38] ahh - gotcha thanks [18:41:45] yeah ok so its real [18:42:32] niedzielski: hmm… i’m in the file and I see 4 “start_time” fields [18:42:55] and it builds and returns, so the json is valid [18:43:30] coreyfloyd: i mean, in the spec you say startTime [18:43:41] in announcements.js you say start_time [18:44:07] niedzielski: i missed those [18:44:10] let me try now [18:44:14] thanks [18:44:19] np [18:45:20] niedzielski: nope… 🤔 would the spec even make a difference - i mean the response is what is actually returned [18:45:59] and it can’t find end_time either [18:46:55] hmm… ok… so it can’t find anything that I changed the name of… also i change button.text to button.title [18:49:50] coreyfloyd: i think so? there are some primitive (but super useful) tests that are generated to verify the spec isn't complete rubbish [18:53:39] coreyfloyd: so i did a search and replace start_time and end_time and now i get an error on elem.action.text not being present [18:53:58] ok… that may be it [18:54:07] yeah i changed text to title [18:54:10] and in the swagger spec validator [18:55:34] niedzielski: is that on the wiki somewhere? [18:56:42] coreyfloyd: i'm not sure. it runs as part of the tests against the spec itself so it's kind of transparent. i only know about it because i hope to enhance it some day to do better type validation [18:57:04] niedzielski: oh so if I don’t do describe.only it should run? [18:59:07] coreyfloyd: i'm not sure i follow you exactly but afaik the spec validation happens as part of the tests regardless of whatever extra response tests are added [18:59:41] niedzielski: thanks i think i found it [18:59:47] one more time [19:00:01] cool [19:00:10] i think the issue is that you say text instead of action.text [19:00:24] (or announce.text) [19:00:24] yep [19:00:36] action.text -> action.title [19:00:58] niedzielski: so many pieces of text to keep in sync… just missed them when i refactored the names [19:01:23] coreyfloyd: yeah, i do miss static typing for any kind of refactor [19:01:27] http://i.stack.imgur.com/jiFfM.jpg [19:02:33] in javaland, we'll do massive refactors with pretty high confidence mostly because of typing. it's very convenient to work in, especially in team development. i guess flow and typescript help but i haven't used them much yet [19:03:04] niedzielski: yeah refactors in obj-c are pretty much the same… swift is another story though [19:03:32] i've been trying to use jsdocs more religiously in personal code just for typing but i'm still trying to get vscode to recognize certain scenarios correctly [19:04:04] coreyfloyd: oh really? i thought swift was static but i guess i don't really know anything about it [19:05:47] a thorough eslint config has really helped a ton in my personal js projects but last night i didn't realize a property had a setter and i accidentally assigned directly to it and JS happily trucked along broken [19:05:55] niedzielski: its static so you get build time errors, but the dev tools aren’t caught up. So for things like name changes, you can’t do a refactor… only a find replace [19:07:08] coreyfloyd: hm, that's too bad but i'm sure it'll come along soon if it's static. it'll be really exciting once it lands [19:18:01] niedzielski: 🎉 finally™ https://gerrit.wikimedia.org/r/#/c/320712/ [19:18:14] \o/ [21:04:44] coreyfloyd: fwiw, yes the spec gets tested when all the tests run (no ".only") or you could temporarily add it to the spec.js test file, I guess (I haven't done that). Unfortunately, the tests automatically cache all HTTP responses in the fixtures folder. So, you would need to rm -rf the fixtures folder. Maybe we should make this behavior explicit instead of [21:04:44] by default. [21:09:50] bearND: coreyfloyd: +1 to that, i find myself having to type VCR_MODE=record more often than i actually want to play back the old network responses [21:11:29] bearND: all looks good now [21:11:37] bearND: i had fixed it, but forgot to uncomment those tests [21:16:53] bearND: do you want to discus returning all the data for all clients… sorry i thought we had already discussed that previously [21:44:25] bearND: mdholloway what do I do with this: Images are going to be optional. https://integration.wikimedia.org/ci/job/npm-node-4/14711/console [21:44:35] In the spec the image is not marked as required [21:45:01] https://www.irccloud.com/pastebin/hLZzoRpt/ [21:49:32] coreyfloyd: the spec validation checks actual response against the 'x-ample' response (and considers all the fields there required). easiest thing would be to just take 'image' out of the example response. [21:49:46] mdholloway: thanks… just figured that out as well [21:49:59] mdholloway: bearND thanks for the help and the patience [21:50:10] coreyfloyd: no worries! [21:51:31] bearND: I’m just waiting on that survey URL… I think I will have to get it later tonight. Josh is working on it for me [22:19:50] Undefined index: token in /srv/mediawiki/php-1.29.0-wmf.2/extensions/MobileFrontend/includes/diff/InlineDifferenceEngine.php on line 169