/srv/irclogs.ubuntu.com/2014/08/15/#juju-gui.txt

rogpeppemornin' all06:37
rogpeppehuwshimi: do you, by any chance, know the name/address of the calendar that we should add leave to?06:38
dimiternrogpeppe, morning06:54
rogpeppedimitern: hiya06:54
rogpeppedimitern: how's tricks?06:54
dimiternrogpeppe, I wanted to ask you for a while.. 06:54
dimiternrogpeppe, why do you usually send a mail twice to the same lists - once normally and once forwarding it to the same list? :)06:55
rogpeppedimitern: because i very often forget to send it from my canonical address06:55
dimiternrogpeppe, ah :)06:55
rogpeppedimitern: and i believe that it bounces when i send from my normal gmail address06:56
rogpeppedimitern: so i *think* you'll see two messages only when you're directly CC'd06:56
dimiternrogpeppe, so godeps now does both fetching/pulling new revisions and go getting missing packages?06:56
rogpeppedimitern: if you're seeing two messages otherwise, then perhaps i don't need to resend the messages after all...06:56
rogpeppedimitern: yeah06:56
dimiternrogpeppe, nope, I always see 2 msgs06:56
rogpeppedimitern: hmm, maybe that means that rogpeppe@gmail.com is actually subscribed to both06:57
dimiternrogpeppe, good, I'll give it a try to see if it solves my previous issues06:57
dimiternrogpeppe, most likely :)06:57
huwshimirogpeppe: Hey, I'm not aware that there is one.06:58
rogpeppedimitern: it doesn't always work, unfortunately, and i'm not quite sure why. there's something weird going on.06:58
dimiternrogpeppe, sorry about bashing godeps a bit in the msg I sent btw (^^)06:58
rogpeppedimitern: hrmph :-)06:58
rogpeppedimitern: it's open source and i develop it in my spare time - you're free to contribute too :-)06:58
dimiternrogpeppe, with git, you're using fetch rather than pull, right?06:58
* rogpeppe checks06:59
dimiternrogpeppe, yep, I was thinking about it06:59
rogpeppedimitern: it's not that big either - only 718 lines06:59
dimiternrogpeppe, I'll have a look at the source07:00
rogpeppedimitern: i'm using pull. yeah, i should definitely use fetch there, i think.07:00
dimiternrogpeppe, yeah, it's safer - no changes to work dir07:01
rogpeppedimitern: yeah, but... which remote to fetch?07:01
rogpeppedimitern: i guess i could always fetch origin07:01
rogpeppedimitern: ha, "origin" is the default anyway07:02
dimiternrogpeppe, with a properly set up local repo (i.e. as a result of go get or git clone), the remote is already implicitly defined, so just git fetch should work07:03
dimiternrogpeppe, that's what I'm using in my up-dep script for git repos07:03
rogpeppedimitern: i'm not sure.07:03
rogpeppe       When no remote is specified, by default the origin remote will be used,07:03
rogpeppe       unless there’s an upstream branch configured for the current branch.07:03
rogpeppeso it's possible that someone might have configured an upstream branch07:04
rogpeppei think just "git fetch origin" is probably the way forward07:04
dimiternrogpeppe, this can only happen if you're doing development on that dependency07:04
rogpeppedimitern: yeah, but that might happen, i guess07:05
dimiternrogpeppe, i.e. have both origin and upstream remotes, like we have for juju/juju07:05
rogpeppedimitern: yeah07:05
dimiternrogpeppe, and in that case it is still safer to fetch origin, as it should be configured on github to track upstream anyway07:05
rogpeppedimitern: i actually never have an "upstream" remote - i think it's confusing07:05
rogpeppedimitern: i just have "origin" and remotes named after the person07:06
rogpeppedimitern: yeah, i think "origin" is probably the right thing to do, as we really want to fetch updates from the shared origin.07:06
dimiternrogpeppe, having upstream remote locally configured can help you looking for changes/logs/diffs between local branches/origin and upstream07:07
rogpeppedimitern: does it make a difference that it's called "upstream" instead of "rogpeppe" ?07:07
dimiternrogpeppe, also, because I kinda don't trust github magically keeping my origin for up-to-date, I usually fetch upstream/master, push to origin/master, and pull origin/master into my local master07:08
rogpeppedimitern: (i can never remember which way the "stream" flows, so "upstream" isn't a useful name for me)07:08
dimiternrogpeppe, no special meaning about the name07:09
rogpeppedimitern: but upstream is configured to your own github fork, right?07:09
dimiternrogpeppe, :) it's even harder for me, as it different in bulgarian; but what I remembered is upstream=close to the original source :)07:09
dimiternrogpeppe, nope, upstream is the main juju/juju repo, origin is dimitern/juju (i.e. my github fork of the main repo)07:10
rogpeppedimitern: oh, that's really weird then :-)07:10
rogpeppedimitern: and that means that my proposed godeps fix would fail in your situation07:11
rogpeppe:-\07:11
dimiternrogpeppe, how so?07:11
rogpeppedimitern: because it means that "git fetch origin" won't fetch any new updates that have been pushed by other people.07:11
rogpeppedimitern: for me, origin is always the main repo that everyone forks from07:12
rogpeppedimitern: that's automatically set up when i "go get" something07:12
rogpeppedimitern: then i add a named remote for any fork07:12
rogpeppedimitern: darn, i'm not sure that i can make automatic godeps fetching work in general then07:13
rogpeppedimitern: assuming yours is a common pattern07:13
rogpeppedimitern: i suppose i could fetch all07:14
rogpeppedimitern: so do you usually configure your upstream as the default upstream remote for your branches?07:21
rogpeppedimitern: if so (and assuming that's the common pattern), then perhaps i should just do "git fetch" (no args). i think that's probably better.07:22
dimiternrogpeppe, nope07:23
rogpeppedimitern: oh07:24
dimiternrogpeppe, usually origin is the remote you cloned from07:24
rogpeppedimitern: but do you usually clone from your fork, or from the original branch?07:24
dimiternrogpeppe, and in our workflow origin is you fork of the main repo in github, which is supposed to automatically track upstream07:24
dimiternrogpeppe, always from my fork, precisely for the reason origin tracks upstream07:25
rogpeppedimitern: by "track" you mean that it automatically gets updates from its upstream branch?07:25
dimiternrogpeppe, yes, master is tracked by default, and you can add other tracking branches07:25
rogpeppedimitern: (i.e. github does some magic behind the scenes to do that?)07:25
rogpeppedimitern: i didn't know about tracking branches.07:26
* rogpeppe googles it07:26
dimiternrogpeppe, that's the magic really - the fork is a local repo on github servers that has a master branch tracking upstream/master07:26
rogpeppedimitern: so if you "git fetch" your fork repo, you should always get any changes that have been made upstream too?07:28
dimiternrogpeppe, that's how it's supposed to work - i.e. you're not expected to pull upstream/master into origin/master locally and then push to origin/master, but I do that, just in case :)07:29
rogpeppedimitern: but... origin/master surely can't be the name of the remote tracking branch?07:31
rogpeppedimitern: because that's where you've got your own changes07:31
* rogpeppe experiments07:32
dimiternrogpeppe, well it is "remote" wrt your local repo, and it is also "remote" wrt upstream, in a different way :)07:32
* rogpeppe is still confused :-)07:33
rogpeppe... and i thought i had this git thing sussed :-)07:33
dimiternrogpeppe, locally, you have origin/master (I have upstream/master as well), both of these (locally speaking) are tracking branches for the origin and upstream repos07:33
dimiternrogpeppe, on github, where your fork lives, locally (there) origin/master is a remote tracking branch for the upstream repo (juju/juju)07:34
rogpeppedimitern: so how would I refer to that remote remote?07:35
dimitern(i.e. origin/master@github tracks juju/juju/ master @github)07:35
dimiternrogpeppe, you don't need to07:35
dimiternrogpeppe, you need to track the place you cloned from (your fork), and your fork needs to track upstream, so 2 levels of indirection07:36
rogpeppedimitern: so where's the HEAD reference to juju/juju master in my local repo?07:36
dimiternrogpeppe, unless you have an upstream remote to juju/juju, you don't have direct reference to the upstream/master HEAD07:36
dimiternrogpeppe, that's what I have: http://paste.ubuntu.com/8051647/07:37
rogpeppedimitern: but you're saying that doing a "git fetch" of origin (my fork) will automatically fetch any commits that have been made upstream?07:37
rogpeppedimitern: that's what i expected to see07:38
dimiternrogpeppe, yes, because origin tracks upstream07:38
rogpeppedimitern: this is what mine looks like http://paste.ubuntu.com/8051665/ :-)07:39
dimiternrogpeppe, but I find this a little magical, so instead, I do: git checkout master (locally), git pull --ff-only upstream master (into my local master), git push origin master07:40
rogpeppedimitern: i just can't quite work out where the references are kept locally. i.e. how are those double-remote tracking branches represented in my local repo?07:41
dimiternrogpeppe, hah :) interesting, but it's just different naming - your origin is actually my upstream, and your rogpeppe is like my origin07:41
rogpeppedimitern: yeah07:41
rogpeppedimitern: but that scales better07:41
rogpeppedimitern: because i actually own quite a few github accounts07:42
rogpeppedimitern: and it means that any repo that i've done "go get" with is already half set up for development07:42
rogpeppedimitern: (i just need to fork it on github and add the "rogpeppe" remote)07:42
dimiternrogpeppe, I don't think it will scale as well if you need to have multiple origin remotes (say juju/juju and juju/names/ - you need to work on both at some point)07:43
rogpeppedimitern: both of those will be in separate directories07:43
dimiternrogpeppe, no, sorry - yeah :)07:43
rogpeppe"there can only be one origin" :-)07:44
dimiternrespect the origin for it shall prevail :)07:45
rogpeppedimitern: hmm, i can't reproduce the behaviour you're expecting07:50
dimiternrogpeppe, which one?07:50
rogpeppedimitern: it looks like doing a fetch of a github fork does not fetch commits made in the original master07:50
rogpeppedimitern: so i did this experiment:07:51
rogpeppedimitern: i forked a github repo (github.com/go-errgo/errgo) into my own git account (github.com/rogpeppe/errgo)07:51
rogpeppedimitern: i cloned github.com/rogpeppe/errgo into a new directory07:52
rogpeppedimitern: oops, no, scratch that!07:52
rogpeppedimitern: i cloned github.com/go-errgo/errgo into a new directory07:52
dimiternrogpeppe, why the fork then?07:52
rogpeppedimitern: i had another clone07:53
dimiternrogpeppe, you're supposed to clone the fork, not upstream for the tracking to work I think07:53
rogpeppedimitern: with two remotes07:53
rogpeppedimitern: github.com/go-errgo/errgo and github.com/rogpeppe/errgo07:53
rogpeppedimitern: which i named origin and rogpeppe, according to my usual convention07:54
dimiternrogpeppe, ok07:54
rogpeppedimitern: then, in the first cloned directory, i made a change, and pushed that (to github.com/go-errgo/errgo)07:54
rogpeppedimitern: then in the directory with two remotes, i did "git fetch rogpeppe"07:55
rogpeppedimitern: now that, if i understood you correctly, *should* have fetched the commit that was made in master07:55
rogpeppedimitern: but it didn't07:56
dimiternrogpeppe, it depends what is the rogpeppe remote tracking07:56
dimiternrogpeppe, do git branch -r in the double-remote dir07:56
rogpeppedimitern: the rogpeppe remote was tracking the fork (github.com/rogpeppe/errgo)07:56
dimiternrogpeppe, this will show you all remote tracking branches07:56
rogpeppe% git branch -r07:56
rogpeppe  origin/master07:56
rogpeppe  origin/v107:56
rogpeppe  rogpeppe/master07:57
rogpeppe  rogpeppe/v107:57
dimiternrogpeppe, ok, once upstream changed, if you go to rogpeppe/errgo does it show the commit (on github)07:57
rogpeppedimitern: yeah, it says "This branch is 1 commit behind go-errgo:v107:57
rogpeppe"07:58
dimiternrogpeppe, hmmm.. so maybe I don't get what "tracking" means :)07:58
dimiternrogpeppe, it doesn't pull revisions, just tells you if you need to07:58
rogpeppedimitern: i think "tracking" just means that it refers to a remote repo; if you fetch it (explicitly), it'll get all branches from that (and by implication all the commits the HEADs of those branches refer to)07:59
dimiternrogpeppe, so what I'm doing with my "git sync" script - pulling upstream/master and pushing to origin/master is the right thing to do07:59
* rogpeppe goes back to look at the sync script08:00
dimiternrogpeppe, heh :) what do you know - quite an interesting morning discussion, thank you08:00
rogpeppedimitern: indeed - git is a complex beast, and noone quite understands it :-)08:01
rogpeppedimitern: your sync script looks reasonable. but i'm not sure why you bother pushing to origin/master.08:03
rogpeppedimitern: in general, i just use named branches in my github fork, and just use the original (my "origin", your "upstream") tracking branch as a source08:05
dimiternrogpeppe, I push to origin to make sure it's up-to-date (on github) with all upstream commits; that way I can always use either the github UI or git commands locally on origin for diffs etc.08:07
rogpeppedimitern: i don't quite get that. what's an example command that you might run that needs origin/master pushed?08:26
rogpeppedimitern: (i often don't have an rogpeppe/master branch at all, BTW)08:26
dimiternrogpeppe, like git difftool origin/master (or something)08:27
* rogpeppe looks up git difftool08:28
rogpeppedimitern: presumably you could always do "git difftool upstream/master" instead?08:32
rogpeppedimitern: which i'm guessing more directly represents what you actually want to do08:32
dimiternrogpeppe, good point, yes08:50
rogpeppedimitern: so, i've just changed godeps to use "git fetch" rather than "git pull"08:53
dimiternrogpeppe, cheers!08:57
rick_h__morning all11:03
rick_h__rogpeppe: I added the leave for you. It's the juju ui engineering calendar11:04
rogpepperick_h__: thanks a lot11:04
rick_h__np, went through and approved that stuff last night so should be good11:04
rogpepperick_h__: have you got a reference for that calendar? (i think calendars have email addresses, right?)11:04
rick_h__rogpeppe: looking11:04
rick_h__rogpeppe: just shared it out to you11:05
rogpepperick_h__: i think i'm seeing the standup entries because i'm subscribed to frankban's calendar :-)11:05
rogpepperick_h__: thanks11:05
rick_h__oh hmm, standup is different. You should see those. I thought I invited you to those11:05
rick_h__yea, standup should be on your own. You're an invited person11:05
rick_h__jujugui wife has a migraine this morning. I've got to take the boy into day care for her and then get her up to the urgent care. Will be a bit afk this morning. Email if you need anything11:07
* rogpeppe tries to work out how to find a reference to the calendar so i can add it to mine11:08
rogpeppehmm, reloaded and it seems to have added it11:09
rogpeppecalendars are a kinda black magic11:09
rogpeppedammit, my headphones just broke12:16
rogpeppe... and i thought they were so well built12:17
rogpeppeha, i wondered why the charmstore charm wasn't responding as i expected12:21
rogpeppeit uses the old charm store by default!12:21
* rogpeppe lunches12:43
jrwrenrogpeppe: I think I should change the default to v4.13:12
* rick_h__ is back around13:28
jrwrenrick_h__: welcome back.13:30
rick_h__jrwren: thanks13:30
rogpeppejrwren: sorry, i didn't see the git change in PR#2 (though to be fair it wasn't mentioned in the description)13:34
kadams54jujugui: Morning all. Has anyone done anything with CI this morning? I had a build late last night that froze up on one of the tests. Ended up killing it after 1.5 hours, but it seems like a process is still out there hanging onto a port. Subsequent builds are failing with "port in use" errors.13:43
rick_h__kadams54: it knew I was back and wanted to blow up on me 13:46
rick_h__kadams54: sec, looknig13:46
kadams54rick_h__: welcome back :-)13:46
rick_h__wheeee13:47
rick_h__kadams54: process killed13:47
kadams54THanks13:47
rick_h__morning hatch__ 13:56
hatch__mornin rick_h__ 14:06
rick_h__hatch__: pics finally made it up overnight https://www.flickr.com/photos/7508761@N03/14:07
rick_h__killed poor flickr's api lol14:07
hatch__haha nice!14:07
rick_h__had to restart it 4 times yesterday14:07
hatch__lol!14:07
hatch__why flicker and not, say G+?14:07
rick_h__G+ pissed me off when they did the picasa to G+ photos crap14:07
rick_h__they botched that hard core and so moved all my stuff to flickr14:08
rick_h__plus there's no G+ import from other apps/programs14:08
hatch__ahhh14:08
rick_h__I tend to find the highlights and upload them to G+ for easier/thinned out sharing14:08
rick_h__but takes more time14:08
jrwrenrick_h__: ah, you did bring the wife. Where is the boy?14:08
rick_h__jrwren: he stayed at home! 14:08
jrwrenrick_h__: excellent choice! :)14:08
rick_h__he's going on his first plane ride next week though. 14:08
rick_h__will be fun to see how that goes14:09
hatch__I've found kids are either pro's or absolutely horrible14:14
hatch__when it comes to flying14:14
hatch__(from my friends with kids)14:14
rick_h__lol14:14
hatch__they don't usually understand that they are going 600MPH 35,000 ft up14:15
hatch__lol14:15
=== hatch__ is now known as hatch
rick_h__jrwren: do you have a card in progress?14:19
rick_h__jrwren: or the one charm one in review?14:19
jrwrenrick_h__: not really. yes, that in review.14:20
rick_h__jrwren: cool, have a hacky friday project if you're interested14:20
rick_h__jrwren: meet back in standup?14:20
jrwrenrick_h__: I'm sold. What do you have?14:20
jrwrenrick_h__: ok14:20
rick_h__https://plus.google.com/hangouts/_/calendar/cmljay5oYXJkaW5nQGNhbm9uaWNhbC5jb20.t3m5giuddiv9epub48d9skdaso?authuser=114:21
rick_h__bah, wrong one14:21
rick_h__https://docs.google.com/a/canonical.com/spreadsheets/d/1szaU3S4r72DRzDr9TAsMS57FJ8AUaN84q1ov2rNLxZ8/edit#gid=014:22
hatchkadams54:  when you qa'd https://github.com/juju/juju-gui/pull/494 the issues I mentioned were still there?14:26
rick_h__https://juju.ubuntu.com/docs/charms-deploying.html#deploying-to-specific-machines-and-containers14:26
hatchI ask because huw pushed a commit 14:27
kadams54hatch: yeah, although since then I've QA'd the card that fixes container count14:27
hatchwait, what?14:27
kadams54https://github.com/juju/juju-gui/pull/49914:27
hatchso does #494 have to land before #499?14:28
hatchor the other way?14:28
hatchconfused...14:28
kadams54I don't think it matters14:28
kadams54As long as they both land eventually :-)14:28
hatchoh it was an existing issue...14:28
hatchok I'll pick up the second reviews on these and get them landed14:29
kadams54It does seem odd to me that we're calling bare metal "root container" but not incrementing the container count.14:29
kadams54Great14:29
kadams54It'll be nice to have all of these landed.14:29
kadams54FYI, I'm re-running the CI build for https://github.com/juju/juju-gui/pull/49914:29
hatchaye 14:29
hatchsounds good14:29
hatchin order to get my keybindings in ubuntu to be what I want it makes the OSX host completely unusable lol14:34
hatchlooks like I'll have to investigate only modifying the keybindings in the vm14:34
jrwrenother than caps lock as ctrl, I gave up on custom keybindings a decade ago :)14:35
hatchkadams54:  just fyi I'm not going to ship 494 until 499 lands and I can re-qa14:40
kadams54k14:40
hatchjrwren:  so I have caps as ctrl, alt as super, super as alt, plus some others I had to shift around to make that work :) 14:41
hatchcommand, option (in osx) etc14:41
jrwrenhatch: I was about to say, "Sounds like a Mac"14:41
hatchjrwren:  well it is mac hardware :) 14:41
hatchbut of course I use a PC keyboard which makes it even more complicated14:42
jrwrenhatch: using a PC keyboard on a Mac was one of the most frustrating things I've ever done in my life. I hate macminis to this day largely as a result of that experience.14:42
hatchI'm thinking i need a new ergo keyboard and entirely remap it so that doing the ctrl+ combos aren't so messed up14:43
hatchlol14:43
hatchI remapped so that alt was cmd and super was option14:43
* rick_h__ gets annoyed with my 'photo' air with the thinkpad external keyboard on it14:43
hatchthen it was ok14:43
rick_h__damn 'command/option' crap14:43
hatchI was going to just keep fighting to get ubuntu on metal but then I coudln't qa in windows without booting into osx, running ubuntu and windows in a vm14:44
hatchso....yeah14:44
hatchtough life I suppose...14:44
hatch:)14:44
hatchkadams54:  do you have a good test run of #496?14:45
kadams54That'll be the next CI build, but no, not yet14:46
hatchok np14:47
jrwrenrick_h__: where would this matrix code go?14:51
rick_h__jrwren: in a spreadsheet, just put it in a doc for now and maybe we'll dump it to a doc or something once we go through it14:52
jrwrenok14:52
rick_h__jrwren: so we might add a doc/containers or osmething with the script, results, etc14:52
hatchjujugui call in 8, don't be late, rick_h__ is here now ;)14:53
rick_h__woot!14:53
hatchjujugui call in 214:58
rick_h__antdillon: around for call?15:01
hatchallllright back to doin qa's15:21
hatchdarn, looks like there is some conflicts15:22
hatchfixing, will issue a new pr15:28
hatchkadams54:  comments made to your PR15:44
* kadams54 sticks his fingers in his ears.15:44
kadams54"La la la"15:44
hatchlol15:46
hatch+1'd with changes and qa ok15:46
hatchlol all of huw's branches are failing when landing because of conflicts and failing tests15:47
hatchI think they will have to wait until he gets in to get them fixed and landed15:47
kadams54:-(15:47
kadams54Lunch break for me15:48
rick_h__hatch: yea, I cut down the WIP limits on there. That was a few too many branches in review at once 15:54
hatchrick_h__:  I think it was just a symptom of huw combining cards15:56
hatchinto branches15:56
hatchbut probably not a bad idea :)15:56
rogpepperick_h__: what's do you think is a reasonable behaviour when an http PUT request partially succeeds? should we return an error http status, but have some indication of which things have succeeded in the response body; or should we return a 200 status, but have some indication of errors in the response body?16:23
rick_h__rogpeppe: I'd expect it to be some sort of 500 error with some information in the body. 16:24
rick_h__rogpeppe: how does one 'partially succeed'? 16:25
rick_h__e.g. we got the metadata but didn't finish getting a blob or something?16:25
rogpepperick_h__: if we've got a PUT to meta/any, it might involve several database writes; one or more may fail16:25
hatchimho the entire thing should fail (500)16:26
rick_h__rogpeppe: gotcha, hmm, so it might be more a 400 things vs a 500?16:26
rogpeppehatch: i think i agree with that.16:26
hatch400 - you screwed up, 500 - we screwed up :)16:26
rick_h__yea, I can get behind that. 16:26
rick_h__hatch: right, but that's what I mean. If they supply bad data for the 4th document and we fail it should be a 400 "bad request"16:26
rogpepperick_h__: yeah, that's a difficult one16:27
rick_h__hatch: but if we fail because of conflicting user, db issues of our own, timeout, etc that'd be more 500 on us16:27
rogpepperick_h__: the 4th document might have bad data, but the 5th document might have correct data but a db write error16:27
rick_h__but I do agree that I think we fail in some error code way, and try to make sure a subsequent request has a chance of succeeding16:27
rick_h__rogpeppe: right, but we'd return on first fail?16:27
rick_h__rogpeppe: vs trying to push on?16:27
rogpepperick_h__: we may not be able to do that16:28
rick_h__oh hmm, double sucky16:28
rogpepperick_h__: as we want to be able to this stuff concurrently16:28
hatchyeah it should and then roll back to a clean state16:28
rogpeppehatch: we may not be able to roll back either (no transactions)16:28
rick_h__rogpeppe: yea, I think a safe default is a 500 with message info16:28
hatchrogpeppe:  right but you'll have to implement them in the Go side16:28
hatchyou can't have a bunch of broken records in the db because the user supplied incorrect data 16:28
rick_h__rogpeppe: yea, we might need to be able to call out ids/records we know is in a fubar state or something16:29
rogpeppehatch: if it's a db error, it's likely the database connection is down, so we'll be a bit stuffed if we try to roll back16:29
rick_h__rogpeppe: or else how does a subsequent api call not get back half rev 3 data and half rev 4 data?16:29
rogpepperick_h__: i think it should be possible to avoid anything getting in a fubar state16:30
rick_h__rogpeppe: cool, yea I'm +1 on starting with a 500 + message body16:30
rogpepperick_h__: sgtm16:30
hatch+116:30
rogpepperick_h__, hatch: thanks16:30
rogpeppeonly one other thing that concerns me: currently we are totally consistent when we send back an error response - it looks like {"Code": "something", "Message": "an error message"}. In this one case, we'd need to send back a set of errors, not just one. this makes me more inclined towards a different error code.16:36
rogpeppethe consensus from a brief glance at these search results seems to be that some kind of 200 response might be more appropriate: https://www.google.co.uk/search?q=http+status+partial+failure&oq=http+status+partial+failure&aqs=chrome..69i57.4301j0j7&sourceid=chrome&es_sm=93&ie=UTF-816:37
rogpeppespecifically: http://stackoverflow.com/questions/8472935/http-status-code-for-a-partial-successful-request16:37
rogpepperick_h__, hatch: ^16:37
hatchrogpeppe:  the issue is that we shouldn't have a partial record created16:37
rick_h__rogpeppe: right, but in that case resending to users would be harmful16:37
hatchif you only create half of the required stuff it's going to cause issues16:38
rick_h__rogpeppe: while in our case, resetting the data should be ok and safe16:38
rick_h__rogpeppe: so there's no need to split out the next request to only supply data for docs 4 and 5 since 1-3 are already updated16:38
rick_h__rogpeppe: I think a partial update of a charm is a failed update16:38
rick_h__imo and all that16:38
hatchagree16:38
rogpepperick_h__: so we don't bother telling the client which elements of the bulk request have failed?16:39
hatchwe have to do everything we can to maintain a quality data set16:39
rogpepperick_h__: we just say it all failed, even though some elements have actually succeeded?16:39
rick_h__rogpeppe: right, the message might contain some info, but we're not going to expose to them "don't bother sending fields x,y,z, they're ok16:39
hatchrogpeppe:  we would return the first thing that failed16:39
rogpeppehatch: we don't necessarily apply them all sequentially16:39
rick_h__rogpeppe: the clients would have to be able to take that response, adjust a subsequent request, and submit again?16:39
rogpepperick_h__: well, they'd have that freedom16:40
rick_h__rogpeppe: right, but I think it's overkill for what we're doing16:40
rogpepperick_h__: or they could just send the whole request again16:40
hatchrogpeppe:  I'm confused, so you would leave partial incorrect data in the db?16:40
rick_h__rogpeppe: and a ton of client complexity for what win? request size?16:40
rogpeppehatch: yes - i don't think there's any way around that possibiity16:40
hatchrogpeppe:  of course there is16:40
rick_h__hatch: welcome to document dbs sans transactions across docs :) 16:41
rogpepperick_h__: i'm just wary of saying to the client "this failed" when some changes have actually been made16:41
hatchno just because the db doesn't support it doesn't mean that the app layer cant implement it16:41
rick_h__rogpeppe: right, but the client requested "change this metadata on an object" and that failed to occur and the client should notify the user, give them the info to try again with the hopes they can succeed.16:41
rogpeppehatch: if one change has been made, then the db connection goes down before you can make the next change, how're you gonna revert the first change?16:42
rick_h__and it's too much for me to hink clients will not just check '200 success' but '200 but hey, did every field get updated?'16:42
rogpeppehatch: also, reverting the data is hard when you've got other concurrent clients. you might revert other clients' deliberate changes.16:43
rogpeppehatch: because the only way of reverting is by writing some data that you retrieved some time ago, since when it might have changed.16:43
hatchrogpeppe:  so you have updated the db with bad data, now you go and request that data - oops the app fell over because of the bad data16:44
rick_h__hatch: we can work on methods of mitigating. 16:44
rick_h__hatch: let's concentrate on the initial question at hand. 16:44
rogpeppehatch: i don't think that we'll ever update the db with bad data here16:44
hatchoh i thought the initial question was solved16:45
hatch:)16:45
rick_h__and we can debate ACID different :)16:45
rick_h__hatch: well, rogpeppe was showing us the other examples in stack overflow and we were discussing how this is a bit different16:46
hatchoh ok yeah 16:46
rick_h__anyway, on that note I definitely think an erorr code on a failed update is still appropriate. 16:46
rogpepperick_h__: this is different because we don't trust our clients? :-)16:46
hatchno the workload to implement it in every client is not worth it16:47
hatchimho16:47
rogpeppe(to read the docs and response body)16:47
rick_h__rogpeppe: this is different because redoing the work a second time in their case is 'ungood' 16:47
rick_h__rogpeppe: so I'd consider their case an exception to the rule vs a standard 16:47
rogpepperick_h__: there's just something that seems wrong in my bones about discarding error info like that, when one error might be "permission denied" and another might be "database failed", and the client would want to retry the latter but not the former.16:50
rick_h__I'm not saying throw away the info. I don't see why we can't work out getting the errors to the user16:50
rick_h__the only thing I'm against is a 200 when we know it failed 16:51
rogpepperick_h__: ah, ok.16:51
hatchrogpeppe:  the first is a 4** the second is a 5**16:51
rick_h__I'm all for getting good error to the user16:51
rogpepperick_h__: can we choose a different 500 error then?16:51
rogpepperick_h__: i guess we'd have to choose a number ourselves16:51
rogpepperick_h__: or... just encode it in the string i suppose16:51
rick_h__rogpeppe: yea, nothing else 'fits' I can see16:51
rick_h__where did you shoot me the current message object?16:52
rick_h__ {"Code":  "something", "Message": "an error message"}16:52
rick_h__so can we not update that in any way?16:52
rick_h__with a details key, or allowing Message to be a list?16:52
rogpepperick_h__: one possibility, which we've already explored a little way, is double-encoding json in the message16:53
rick_h__:(16:53
hatchso on submit you're going to wait untill all the 'transactions' are complete before returning to the user a list of the 'tasks' and their outcome?16:54
rick_h__hatch: so they're going to fiure off 4 workers to update 4 docs and when all 4 come back build a response16:54
rogpeppehatch: yeah16:55
rick_h__hatch: it might be all 4 are good, 200, or 3 good, one bad with a message, or 1 good 3 bad with 3 messages16:55
rogpepperick_h__: allowing Message to be a list doesn't quite cut it.16:55
hatchrogpeppe:  can one transaction fail with a 400 while the other is a 500?16:56
rick_h__rogpeppe: k, I'm tempted to extend it a bit and say we have the code, a message "applying changes failed" and some details object that's more complex clients could use to provide the better list of feedback16:56
rogpepperick_h__: we actually want to return a map from id to error in some cases, and from id to endpoint to error in some others16:56
rick_h__rogpeppe: and for simple cases, the complex obj is just empty16:56
rogpeppehatch: yeah16:56
rick_h__rogpeppe: but that's just what I would do. I can be talked into a different custom error code number or whatever16:57
rogpepperick_h__: i think that's probably a reasonable approach. need to think it through a little more.16:57
hatchI think this is all moot, the validation should happen prior to the db request so it will 400 before anything could 50016:57
hatchso you only have 2 options, 200 for all, or 400 for one+ (which makes the responce 400)16:58
hatchresponse*16:58
rogpeppehatch: for example, consider a PUT to /v4/meta/extra-info/foo of {"precise/wordpress-23": "val1", "precise/badcharm": "val2"}16:58
hatchok16:59
rogpeppehatch: that makes it considerably less efficient (and it can still fail) because you've got two db round trips where you only need one, and the object might still have disappeared when you actually make the request16:59
rogpeppehatch: (talking about pre-request validation there, BTW)17:00
hatchbut what I'm saying is that you should know that precise/badcharm is a bad charm before making the db request17:00
rogpeppehatch: you can't know that17:00
rogpeppehatch: maybe it was good but when you actually do the request for real, it's been removed17:01
hatch*sigh*17:02
hatchlol17:02
rick_h__race condition turtles all the way down :)17:02
rogpepperick_h__: yeah.17:02
hatchsounds like wrong-tool-for-the-job syndrome 17:02
rogpeppehatch: it's ok really.17:02
rogpeppehatch: just treat them as independent requests, even though they're bundled up into one17:03
hatchok so return a list of error messages (in whatever format) and the request response status would be 200 < 500 < 400 17:04
hatchso if they broke it, even if there is a 500, it returns a 40017:04
hatchit couldn't continue anyways because they did something wrong17:04
hatch (we are still talking about the original request response code right? )17:05
rogpeppehatch: there are different classes of "wrong"17:05
rogpeppehatch: yeah17:05
hatchwell, unrecoverable wrong is a 40017:05
hatchok let me rephrase17:06
hatchwhen would we want to return a 500 if there is also a 400?17:06
hatchso they sent us bad data, and our db was down for example...17:06
rogpeppei'm somewhat inclined towards rick_h__'s p.o.v. that we should only return a 200 if everything went according to plan17:06
hatchwell yeah17:06
hatchI didn't know that was even off  the table lol17:07
rogpeppeand i think that if someone is generating bulk requests, they should be prepared to deal with the results17:07
hatchagreed17:07
rogpeppehatch: well, that's what the SO post was suggesting (200 with result errors)17:08
hatchoh, no imho that's bonkers17:08
hatch:D\17:08
hatch:D17:08
hatch(I don't have strong beliefs at-all!)17:08
hatchrogpeppe:  I suppose in the case where it would be alright if only one succeded then maybe...but even then i'd be pretty far on the side of returning a 4/50017:09
rick_h__it makes sense in that case. If the api call sends emails out to users you don't want to resend to the same users again17:10
rogpeppeso i'm thinking that for a bulk request, you'll always get a 500 error, and you have to look at the error details to find your individual error codes17:10
rick_h__seems reasonable17:10
hatchrogpeppe: well.... what if they had 400 errors and no 500 errors?17:11
hatchso it was actually all their fault17:11
rogpeppehatch: i don't think it matters that much17:11
hatcha 500 they may just re-submit the data even though it's faulty 17:11
rogpeppehatch: they can determine that by looking at the individual codes17:12
rogpeppehatch: which is logic they're going to have to write anyway17:12
rogpeppehatch: so it actually simplifies both server and client code, i think17:13
rogpeppehatch: (to have a single error code for a bulk request, that is)17:13
rogpeppes/code/status/17:13
hatchok I gotcha17:13
hatchagree17:13
hatch200 or 500 with a list17:13
rogpeppehatch: yeah17:13
rogpeppehatch: and i will look into providing more arbitrary error objects in the error response17:14
hatchyeah It would be nice if there was an array of errors or the lke17:14
hatchI think rick_h__ mentioned that earlier 17:15
rogpeppehatch: definitely. that's the plan (actually a map/object of errors)17:15
hatchwhat would the keys be? (curious)17:15
rogpeppehatch: in the /meta endpoint, the requested ids. in the /meta/any endpoint, the requested "include" endpoints.17:16
rogpeppehatch: and those can nest, i think17:16
hatchahh ok cool17:16
hatchyeah +1's all around17:16
rogpeppehatch: so you could do: PUT /meta/any with the body {"precise/wordpress-23": {"extra-info/foo": 123, "extra-info/bar": true}, "precise/bad-435": {"extra-info/ppp", 345}}17:17
rogpeppehatch: and get the error response:17:17
rogpeppeoops, let's rephrase that17:19
rogpeppe{"precise/wordpress-23": {"extra-info/foo": 123, "bad-endpoint": true}, "precise/bad-435": {"extra-info/ppp", 345}}17:19
rogpeppepossible error response:17:19
rogpeppe{"Message": "partial failure", "Code": "partial failure", "Details": {"precise-wordpress-23": {"extra-info/foo": {}, "bad-endpoint": {"Message": "bad endpoint", "Code": "not found"}}, "precise/bad-435": {"extra-info/ppp": {"Message": "charm not found", "Code": "not found"}}}17:21
rogpeppeperhaps...17:21
rogpeppei think that's the most complex scenario that there is17:21
rogpeppeanyway, i need to stop now :-)17:22
hatchlooks easily parsable, although that would be a full failure :)17:22
rogpeppehatch: not quite - "precise/wordpress-23/extra-info/foo" was successfully changed to 123...17:23
rogpeppeg'night all and happy weekends and mondays too.17:23
hatchnight rogpeppe see ya tuesday17:23
rogpeppehatch: see ya17:24
jrwrenjuju status nil pointer reference.  I'm good at breaking things.17:36
rick_h__hah17:36
hatchlol17:39
lazyPowerhey hatch, question for you - is there already work being done to get ghost on series=trusty?18:38
hatchlazyPower: by work.....do you mean.....me not being lazy?18:39
hatch:D18:39
lazyPoweryour words not mine ^_^18:39
lazyPowerapperance of lazyness is just applied efficiency18:39
hatchhaha - tbh it deploys jsut fine on trusty I just need to make a repo for it18:40
lazyPoweryou also need tests18:41
lazyPowerAmulet testing of the ghost charm would be pretty simple. just some config set validation, and port 2364 (default) validation w/ port change requests validation and it should be g2g.    Throw in a haproxy relationship verify the reverse:proxy relationship is g2g and sounds like a winner for trusty18:41
hatchoh yeah I need to learn amulet18:43
jrwrenfriday rant: juju drives me to drink.18:44
rick_h__jrwren: good day for it?18:44
rick_h__jrwren: anything we can help out with?18:44
jrwrenrick_h__: just venting. I'm frustrated becuase I just wasted what feels like 2 hrs trying to make azure work.18:45
jrwrenrick_h__: isn't juju supposed to read updated environments.yaml ? somehow I had a stale environments/azure.jenv18:46
rick_h__jrwren: yea, they're trying to remove environments.yaml18:46
rick_h__and the jenv is the true source of truth18:46
jrwrenah.18:46
jrwrenthat is too bad.18:47
rick_h__hopefully things will get better. Trying to get rid of the jenv as well. We'll see how that shakes out18:48
jrwrenthat will be sweet :)18:49
hatchMakyo:  hey any luck with the investigation of the multi unit removal?19:24
Makyohatch, yeah, I don't think we have enough information for much other than an XXX Comment now.  We don't know how the modelIds will look, and we'll need to allow people to remove specific units if they're on specific machine constraints.19:26
hatchahhh19:26
hatchthat's a good point19:26
hatchdarn - we really need that removal functionality :/ 19:27
hatchI mean, it's not HORRIBLE heh19:27
hatchbut.....ya know19:27
MakyoYeah, for sure.19:29
MakyoSo let me push up real quick and get your opinion19:29
MakyoPushed19:36
hatchchecking19:50
hatch+1'd19:51
MakyoWill fix up that test, then19:52
* rick_h__ heads out for the day20:07
rick_h__have a nice weekend all20:07
hatchyou too, cya20:07
hatchman I'm just having no luck with the internets this week21:20
jrwrenI'm off. Have a good weekend ya'll.21:23
hatchcya jrwren21:34
hatchyou too21:34

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