al-maisan | hello leonardr, are you around and could you please help me with a LP API change? | 00:33 |
---|---|---|
wgrant | Is this the SP.branches dict? | 00:34 |
wgrant | I think that will be difficult or impossible; I don't know of any existing exported dicts that contain other entries. | 00:34 |
al-maisan | wgrant: an attempt, yes. | 00:34 |
al-maisan | http://pastebin.ubuntu.com/300148/ | 00:34 |
al-maisan | this is the error I get during testing: http://pastebin.ubuntu.com/300150/ | 00:35 |
wgrant | That's what I expected. | 00:36 |
al-maisan | hrm | 00:37 |
wgrant | lazr.restful doesn't treat dicts specially. | 00:37 |
wgrant | Normally when it sees an enum in a field it will stringify it, and only then hand it off to be JSON-encoded. | 00:37 |
al-maisan | wgrant: aha | 00:37 |
wgrant | And I'm not sure if launchpadlib is set up to handle dict specifications in WADL. | 00:38 |
leonardr | al-maisan: i'm not really around but i can try to answer your question | 00:38 |
leonardr | unless wgrant already has | 00:39 |
al-maisan | leonardr: thanks -- please see http://pastebin.ubuntu.com/300148/ | 00:39 |
leonardr | yes, i odn't think you'll have much luck exporting a dict | 00:39 |
leonardr | you can publish a named operation that returns a dict | 00:39 |
wgrant | There are existing named ops that return dicts. | 00:39 |
wgrant | Right. | 00:39 |
al-maisan | OK | 00:39 |
wgrant | But I guess launchpadlib won't interpret any entry links inside them. | 00:39 |
leonardr | no, you'll just have a dict of strings to strings | 00:40 |
al-maisan | I'll go down the named operation route then | 00:40 |
wgrant | So I guess just export a named op that takes a pocket. | 00:40 |
leonardr | al-maisan: you should be able to write a serializer | 00:40 |
leonardr | for dicts | 00:40 |
al-maisan | leonardr: aha | 00:40 |
wgrant | leonardr: But won't that require client changes? | 00:40 |
leonardr | look in lazr.restful for other examples | 00:40 |
al-maisan | OK | 00:40 |
leonardr | i don't think so. i think the client will see .foo as a dict | 00:41 |
leonardr | there might be problems changing the dict and sending it back | 00:41 |
wgrant | I mean, lazr.restful will serialise it and stop crashing, but the client will still just see strings. | 00:41 |
al-maisan | leonardr: changing the dict and sending it back is not an issue here.. | 00:42 |
leonardr | wgrant: yes, the client will still see strings, but it's better than creating a named operation that will have the same problem | 00:42 |
leonardr | al-maisan: look in lazr/restful/marshallers.py | 00:43 |
al-maisan | leonardr: thanks for the pointer | 00:43 |
leonardr | i guess i should leave so people don't think i'm still around | 00:43 |
leonardr | good night | 00:43 |
al-maisan | Good night | 00:43 |
wgrant | I see a slight ordering issue here. | 00:45 |
al-maisan | aha | 00:46 |
al-maisan | wgrant: what do you mean? | 00:47 |
wgrant | al-maisan: Well, US people vanishing while you are still here. I make it early morning for you. | 00:48 |
al-maisan | wgrant: yeah ;) | 00:48 |
mzz | so still prodding my bug 456764: after teaching lazr.restful about timedeltas my trivial patch (adding two exported() calls) runs, I see the attributes show up in the apidoc (after I forced a regen of the wadl file), but I don't see them through launchpadlib. | 00:48 |
mup | Bug #456764: please expose builder queue state through the api <api> <ppa> <Soyuz:Triaged> <https://launchpad.net/bugs/456764> | 00:48 |
* al-maisan falls off the chair :P | 00:48 | |
mzz | I'm not sure if this is because I need to patch more of launchpad, the objects I'm accessing through launchpadlib don't actually have that attribute, or I need to regen some other file than the wadl | 00:49 |
wgrant | mzz: You've restarted your launchpadlib app? | 00:49 |
mzz | my launchpadlib app is a script, so yes | 00:49 |
wgrant | (you need to re-create the Launchpad object) | 00:49 |
mzz | let me pastebin some stuff | 00:49 |
wgrant | mzz: what if you browse the object in a browser? (add '/api/beta' to the front of the path to the object) | 00:49 |
mzz | ah, estimated_build_duration does show up there but is None | 00:52 |
mzz | huh, but buildduration shows up and isn't None | 00:52 |
wgrant | That's what I would expect. | 00:52 |
wgrant | They should be mutually exclusive. | 00:52 |
wgrant | Shouldn't they? | 00:52 |
* wgrant checks the code. | 00:53 | |
mzz | not what I meant | 00:53 |
mzz | I mean my launchpadlib script isn't seeing record.buildduration on https://api.launchpad.dev/beta/ubuntu/+source/pmount/0.1-1/+build/19 but my browser does see it on https://api.launchpad.dev/api/beta/ubuntu/+source/pmount/0.1-1/+build/19 | 00:53 |
mzz | I think I'm missing a step or using a wrong url somewhere on the launchpadlib end then? | 00:54 |
wgrant | You removed and regenerated the *dev* WADL? | 00:54 |
wgrant | There are two different WADL documents. | 00:54 |
mzz | ah, let's see | 00:54 |
mzz | I removed wadl-development.xml, not wadl-testrunner.xml. After doing that and restarting launchpad my attribute showed up in launchpad.dev/+apidoc, which I figured was a good sign | 00:55 |
mzz | do I need to do anything on the launchpadlib end? | 00:55 |
mzz | I'm not running launchpadlib on the same host as launchpad | 00:56 |
wgrant | wadl-development.xml should be the right one. | 00:56 |
wgrant | Hmmm. | 00:56 |
wgrant | You don't have a launchpadlib cache set up, do you? | 00:56 |
wgrant | The etag of the object will not have changed, so a cache could break things. | 00:56 |
mzz | I do! that's probably it, killing... | 00:56 |
mzz | (and logging back in... is there a switch on launchpad to turn off access control if you're in a hurry? :) | 00:57 |
wgrant | Not without hacking launchpadlib and wadllib and lazr.restfulclient to use the browser webservice, and that makes leonardr angry. | 00:58 |
wgrant | But remember that you can save credentials. | 00:58 |
mzz | that did it! thanks | 00:58 |
wgrant | Excellent. | 00:58 |
mzz | (my script is using Launchpad.login_with(scriptname, service_root=...) to get a launchpad object, which apparently automatically caches not just credentials but also the wadl) | 00:59 |
mzz | (I'm not even sure that's the right thing to call, it just looked like the easiest thing to call) | 00:59 |
wgrant | I normally use Launchpad.get_token_and_login, but I am probably behind the times. | 01:00 |
mzz | well, that was pretty easy (after I'd found out I needed to remove the wadl by hand, but I guess that makes sense since detecting it's gone stale is painful) | 01:01 |
mzz | (I mean the wadl on the server end) | 01:01 |
mzz | now I just need to figure out how to test this stuff, and see if I can expose a bit of information about the queue too. | 01:02 |
=== lionel_ is now known as lionel | ||
=== abentley1 is now known as abentley | ||
=== abentley1 is now known as abentley | ||
=== abentley1 is now known as abentley | ||
=== henninge_ is now known as henninge |
Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!