/srv/irclogs.ubuntu.com/2014/09/19/#juju-dev.txt

davecheneyok, one way to think about it is the defer runs _outside_ the scope of the function00:00
davecheneythink of it like this00:00
thumperso the values returned in return statements are assigned prior to the defer running?00:00
davecheneyouter() error {00:00
davecheneyerr := inner() {00:00
davecheney // the defer is here00:00
davecheney}00:00
davecheneyyes00:00
thumperok00:01
davecheneyit's fucking confusing00:01
thumperthat it is00:01
davecheneybasically that sets up a defer at that point in the fuction that if anyone does return err after that00:01
davecheneyst will be closed00:01
davecheneyit could be done with an explcit, if err != nil { st.Close(); return err }00:02
davecheneyat those three points after the defer is added00:02
davecheneythumper: what is even more confusing, you can do this00:03
davecheneyfunc f() (err error) {00:03
davecheneydefer func() {00:04
davecheneyif err != nil { ... }00:04
davecheney}00:04
davecheneyif err := something(); err != nil {00:04
davecheney    return err00:04
davecheney}00:04
davecheneynormally you'd thin that the err declared inside the if block shadows the one inside the defer block00:04
davecheneybut in this spefic case it does not00:04
thumperbecause it is returned right?00:04
davecheneybecause err inside the defer block captures the value of err on the way out, no matter how it is return (either implicitly or explicitly)00:05
* thumper nods00:05
davecheneyunder the hood the defer is capturing the address of the value returned on the stack00:05
davecheneywhich it actaully easier to understand how it works00:05
davecheneyerr has an address on the stack00:05
davecheneyit is assigned somehow by err = XXX, or return err00:06
davecheneythen the defer can retrieve the value from the stack because it knows its name00:06
* thumper nods00:06
davecheneyi don't think this is a very friendly pattern00:06
davecheneyit's shorter, to write, but not to read00:06
thumperI think it is useful so you can't forget, or more importantly, that someone else comes back later, changes something and doesn't do the expected action00:09
thumperI don't like how it requires naming the return values00:09
thumperwould be nice if there was another way to address them00:09
thumpermenn0, davecheney: http://reviews.vapour.ws/r/39/diff/#00:20
davecheneyThis diff has been split across 2 pages: 1 2 >00:28
davecheney^ warning00:28
thumperdavecheney: geez that is annoying00:29
thumperdavecheney: is that a setting in review board itself?00:29
wallyworld_bradm: maybe tomorrow hopefully00:31
davecheneythumper: none that I have found00:33
thumperdavecheney: perhays in the deployment of reviewboard, rather than a client setting... maybe00:34
waiganianyone know how to find a mongo doc missing a particular field?01:09
waiganiI'm playing with bson and reading what docs I can find, no luck yet...01:09
thumperwallyworld_: I think you can fine based on unset01:28
thumpers/fine/find01:28
wallyworld_wot01:28
thumperwaigani: sorry, that was for you01:28
thumperwallyworld_: EWRONGNICK01:28
waiganithumper: thanks01:29
waiganibson.DocElem{"$unset", fieldName})01:32
axw$unset is for removing a field01:49
axwyou want a combination of $not and $exists, I think.01:50
ericsnowaxw: that looks like Sunset, Snot, and Sexists01:57
axw:p01:57
=== fuzzy_ is now known as Ponyo
menn0thumper, davecheney: the documentation isn't very clear but it seems like RB's pagination can be tweaked: https://www.reviewboard.org/docs/manual/1.7/admin/configuration/diffviewer-settings/02:47
* rick_h_ watches thumper's kiwi pycon talk bwuhahaha03:03
thumperrick_h_: hey...03:03
thumperrick_h_: go on, tell me what you really think03:04
rick_h_10min in so far03:04
rick_h_18 to go03:04
rick_h_I'll write a critique later, especially with this django crap :P03:04
bradmoh, haha03:35
bradmthat problem I had yesterday with 1.20.7, its the same with 1.18.103:35
bradmstill does the ifdown eth0, which takes it off the network03:35
menn0very easy review required: http://reviews.vapour.ws/r/61/diff/03:42
menn0thumper, axw, davecheney, wallyworld_?: ^^^ (it's a one line change)04:31
thumpermenn0: done already04:31
thumpergeez04:31
menn0thumper: I just refreshed before. must have just missed you. sorry.04:31
wallyworld_done04:31
thumperheh04:31
* thumper needs to go get sushi before the world implodes here04:31
menn0thumper: why is the world imploding?04:33
thumpermenn0: because jessie isn't getting her sushi05:37
menn0thumper: right05:44
menn0thumper: I thought it was bad weather coming in or something :)05:44
=== urulama-afk is now known as urulama
menn0davecheney and thumper: I think you might like this: http://reviews.vapour.ws/r/64/diff/05:53
thumperis it deleting a lot of code?05:53
thumperpage doesn't exist...05:54
menn0thumper: no but it barely adds any05:54
menn0thumper: try again ... I hadn't hit publish05:54
menn0thumper: this avoids what will no doubt be a flaky CI test05:55
menn0thumper: I started down that road but couldn't see a sane way to test this otherwise05:56
thumperah, actually, I really do like that test :)05:56
menn0sweet :)05:56
menn0I was hoping davecheney might be able to look at the reflection bit. I'm wondering if there's a tidier way to get the method set for an interface.05:57
* thumper needs alcohol05:58
thumpermenn0: I'm trusting that it does what it says on the can05:58
thumpermenn0: I'll let davecheney critique the method of getting the method names :)05:59
thumperI'm about to go make a pizza, open a bottle of wine, and do some evening javascript hacking05:59
thumpernight all05:59
* menn0 is off to pick up pizza himself06:00
davecheneymenn0: i have no idea what that is supposed to do ?06:23
TheMuedimitern: ping08:15
dimiternTheMue, hey08:16
TheMuedimitern: as long as we use RB *smile* would you mind taking a look at http://reviews.vapour.ws/r/43/08:17
TheMuedimitern: sadly the according PR doesn't know the changes due to the tools08:19
TheMueinteresting, didn't expected this08:19
dimiternTheMue, that's probably because you didn't sync your parent master branch with upstream?08:20
dimiternTheMue, looking08:20
TheMuedimitern: that's what I would expect by a tool, not to do it manually (but I thought I had *hmmm*)08:21
TheMuedimitern: regarding my change I would like to diskuss something with you. it's about the usage of the baseSuite. I'm passing it as argument, to make the decoupling more explicit but surely all testAbcV0() to testXyzV999() could be written as methods of the baseSuite too.08:26
dimiternTheMue, sorry, expand a bit more ?08:40
eagles0513875hey all :)08:41
eagles0513875dimitern: just replied to the RB thread btw08:41
eagles0513875with a suggestion :)08:41
dimiterneagles0513875, hey :) nice, thanks08:42
eagles0513875no problem08:42
eagles0513875i proposed custom coding something that will interface with githooks and be a web interface :)08:42
eagles0513875and that if the team is interested is something I would like to work on08:42
eagles0513875seeing as I am not versed in golang08:43
eagles0513875dimitern: you still in malta?08:43
eagles0513875morning fwereade :D08:43
fwereadeeagles0513875, o/08:44
eagles0513875fwereade: i have a RB replacement suggestion not sure if you saw the reply i sent to the RB thread08:44
fwereadeeagles0513875, I don't think that's really a good use of anyone's time -- there's no shortage of review systems in existence08:47
fwereadeeagles0513875, http://sheep.art.pl/Unix%20Koan ;)08:47
eagles0513875fwereade: agreed but with what you reviewed before setting on RB08:47
eagles0513875what were the others lacking08:48
eagles0513875the way i see it something custom coded I would be willing to create for you guys something that will integrate with the github hooks08:48
eagles0513875i already have some good ideas on what can be done fwereade just have to see how feasible it would be to do them with the api and hooks08:49
eagles0513875such as one files a pull request on github and then on said review platform they woudl submit the pull request if approved it would interface with github in a way you can push said reviewed PR through said review site08:50
eagles0513875fwereade: one idea to start off with08:51
eagles0513875either that or find a way where it would pick up on pending pull requests automatically08:51
dimiternTheMue, reviewed08:51
dimiterneagles0513875, no, I moved back home for a while08:51
eagles0513875kool :) you arent missing much here in malta except its super hot still and humid and fwereade can attest to that08:52
dimiternhot and sunny.. nice it almost drowned us here lately with the rain08:52
TheMuedimitern: thanks08:53
TheMuedimitern: I would like to change the funcs to methods too, but all V0 are in the V0 file while later all new V2+ tests are in those files. or would you always place the V0 to V999 test methods into one file? that way surely a testFooV7() could be placed after testFooV1() and the change would be more abvious.08:57
fwereadeeagles0513875, well, it's the chaining that seems to be the biggest issue across the board -- but regardless I worry you're seriously underestimating what it'd take to write a whole new review system08:59
dimiternTheMue, let's not do that :) too many things in one file08:59
TheMuedimitern: exactly08:59
eagles0513875fwereade: out of many that are out there how many interface with the github api's08:59
TheMuedimitern: so V0 in V0 and Vx in Vx08:59
TheMuedimitern: but still as methods of the baseSuite09:00
TheMuedimitern: +109:00
dimiternTheMue, IMO it's easier that way - you immediately see what is where09:00
TheMuedimitern: yes09:00
eagles0513875fwereade: i know its goign to be a monster of a task, buti think a project like that would benefit the github user community as a whole09:00
TheMuedimitern: I think we've got a good approach then09:00
eagles0513875make it easier to review pull requests09:00
eagles0513875etc09:00
dimiterneagles0513875, it doesn't have to be a whole system btw - if there's somehow a way to automate a way of chaining dependent PRs with the github api09:03
eagles0513875dimitern: noted. this was an idea that just came to me :)09:03
eagles0513875fwereade: see above ^09:03
eagles0513875dimitern: if you are going to create something for that might as well create something which has a working gui and its simple to use09:04
* TheMue simply would like to stay with GH w/o any additional tool. less is more.09:04
eagles0513875TheMue: i know it is but if you need a review system that can help review the code a bit quicker and it interfaces directly with github why not09:05
eagles0513875that way all you would need to do is file a pull request on GH then if possible the review system would poll pending pull requests and email devs saying this PR is pending review09:06
eagles0513875once reviewed they coudl easily push it to the appropriate branch09:06
TheMueeagles0513875: an additional site, additional user management, additional usage, additional source of errors09:07
eagles0513875agreed but what if userwise it does authentication against github accounts09:07
TheMueeagles0513875: but that's only my opinion, as a fan of KISS09:08
eagles0513875TheMue: i am a fan of KISS too09:08
eagles0513875that is why im thinking this review system would be as automated as possible with email notifications and interface with the github api to make things a bit easier09:08
eagles0513875fwereade: any further thoughts or dimitern :)09:10
fwereadeeagles0513875, I'm not really seeing anything other than a great big bunch of work that distracts from our core purpose09:11
eagles0513875fwereade: not saying for you guys to do it09:12
fwereadeeagles0513875, integrating *any* extra system is a great big hassle, and writing it from scratch as well renders it pretty much unfeasible imo09:12
eagles0513875im volunteering myself to do it09:12
fwereadeeagles0513875, well, sure, you can write anything you like, and I will wish you luck with it, but it doesn't have much bearing on our current situation09:12
eagles0513875seeing as RB is rather un popular for certain things that is why i suggested somethign custom coded09:13
fwereadeeagles0513875, it is by definition vaporware and hence not something for us to be basing plans on09:13
eagles0513875is RB something open sourced? maybe I can get the source and improve on it for you guys09:13
fwereadeeagles0513875, sure, but it's incredibly rare for the build/buy tradeoff to actually come down in favour of build *except* when it's about your core competencies09:14
eagles0513875ya lost me09:14
fwereadeeagles0513875, ok, how long does it take you on average to write a nice dynamic web app that interfaces with another site, from scratch?09:15
eagles0513875fwereade: would be my first time09:15
eagles0513875have an ideal place already in mind which gives a course about working with the github api09:15
fwereadeeagles0513875, do you see why it would be somewhat foolhardy for us to depend on that?09:16
eagles0513875agreed09:16
fwereadeeagles0513875, like I say, if you're convinced it has value, go ahead, and I wish you much luck with it09:16
eagles0513875fwereade: ill be honest i feel that is the only way i can contribute to juju at this point in time09:16
fwereadeeagles0513875, I've been trying to steer you towards charm development for some time, AIUI that actually fits fairly well with your skillset09:17
eagles0513875:)09:18
eagles0513875question about that fwereade09:18
eagles0513875where are bugs filed against charms on LP or bugs dont get filed against the charms09:18
fwereadeeagles0513875, https://bugs.launchpad.net/charms09:19
dimiternmgz, ping09:21
dimiternmgz, is there a particular reason the merge bot runs out of disk space occasionally while running tests?09:21
mgzdimitern: I've not tracked it down yet09:31
mgzcan only assume the temp drive allocation at the start where we ask for 2 gigs isn't working properly sometimes09:32
mgzbut I don't see why it's now an issue where it didn't seem to be before09:32
dimiternmgz, right09:34
=== fabrice is now known as fabrice|lunch
TheMuedimitern: quick talk?10:45
dimiternTheMue, sure, omv10:46
perrito666morning10:47
wallyworld_hazmat: meeting?11:05
perrito666Changed a lot of things on a couple of files, go fmt says its all right </successkid>11:38
perrito666so little is needed to make me happy...11:38
perrito666is there a way to see the patch is going to be uploaded to rb befor doing so?11:50
wallyworld_axw: katco: still in health/status meeting, running late11:59
axwokey dokey11:59
axwkatco: wanna wait a bit?12:00
wallyworld_axw: katco: feel free to have a chat and then finish without me12:04
katcoaxw: sorry just got my wife/daughter out the door12:05
=== fabrice|lunch is now known as fabrice
dimiternfwereade, wallyworld_, perrito666, TheMue, others? please take a look at https://github.com/juju/juju/pull/799 - the firewaller worker changed to use the new api v1 supporting port ranges13:36
TheMuedimitern: PR on GH, not on RB?13:44
* TheMue loves abbreviations :)13:45
dimiternTheMue, yeah, forgot but it anyone insists, will add one :)13:47
TheMuedimitern: I don't need it, do it on GH13:47
fwereadedimitern, at first glance, shouldn't the upgrade step come first of all?13:58
fwereadedimitern, ah, right, maybe not13:59
fwereadedimitern, forget I said anything :)14:00
natefinchI think for truly trivial code reviews (under 10 lines or something), that GH is fine (like sinzui's version change ones).  Anything more complicated should be on Reviewboard14:00
=== ChanServ changed the topic of #juju-dev to: https://juju.ubuntu.com | On-call reviewer: see calendar | Open critical bugs: 1371605
dimiternfwereade, yep :)14:03
=== luca__ is now known as luca
sinzuinatefinch, jam: can you get someone to look into bug 1371605 hp deplpys are broken in master14:11
mupBug #1371605: HP Bootstrap fails: no endpoints known for service type: product-streams <bootstrap> <ci> <hp-cloud> <regression> <streams> <juju-core:Triaged> <https://launchpad.net/bugs/1371605>14:11
natefinchsinzui: will do14:14
TheMuefwereade: thx for doc review, just changing it, also due to the new approach of API testing14:33
wwitzel3fwereade: http://reviews.vapour.ws/r/58/ already has a review from ericsnow, but needs a meta-review.14:33
wwitzel3dimitern: http://reviews.vapour.ws/r/58/ set.Tags stuff we talked about if you also want to take a look :)14:34
dimiternwwitzel3, great, will do, thanks!14:34
sinzuinatefinch, do you have a moment for https://github.com/juju/juju/pull/80014:42
=== allenap_ is now known as allenap
natefinchlol... just noticed .wtf is a valid TLD now15:13
fwereadewwitzel3, ericsnow: review LGTM, I'm still interested to know the motivation15:28
=== Ursinha-afk is now known as Ursinha
natefinchfwereade, wwitzel3, ericsnow:  I agree... do we really need a full-on set implementation for tags?15:31
=== TheRealMue is now known as TheMue
=== katco` is now known as katco
fwereadenatefinch, well, if we do want sets of tags, then I'm not against carrying a Set implementation -- but yeah, I'm very interested to know the use case ;)15:35
wwitzel3fwereade, natefinch: well mainly it was for dealing with user input. when a user provides many units and services as targets, you end up with duplicates. I had helpers that were filtering the list of names.Tag based on their strings, it ended up being 70% of a set implemtation anyway15:48
wwitzel3fwereade, natefinch: so I figured, instead of having these private helpers, jsut do a set implementation for names.Tag, I felt is better addressed the problem and resulted in a cleaner implementation in the runcmd API15:49
fwereadewwitzel3, heh, interesting15:49
fwereadewwitzel3, is that to happen server-side or client-side?15:49
fwereadeactually surely it's client-side15:50
fwereadewwitzel3, in which case wouldn't set.Strings on the initial input work just as well?15:51
wwitzel3fwereade: services expand to multiple units server side15:51
fwereadewwitzel3, ahhhhh15:51
fwereadewwitzel3, cool, thanks15:51
wwitzel3fwereade: np15:51
wwitzel3fwereade: it is really just a matter of where did the work of "is this tag.String unique for this list" .. and I think using a set abstraction just made all the logic in the runcmd API very simple and easy to understand.15:55
fwereadewwitzel3, yep, I'm satisfied :)15:55
=== fabrice is now known as fabrice|dinner
mattywfolks, I'm of, have a great weekend all16:51
=== fuzzy_ is now known as Ponyo
perrito666ericsnow: having a different client for the api for backups is not that happy :p22:35
ericsnowperrito666: why not?22:36
perrito666ericsnow: I now need functionality from the regular api client and I will have to port it :p22:36
ericsnowperrito666: what functionality do you need?22:37
perrito666for now apparently only client.PublicAddress22:37
perrito666well Ill address that on monday22:40
ericsnowis that only on api.Client?22:41
ericsnowk22:41
perrito666ericsnow: It makes some noise in my head to duplicate that but as long as its only that Ill be fine with it22:45
ericsnowperrito666: yeah, it makes me think that functionality is in the wrong place22:45
perrito666ericsnow: ill have to think about it, we could make it better but its not worth it as it would most likely have a new level of abstraction, anyway have to run, have a nice weekend22:47
ericsnowperrito666: you too22:47

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