/srv/irclogs.ubuntu.com/2015/02/23/#ubuntu-autopilot.txt

veebersthomi: hey, you have a moment?02:42
thomiveebers: depends02:43
thomiwhat's up?02:43
thomi(btw, I've semi-officially started in CI now)02:43
veebersthomi: ah awesome, congrats :-)02:43
veebersthomi: I would like to bounce something off you. In autopilot, the change that we made for the extension classes in the proxy object creation (def _try_custom_proxy_classes) wasn't perfect02:44
veebersI see in the gatekeeper testing a bunch of errors that seem to stem from CPOs that multi inherit.02:45
veebersI tried what I thought would be a fix, but I'm getting really odd issues, for instance, the validate_dbus_object method gets swapped out at some stage to something completely different02:45
veebersthomi: so I was hoping for some advice on how to further debug this.02:46
thomiheh... multi-inheritance almost certainly won't work for CPOs02:46
thomiwhy do people feel the need to multi-inherit CPOs?02:47
veeberscurrent culprit: class ContactListPage(_common.PageWithHeader, _common.PageWithBottomEdge):02:47
thomiyeah you can't do that02:47
thomiwhoever did that needs a slapping :D02:47
thomiPageWith*** are both CPOs?02:47
* veebers double checks02:48
thomiif you want to do that, make those classes mixin classes02:48
veebersthomi: affirm02:48
thomibut you can only derive from your emulator_base exactly once in the class heirarchy02:48
veebersthomi: hmm, ok. So now I have a couple more queries. Is there a way that we can determine that a cpo is attempting to use multiple inheritance? (so we can provide a sane warning)02:49
thomione sec02:50
veeberssecondly, this is now a larger issue as it means that application test code needs to change (because up until now this seems to have worked).02:50
thomiveebers: to answer your first question... yes, with a metaclass you can02:55
thomiyou can walk up the inheritance tree and inspect everything there02:55
thomiWRT your second comment - it might have worked, FCVO "work"02:55
thomiI doubt, for example, you could have passed the child class as an object to select_*02:56
veebersah right, walk the tree set a flag when finding something inherited from the CustomProxyBase, error if we attempt to set again or something02:56
thomisomething like that02:56
veebersok, makes sense02:56
veebersthomi: ok, so my current plan is to back out the fix that we did re: the extension classes, get the doco stuff and a couple of other fixes in02:57
thomiremind me what our fix was, and what precipitated it?02:57
veebersthomi: Then I'll get a proper fix for the base class stuff and send out a communication to the teams to make sure that the code is correct and ready02:57
veebersthomi: this fix, where the extension classes weren't always being used in a class:02:58
veebershttps://code.launchpad.net/~veebers/autopilot/fixing-extension-classes-and-test/+merge/24696202:58
veebersThe proposal I had today was pretty much: __bases__ = tuple(set(base).union(set(extensions)))02:58
thomiveebers: why doesn't that work?02:59
veebersthomi: my proposal? I'm not entirely certain, but it's causing issues with the address book test I'm using to confirm (my failing test passes with it too)02:59
thomiwhat's the error message?03:00
veebersAttributeError: Class 'ContactListPage' has no attribute 'open_contact'03:00
thomiwhat's the difference in __bases__ with, and without your proposal?03:01
veebersthomi: the odd thing I'm seeing is that the validate_dbus_object method code changes so that possible_classes is always an empty list so never attempt to use the CPO version03:01
veebersI suspect something is happening earlier on that dirties something to make it misbehave03:02
thomihow do you mean 'changes'? a different VDO function is called?03:02
veebersthomi: yeah03:02
thomiwhat's the new function it's calling?03:02
veebersthomi: If I do: print(inspect.getsource(proxy_class_dict['ContactListPage'].validate_dbus_object))03:02
veebersthe first time around it's fine, but after that it's calling something like: return (name == b'webbrowser-app' and . . .03:03
veebersthomi: fyi: http://paste.ubuntu.com/10365925/03:03
veebersthat's 2 calls to _try_custom_proxy_classes (the ?? note the different calls) for the path "......PageStack/PageWrapper/ContactListPage"03:04
thomithis is *exactly* what I'd expect to happen when multiple inheritance is used03:04
thomiveebers: can you check the content of __bases__ in each case?03:05
veebersthomi: in a good or bad way? I'm not sure where the webapp stuff is coming from as this is the addressbook app tests and CPOs03:05
thomiI bet __bases__ will reveal all :D03:05
veebersthomi: hmm, yeah sure. Give me a couple of minutes to hack that up and get details03:05
veebersthomi: also, if you're EOD we can pick this up tomorrow if you like03:06
thomiI'll be on for a bit longer03:06
veebersgah, now it's refusing to work at all :-| Sorry, just a couple more minutes :-)03:10
veebersthomi: looks like you were right :-) http://paste.ubuntu.com/10366010/03:12
veeberss for source, b for bases, 3 calls there in the log03:12
thomiare you really surprised? :P03:12
veebersnope03:13
thomiso, someone's messing up __bases__ causing your MRO to go haywire03:13
thomithere's only like 2-3 places where that can happen03:13
thomiso I don't think it'll be hard to find03:13
thomiI suspect that new code that gets the bases is to blame03:13
veebersthomi: the new code being the stuff that I added today?03:14
thomiveebers: if not that, then in the same general vicinity, yeah03:14
thomibut I didn't mean to disparage your code :P03:14
veebersthomi: the order of __bases__ matters right, that's what the MRO is?03:14
thomiveebers: the order matters, yeah03:15
thomithe MRO is more than that though03:15
thomithe rules are somewhat non-trivial03:15
veebersthomi: heh, I didn't see any disparaging there03:15
thomibut for our purposes, the CPO-parent should be first03:15
veebersok, so I need to do more than just set union the 2 bases ther03:15
thomieverything else (mixin classes) later03:15
thomiwell...03:15
veebersyeah, that's what I had in mind. I'll hack around on that03:15
thomiyou probably won't have any problems, but ideally, yeah03:16
veebersthomi: sweet, I'll work on that now. Thanks for the help :-)03:17
thomino worries03:17
thomiI think tomorrow I'll withdraw myself from qa-related IRC channels BTW03:18
veebersthomi: ah ok, it won't stop me bothering you for help though ;-)03:18
thomiheh03:19
=== vrruiz_ is now known as rvr

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