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.
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 product. project_ group
upstream_ bug_tracker = project_ group.bug_ tracker
project_group = upstream_
if project_group is not None:
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.