Thursday, 2016-04-07

*** openstackstatus has quit IRC03:01
*** jmccrory has quit IRC03:26
*** jmccrory has joined #storyboard03:26
*** persia has quit IRC04:31
*** persia has joined #storyboard04:33
*** alexismonville has quit IRC04:56
jtomasekkrotscheck: I see you've been doing changes in the npm related jenkins jobs. The registry error is not happening any more. Now I am hitting 'npm ERR! extraneous' http://logs.openstack.org/82/295882/3/check/gate-tripleo-ui-npm-run-test/a3adc64/console.html is it something related to ongoing changes you're doing?05:35
*** mrmartin has joined #storyboard06:34
*** mrmartin has quit IRC07:08
*** mrmartin has joined #storyboard07:36
*** openstackstatus has joined #storyboard08:30
*** ChanServ sets mode: +v openstackstatus08:30
-openstackstatus- NOTICE: jobs depending on npm are now working again08:35
Zaramorning, storyboard!09:47
*** mrmartin has quit IRC10:18
* Zara goes back to gerrit stream event things10:37
Zarawell... getEvent() gets one event,the most recent10:39
pedroalvarezLooking at the code, looks like "startWatching" starts a thread that populates a queue with the events10:43
pedroalvarezgetEvent gives you one from the queue10:43
pedroalvarezso you can maybe create a loop ("while True" ?) where you `getEvent` and then do something with that event,10:44
pedroalvarezmaybe just print it10:44
Zaraheh, yeah, I just tried with a small loop to test10:45
Zarajust counting from 1-10, printing while10:45
Zarait works, but they don't print until the loop completes10:45
Zaraso while True probably won't show anything up, probably just bad control flow, will tinker10:46
pedroalvarezhm, that's odd10:46
Zaramaybe it just took a while to print them and then just did it all at seemingly the same time10:46
Zaraahh, there we go10:48
ZaraI waited for a bit and then the events started covering my screen10:48
Zarathis is going to be... interesting to test.10:49
pedroalvarezoh, getEvent is a blocking call10:50
pedroalvarezso, when you run it, the program will block unitl an item is available in the queue10:51
pedroalvarezthat's why you had to wait a bit10:51
Zaraaha10:52
* Zara tries pasting to have a thing on hand to look at easily, doesn't quite work out. http://paste.openstack.org/show/493293/11:01
pedroalvarezthat's what you get with getEvent?11:14
ZaraI think it was getEvent().items()11:17
ZaraI'm still wandering around and seeing what I can see11:17
pedroalvarez:)11:17
ZaraI'm not yet sure how to say to it, 'if x key has y value, do a thing', but that's just because I haven't used python much; should work it out soon11:20
Zaragot it, yay11:28
pedroalvarez:D11:28
Zaranice that that's built in11:28
ZaraI think I used it ages ago for the email templates, but lol like I have a memory11:28
pedroalvarezif dict['x'] == y:11:29
pedroalvarez    do a thing :)11:29
Zarahmph11:29
pedroalvarezthere will be more ways, of course11:30
Zarafor key, value in gerritProjects:11:30
Zara    if (key=="change"):11:30
Zara        print value11:30
Zarawas what I had11:30
Zaraas a first step11:30
Zaraso then it'd just be a further 'if' with the value... and then tidy it11:31
Zarabut the dict option is tidier11:31
Zaraso I'm stealing it11:31
pedroalvarezbear in mind that if gerritProjects['change'] doesn't exist, it will throw an exception11:31
*** mrmartin has joined #storyboard11:51
*** jhesketh has joined #storyboard12:01
*** ChanServ changes topic to "storyboard"12:01
*** ChanServ changes topic to "StoryBoard - A task tracker for OpenStack development needs :: http://storyboard.openstack.org/ :: https://wiki.openstack.org/wiki/StoryBoard"12:02
*** jhesketh has quit IRC12:07
*** jhesketh has joined #storyboard12:07
krotscheckjtomasek: Dunno, how about I go look :)12:09
krotscheckOh, that's shrinkwrap telling you that you have extraneous unused modules in your dependencies. Which... is understandably odd, because it's a clean install. Is tripleo doing something wacky and installing extra things?12:10
jtomasekkrotscheck: it does not. we're using patternfly (currently v 2.10.0) and the issue seems to come from there, but when I look at package.json there the dependencies I see the errors at are listed there12:12
jtomasekkrotscheck: https://github.com/patternfly/patternfly/blob/v2.10.0/package.json12:13
jtomasekkrotscheck: If I try to reproduce the issue by running clear npm install and npm shrinkwrap on my local setup, it executes just fine12:14
krotscheckDefinitely odd12:14
jtomasekkrotscheck: my setup has npm 3.8.3, node 5.10.012:14
krotscheckI've got a vm here with the correct versions, just a minute12:15
krotscheckjtomasek: Is there a better channel for us to talk about this? I'm thinking infra... what's the tripleo project name?12:18
krotschecksorry- channel nam,e?12:18
jtomasekkrotscheck: project is tripleo-ui we can go to #tripleo or #openstack-infra12:19
Zaraokay so that took me a ridiculous amount of time because I thought an object was the same as a dict. nothing to see here, carry on, carry on.12:53
*** mrmartin has quit IRC12:53
Zarabit more confident on accessing things from a dict, anyway.12:54
Zara;_;12:54
persiaJust be careful to try the dict access, in case the key is absent, and all should be fine.12:55
ZaraI was just using completely the wrong methods and things because I was searching 'objects' when I was trying to access a dict12:56
ZaraI don't think js differentiates between objects and dicts12:57
Zaraand I'm used to just going foo[bar].baz to access properties and values and things12:57
Zaraso that was fun; turns out it's really easy and I just didn't know the right runes12:57
Zarait's a running theme.12:59
*** mrmartin has joined #storyboard13:00
Zaraso after far too long, I have for key, value in gerritEvents.items():13:05
Zara   if (key=="change"):13:05
Zara      print value.get('commitMessage')13:05
Zaraso for changing a status, the next step would be to check commitMessage for a specific string that mapped to task_id,13:05
Zarabut we won't get those in the wild13:06
Zaraaces, status and commit message are in the same dict13:08
ZaraI'd guess we only update for NEW (review), MERGED (merged) and ABANDONED(todo)13:10
Zarathere's a 'SUBMITTED' option but sb doesn't have a way of representing it13:11
Zara(at least, if I've understood it right13:11
ZaraI believe it means, 'someone has clicked workflow +1 but now it needs to pass all the tests'13:11
Zaralearnin' python, learnin' python, learnin' me some python13:12
Zara(I probably seem strange for talking to myself at length, but I use this channel so I don't have to make another text file with my notes as I'm working things out and things are public, so hahahahaha.)13:17
*** mrmartin has quit IRC13:19
persiaAgain, you might want to use "try:\n  if (key=="change"):\n    print value.get('commitMessage')\nexcept KeyError:\n"13:24
persiaOtherwise, if you happen to get an event that doesn't have the key you want, you will exit.  Alternately, you may have mapped it safely somewhere else, so it doesn't matter (because that doesn't look like a dict access).13:24
Zaraokay, I don't know whether or not gerrit lets people upload changes without messages or statuses, though I agree it's good to be careful with it. Right now this whole thing is horrible and hacky in worse ways (hardcoded user token, anyone? :D)13:32
ZaraI can add that but I'm changing everything around a lot while I learn how to do things13:32
*** b3rnard0_away is now known as b3rnard013:33
Zara... python has tuples...13:33
Zaralong have I wished for something like this in the things I use more13:34
*** mrmartin has joined #storyboard13:48
*** mrmartin has quit IRC13:52
*** mrmartin has joined #storyboard13:55
*** NikitaKonovalov_ has joined #storyboard14:05
ZaraI think I'm almost ready to test updating a storyboard instance from review.o.o, though it won't yet do anything exciting14:08
ZaraI think it worked14:13
Zarayup, it does14:14
ZaraI can add commit messages as task links14:14
Zarawe'd probably want that plus the url14:14
*** NikitaKonovalov_ has quit IRC14:15
Zaraso yeah, we can get a storyboard instance updating from a gerrit instance, and if I managed it it's not that hard. :)14:16
Zarathough this is horrible hacky stuff14:16
*** NikitaKonovalov_ has joined #storyboard14:16
Zaranot production quality14:16
Zaraand that's just with one event, not the ongoing stream... but I'll put the code I have so far up somewhere14:17
ZaraI'm guessing we should have a new repo for the storyboard bot14:17
Zarabut idk if I can face proposing a new project yet :P14:19
pedroalvarezZara: go for your github for now, it will be easier :)14:21
persiahttp://docs.openstack.org/infra/manual/creators.html#add-new-repository-to-the-governance-repository isn't that hard, really.14:22
ZaraI'm considering putting it up in the pythonclient, even though it doesn't belong there14:22
Zarathat way people can see what kinda thing the pythonclient can be used for14:23
ZaraI don't advocate merging it there or anything, dw14:23
persiaIt's hard to remove things from git repos once pushed.  If it's a simple script, just paste it somewhere.  If it's more complex, then a repo could work (and githb could work), but it probably belongs as it's own thing.14:23
Zarait's a simple script and bad atm, I mainly want to push it because it makes it easier for other people to see14:24
persiaIf it's really hacky and you don't want to have the history, ignore me, and put it somewhere private :)14:24
persiaJust copy to a pastebin then.14:24
persia(after censoring it, of course)14:24
Zarait is incredibly hacky, I'm not sure it matters if people see the access token for sb and things though, given it's a vm that's just on my office network14:25
persiaOh .heh :)14:25
persiaAlthough, what openid provider are you using?  If a public one, this may be relevant.14:25
Zarahm, it goes through launchpad14:25
* persia doesn't know enough about the nature of these access tokens to know if this would leak information14:25
ZaraI thought it was a storyboard-specific access-token, it just makes a new one each time you log in iirc14:26
persiaSo, yeah, you don't want to publish your LP credentials, even though you're only accessing some local instance somewhere.14:26
Zaraokay, I think it's actually fine but I won't risk it14:26
persiaIf you're confident it's safe, then use it :)14:26
Zaranot confident enough14:26
* persia really doesn't know enough, but is very paranoid about this sort of thing14:26
ZaraI don't know how it's generated from the lp things, so could be work-outable from that14:26
Zarain pratice I have no power anyway so nobody could do anything interesting with it if they got it, but it'd be annoying xD14:27
Zaraso yeah, very hacky, lots of awful variable names and random stuff that doesn't need to be in there, mainly pasting in case someone wants to play and wants a better base than I had: http://paste.openstack.org/show/493342/14:29
Zarait takes one event, updates a specified task to match some things from that event14:30
Zarathe task is currently hardcoded14:30
Zarathe access token is hardcoded so will expire after an hour14:30
Zara(well, it's redacted there, but yeah)14:30
ZaraI'm just happy that gerrit can definitely talk to storyboard.14:30
Zarareally you want to analyze the commit message for a string that identifies the task_id, and update that task,  but there isn't that kind of thing on r.o.o14:31
Zarayou'd also want to do it from the events continually, of course :P14:32
Zaraand atm it'll crash in the case persia mentioned14:33
persiaReading that makes me think it would be nifty to be able to add a task to a story in SB with a commit message, for the case where one is shaving a yak, and doesn't want to have to fiddle the SB interface to identify the extra stuff one did to complete a story.14:36
Zarayeah, atm I'm just not even thinking about that because I don't know how to map a task in gerrit to a storyboard story14:38
Zara*commit in gerrit14:38
Zarawell, you'd need a story identifier in the message14:38
Zaraand a way of checking that the task wasn't there already14:39
persiaRight.  As a first pass, I think looking for "^Task: #\d+$" in the commit message, and updating that task is a sensible interface.14:42
Zaraokay, is there a chance people are already 'Task:' as a trigger for anything else?14:42
Zaraeg: launchpad, whatever other tracker?14:43
persiaAs a second pass, maybe look for "^Story: #\d+$" in the case where there is no "^Task: \d+$", and create a new one?14:43
persiaIn LP, the trigger string is "LP: #\d+", which may appear anywhere in a line, I believe.14:43
persiaI also believe that LP tracks the repo to which something was committed to decide which task to modify.14:44
Zaraokay. second pass sounds fine, but I'd rather get task status updates working, then refine it into something that can be used somewhere other than my instance, then come back to adding features.14:44
Zarayeah, storyboard could track the project, and I can see it making new projects trivially enough that way14:45
Zarabut other than that, not sure it's worth it14:45
Zarasince sb things have unique ids anyway14:45
persiaThat said, I think submitting a commit message including "^Closes-Bug: #\d+$" triggers LP, which is different than what LP does natively.14:45
persiaBut my knowledge of LP is outdated, and my knowledge of gerrit<->LP interaction entirely based on http://docs.openstack.org/infra/manual/developers.html14:46
Zaraheh14:47
Zaraprobably better than mine14:47
Zarawell, I looked at the launchpad bot, and it seemed complicated so I ran away again14:47
Zaraand tbf I actually managed to do this despite no python and no real experience of getting apis to communicate, so hey.14:47
* pedroalvarez reads how this is going and gets excited14:48
persiaNow that you've done that, take another look at the LP bot.  I suspect you'll find it easier reading.14:48
Zara(hah, tried to get it updating a bunch of times, managed to just make the task update the same way around 1000 times)14:50
persiaGiven that you've hardcoded the task ID and update string, this isn't surprising :)14:52
persiaAs a quick hack, you could pass an ID to storyboardUpdater, which was just a counter for the number of events processed.14:53
persiaThis would update the *wrong* tasks, but it would let you see a selection of updates.14:54
Zaraah, I didn't mean that the same task was updating14:56
*** NikitaKonovalov_ has quit IRC14:56
Zarait should be updating the commit message14:57
Zarawell, the task link, with the commit message14:57
*** NikitaKonovalov_ has joined #storyboard14:57
Zarabut that's not changing14:57
Zaraso I think what I *should* be seeing is the message changing each time I refresh the page14:57
Zarainstead, nothing changes, but I can see the PUTs in my webclient logs14:57
Zaramy conclusion: it's applying the same data 1000-odd times14:58
Zaraand my control flow is probably screwed up14:58
persiaThat's one possibility.  The other is that it is doing 1000 PUTs so fast that by the time your browser can examine it, you're already looking at the final result.14:59
Zarayeah, I wondered about that, but I could see them happening in realtime in the logs14:59
Zaraso seems a bit weird that the two would be out of sync like that14:59
Zara(well, I assume realtime, maybe delayed, but why)15:00
persiaThat said, given your paste, I'd probably put the call to storyboardUpdater inside msgAndStatus, so that it gets called on every event.15:00
persiaOr some other loop, because the paste looks like it gets the event once, and then does other things.15:00
*** NikitaKonovalov_ has quit IRC15:01
*** NikitaKonovalov_ has joined #storyboard15:01
Zarayeah, I added the loop after the paste15:01
Zarajust to be extra confusing15:01
Zarabut I just stuck storyboardUpdater in a loop15:01
Zaramy favourite bit of that hacky code15:02
Zarais that msgAndStatus returns a tuple, so the position matters15:02
Zarabut I put the name of the function the opposite way round from the things returned15:02
persiaPaste again?15:03
Zaracount = 015:04
Zarawhile (count < 1000):15:04
Zara    storyboardUpdater(status, message)15:04
Zara    count = count+115:04
Zarait's just that15:04
Zaracould just be bad syntax, or anything, really15:05
persiaNo, that's correct.15:05
persiaThe issue is that you're calling that with static data.  You need to refresh status and message inside the loop.15:05
persiaSo something like storyboardUpdater(msgAndStatus(gerritEvents))15:06
Zarayeah15:06
Zarahm, I thought 'status, message' would be equivalent to msgAndStatus(gerritEvents) there15:07
ZaragerritStatusMessage = msgAndStatus(gerritEvents)15:07
Zarastatus, message = gerritStatusMessage15:07
Zara^ since that's how I got them... tbf this whole thing isn't sensibly scoped or abstracted or anything15:07
persia= is assignment, not assertion of equivalence.15:08
persiaso it assigns the value at that point in the program flow, and doesn't change again until reassigned.15:08
ZaraI think I was thinking that as status and message are the things returned by msgAndStatus, it ends up being called each time they're asked for15:10
persiaThat's what I thought :)  Yes, it doesn't work that way with the current syntax.15:10
persiaPassing a variable only passes the assigned value for the variable, rather than calling the function.  If you want the function to be called each time, you need to call it explicitly.15:11
ZaraI wonder if this is because I'm used to something a bit different in js land, or just because I'm tired. :P15:11
persiaAlso, on loop syntax, consider "for count in range(0, 1000):"15:12
persiaJavascript works the same way for simple variables.  I think you're more used to operating on objects and using angular, which reduces the use of bare variables.15:12
Zarayup15:14
ZaraI want to look at this more but I have to do an install guide for another thing (not storyboard) so I might not get to it tonight15:26
ZaraI also wanted to document my work so far so someone else could take a look15:26
Zarabut yeahhh15:26
Zaraso best thing is for anyone looking at this to ping me15:27
Zaraif you're trying to get your own one working up to the point I'd got it15:27
Zaraand something's not working15:27
Zaradoes anyone mind if I push it to the pythonclient repo and -2 it15:49
Zara?15:49
*** mrmartin has quit IRC15:55
* Zara pushes15:57
openstackgerritZara proposed openstack-infra/python-storyboardclient: WIP Proof of Concept Storyboard Updating from Gerrit  https://review.openstack.org/30291215:57
*** mrmartin has joined #storyboard16:21
anteayaZara: when is the storyboard meetup again?16:46
anteayaI don't see it listed here yet: https://wiki.openstack.org/wiki/Sprints16:47
anteayaI can clean this up and you can add it or you can clean it up and add it, either way16:47
anteayaI have to go offline now for a bit and while check back later16:47
Zaraohhh, I think we said 16th of May?16:52
ZaraI should know... it's probably on the storyboard page, hang on16:52
Zaraheh, yes https://wiki.openstack.org/wiki/StoryBoard/Milestone_1_Meetup16:58
Zarano text in it yet16:58
ZaraI'm behind on getting my notes together for the summit16:59
Zaralet alone milestone 1 ;_;16:59
Zaraalso, I hope your house is less watery!16:59
ZaraI've been very distracted this week, so I'm sorry not to be more engaged with that :/16:59
*** NikitaKonovalov_ has quit IRC17:03
Zarahah, I love how much pep8 hates my wip17:30
*** mrmartin has quit IRC18:09
*** NikitaKonovalov_ has joined #storyboard19:36
*** jtomasek has quit IRC20:03
*** jtomasek has joined #storyboard20:05
*** mrmartin has joined #storyboard20:21
*** mrmartin has quit IRC21:24
*** b3rnard0 is now known as b3rnard0_away21:35
*** NikitaKonovalov_ has quit IRC22:20

Generated by irclog2html.py 2.14.0 by Marius Gedminas - find it at mg.pov.lt!