Unable to create a bug subscription for a team I manage

Asked by Brian Murray

I'd like to subscribe the Canonical Ubuntu QA team to all Ubuntu bug reports tagged iso-testing so I went to https://bugs.launchpad.net/ubuntu and clicked on "Subscribe to bug mail". However, the pop up dialog only lists team names after "kubuntu-dev", but if I visit https://bugs.launchpad.net/ubuntu/+subscribe I then see many more team names.

I also thought I just try subscribing the team to all Ubuntu bug reports via the +subscribe url and modify the subscription using https://bugs.launchpad.net/~canonical-ubuntu-qa/+structural-subscriptions but subscribing the team resulted in OOPS-51bf6cb1722b04182c19157367355113.

I looked at the API for Launchpad and adding a structural subscription with filtering is sufficiently complicated that I gave up and asked a question instead.

I really just want the subscription created and I'm not personally concerned about all the teams I administer appearing in the pop-up dialog.

Question information

Revision history for this message
Jürgen Gmach (jugmac00) said :
#2

Hi Brian,

I am struggling to find a way in the GUI to add a tag based filter for bug subscriptions. Reading the source code, I think this should be at least possible via the API.

> so I went to https://bugs.launchpad.net/ubuntu and clicked on "Subscribe to bug mail". However, the pop up dialog only lists team names after "kubuntu-dev"

I cannot reproduce this. When I go to the above link and click on the "Subscribe to bug mail" link, I do not see any teams, but that subscription dialogue is only for myself.

The oops is caused by

```
lp.registry.errors.UserCannotSubscribePerson: brian-murray does not have permission to subscribe canonical-ubuntu-qa
```
which sounds odd, as you are the admin of the `canonical-ubuntu-qa` team.

Looking a bit deeper, I found this check:

```
    def userCanAlterBugSubscription(self, subscriber, subscribed_by):
        """See `IStructuralSubscriptionTarget`."""

        admins = getUtility(ILaunchpadCelebrities).admin
        # If the object to be structurally subscribed to for bug
        # notifications is a distribution and that distribution has a
        # bug supervisor then only the bug supervisor or a member of
        # that team or, of course, admins, can subscribe someone to it.
        if IDistribution.providedBy(self) and self.bug_supervisor is not None:
            if subscriber is None or subscribed_by is None:
                return False
            elif (
                subscriber != self.bug_supervisor
                and not subscriber.inTeam(self.bug_supervisor)
                and not subscribed_by.inTeam(admins)
            ):
                return False
        return True
```

`subscriber` is the the team to be subscribed, ie `canonical-ubuntu-qa`, and `subscribed_by` is `brian-muray`. `bug_supervisor` for Ubuntu should be `~ubuntu-bugcontrol`.

So any check in the `elif` branch would cause the issue, but I do not see which one.

I am afraid I cannot debug further right now, and I will be on conference leave from tomorrow on. I will ask my team for support.

Revision history for this message
Colin Watson (cjwatson) said :
#3

This is evidently a rarely-hit piece of code, but it feels as though maybe the two mentions of `subscriber` in that `elif` branch logically ought to be `subscribed_by` instead? It would make more sense for that code to check the person who's creating the subscription rather than the new subscriber.

Revision history for this message
Guruprasad (lgp171188) said :
#6

Updated the status to Open, undoing vandalism

Revision history for this message
Guruprasad (lgp171188) said (last edit ):
#11

Hi Brian,

I have now deployed the fix for this issue (coincidentally, the lines that I had to change were written by you many years ago when you worked on Launchpad :) ). Can you retry doing this and let us know if you are able to add this subscription now?

Revision history for this message
Brian Murray (brian-murray) said :
#12

In the web UI the behavior is the same and I still see "kubuntu-dev" as the first team which I administer.

Revision history for this message
Brian Murray (brian-murray) said (last edit ):
#13

I was able to use the alternate process I'd identified earlier i.e. "I also thought I just try subscribing the team to all Ubuntu bug reports via the +subscribe url and modify the subscription using https://bugs.launchpad.net/~canonical-ubuntu-qa/+structural-subscriptions". However, after editing the bug filter I was redirected to my personal (~brian-murray/+structural-subscriptions) page.

Revision history for this message
Guruprasad (lgp171188) said :
#14

Hi Brian, I am sorry that you faced issues with this even after we deployed a fix. Can I get some time after the year-end holidays to have a quick meeting with you to investigate/debug this further?

Can you help with this problem?

Provide an answer of your own, or ask Brian Murray for more information if necessary.

To post a message you must log in.