Comment 7 for bug 642418

Revision history for this message
Bryce Harrington (bryce) wrote :

Here's the design we came up with:

For Bugzilla, when checkwatches does its bug updates, it checks if the watched bug is a dupe_of() something. As it runs across dupes, it stores in the launchpad database the fact that it's a duplicate, and what it's a duplicate of. A bugwatch is also created at this point for the newly found master bug, with its status/importance/etc. gathered.

In the BugWatch class, when the remotebug is requested, the code will note that the linked bugwatch is a dupe and switch it out for the master bug watch. So, in other words, internally we know what the original bug report was, but for all intents and purposes all users of remotebug will be looking only at the master bug.

The reason this approach is better than just changing out the bug link directly, is because sometimes bugs are duped incorrectly and later re-duped to other bugs, so this enables us to track and react to these changes. However, for all intents and purposes it LOOKS like we've changed the bug link.

In the UI, it'll be displaying just the master bug; no UI changes are needed here. (There is an open question about if users would want to be able to get to the original bug; we don't *think* they will, but if so then we'll need to figure out a UI for doing that.)

The LP API will also return the master bug the same way. We'll need to add a functionality to the API for getting the 'originalremotebug' or some such, in case scripts need to get to that.

In either the UI or API, if the remotebug is ever changed, both the original and master bugwatches are replaced by whatever the user specifies as the new watch.

We're looking at probably four branches for this feature:

 1. db patch to track dupe_of
 2. checkwatches capture dupe_of & create bugwatch
 3. make bugwatch switcharoo bugwatches
 4. update the api to switcharoo too & extra call to get original

As this is a non-trivial amount of work and I've already got plenty of irons in the fire on another project, I'm going to focus on that project. I may or may not have time to work on this after that project's done; if not someone else can pick this work up.