DBus wire protocol changes required
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Autopilot |
Fix Released
|
High
|
Christopher Lee | |||
Autopilot Qt Support |
Fix Released
|
High
|
Unassigned | |||
XPathSelect |
Fix Released
|
High
|
Unassigned | |||
autopilot-gtk |
Fix Released
|
High
|
Unassigned | |||
autopilot (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | |||
Raring |
Won't Fix
|
Undecided
|
Unassigned | |||
autopilot-gtk (Ubuntu) | ||||||
Raring |
Won't Fix
|
Undecided
|
Unassigned | |||
autopilot-qt (Ubuntu) | ||||||
Raring |
Won't Fix
|
Undecided
|
Unassigned | |||
xpathselect (Ubuntu) | ||||||
Raring |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
We need to change the DBus wire protocol autopilot uses. This is an implementation detail that's hidden from test authors, but we need to make sure we do this in a way that doesn't break things. Read on for a small novel on why we need to make this change.
Unique Objects
=============
Currently autopilot makes the assumption that the combination of type name and object id are enough to uniquely identify any object in the object tree. That is, "Foo[id=123]" will only ever refer to any one object. In fact, in most cases the id alone would be enough. This has worked fine, to a point. However, as we move forwards, several cracks have started appearing:
1) Relative queries are expensive. Some methods, like 'FooClass.
# Fast - aboslute query
/foo
# also fast:
/foo/bar[
# select a 'frob' somewhere under /foo/bar/baz
/foo/bar/baz//frob
# this ^^ is slow, but we expect it to be slow, so that's OK.
The problem is here:
/foo/bar/
This is very very slow, since the 'frob' object doesn't know it's full path, so it cannot use absolute queries on any of it's children. This makes sub-tree searching slow not only once (for the search call), but also slow for all subsequent method calls on the returned object.
Current State of Play
=================
Currently the DBus wire protocol is to return a list (possibly empty, if there were no results) of tuples, one tuple for each object.
Each tuple has exactly two components:
* The object name (e.g.- 'FooClass').
* A state dictionary
A solution:
=========
A simple solution is to change autopilot, autopilot-qt and autopilot-gtk to return full paths for every object in the search results.
So instead of return [("FooClass", {...})] we'd return [("/foo/
This path information gets used on the autopilot side.
Impact
======
This has some impact however:
* It means the '/' character cannot be used in an object type name. I don't think this will be a problem.
* It means we need to make sure autopilot is backwards compatible with older protocol versions. Currently the AP code to retrieve data over DBus is tightly coupled with the objects themselves. I'd need to separate this, and provide a backwards compatibility wrapper.
This bug is a place to track the overall work required for the separate projects. I suggest we hold off changing autopilot-qt or autopilot-gtk until the autopilot code has landed (with backwards compatibility code).
Related branches
- Thomi Richards (community): Approve
- PS Jenkins bot: Approve (continuous-integration)
- Michael Zanetti (community): Needs Fixing
-
Diff: 233 lines (+43/-23)7 files modifieddebian/changelog (+6/-0)
debian/control (+2/-2)
driver/qtnode.cpp (+13/-7)
driver/qtnode.h (+3/-1)
driver/rootnode.cpp (+8/-3)
driver/rootnode.h (+1/-0)
tests/unittests/tst_introspection.cpp (+10/-10)
- Michael Terry (community): Approve
- PS Jenkins bot: Approve (continuous-integration)
-
Diff: 78 lines (+17/-3)5 files modifiedCMakeLists.txt (+1/-1)
debian/changelog (+6/-0)
debian/control (+2/-2)
lib/node.h (+3/-0)
test/dummynode.h (+5/-0)
- PS Jenkins bot: Approve (continuous-integration)
- Thomi Richards (community): Approve
- Łukasz Zemczak: Approve
-
Diff: 182 lines (+34/-12)8 files modifieddebian/changelog (+6/-0)
debian/control (+1/-1)
debian/source/format (+1/-1)
lib/GtkNode.cpp (+12/-3)
lib/GtkNode.h (+3/-1)
lib/GtkRootNode.cpp (+7/-3)
lib/GtkRootNode.h (+1/-0)
lib/Introspection.cpp (+3/-3)
- Thomi Richards (community): Approve
- PS Jenkins bot: Approve (continuous-integration)
-
Diff: 148 lines (+21/-33)3 files modifiedautopilot/introspection/__init__.py (+3/-1)
autopilot/introspection/dbus.py (+16/-30)
debian/control (+2/-2)
Changed in autopilot: | |
assignee: | nobody → Thomi Richards (thomir) |
Changed in autopilot: | |
milestone: | none → 1.3 |
Changed in autopilot-qt: | |
status: | New → Triaged |
Changed in xpathselect: | |
status: | New → Triaged |
Changed in autopilot-gtk: | |
status: | New → Triaged |
Changed in autopilot-qt: | |
importance: | Undecided → High |
Changed in xpathselect: | |
importance: | Undecided → High |
Changed in autopilot-gtk: | |
importance: | Undecided → High |
Changed in autopilot-qt: | |
assignee: | nobody → Thomi Richards (thomir) |
Changed in xpathselect: | |
assignee: | nobody → Thomi Richards (thomir) |
Changed in autopilot-gtk: | |
assignee: | nobody → Thomi Richards (thomir) |
Changed in autopilot-qt: | |
status: | Triaged → In Progress |
Changed in autopilot-gtk: | |
status: | Triaged → In Progress |
Changed in autopilot: | |
status: | Confirmed → In Progress |
assignee: | Thomi Richards (thomir) → Christopher Lee (veebers) |
Changed in xpathselect: | |
milestone: | none → 1.3 |
Changed in autopilot: | |
status: | Fix Committed → Fix Released |
Changed in autopilot-qt: | |
status: | Fix Committed → Fix Released |
Changed in xpathselect: | |
status: | Fix Committed → Fix Released |
Changed in autopilot-gtk: | |
status: | Fix Committed → Fix Released |
Fix committed into lp:xpathselect at revision 32, scheduled for release in xpathselect, milestone Unknown