Comment 4 for bug 829074

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

Yes, it's quite cumbersome. I coded up basically what you describe using launchpadlib calls, but it's pretty slow.

It's in python-launchpadlib-toolkit in a upstream_bug_tracker() routine; pseudocode:

lp_bug_task = {Given}

upstream_product = lp_bug_task.target.upstream_product
if upstream_product is None, then give up

upstream_bug_tracker = upstream_product.bug_tracker

If upstream_bug_tracker is None, then
    project_group = upstream_product.project_group
    if project_group is not None:
        upstream_bug_tracker = project_group.bug_tracker

Now you just check if there's any bug watches against this bug tracker; if so, it's been officially upstreamed; if not, it hasn't.

I imagine the database logic to do this lookup could be more efficient. I'm also sure I've missed some corner case or other. But in my testing it does work, and produces more accurate data than Launchpad's search.