Delete milestone will fail if private bugs are targeted.

Bug #462036 reported by Curtis Hovey
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
Low
Unassigned

Bug Description

While testing on staging this error was seen
    Retry: update or delete on table "milestone" violates foreign key constraint "bugtask__product__milestone__fk" on table "bugtask"
    DETAIL: Key (product,id)=(190,14857) is still referenced from table "bugtask"

When comparing the list of bugtasks between the milestone +index and milestone +delete, the private bugs were not listed on later.

This has never been seen in production because private bugs were not involved, and will rarely be involved since milestone deletion happens with mistaken (experimental) milestones rather than the genuine (production) milestones that was used on the staging test.

The RegistryDeleteViewMixin._getBugtasks() could use the principal of the current interaction, but that will not prevent this error from occurring if the owner or release manager does not have permission to see the bug. The correct fix must retrieve all bugtasks regardless of privacy. Private bugs that the user can see should be shown in the list. Those that cannot be seen will be silently untargeted. This implies that the untarget operation needs special access to get the list of bugtasks and need to use removeSecurityProxy to untarget the milestones. The user does not need to know that this happened.

This is not a high priority until this really happens.

Related branches

Revision history for this message
Curtis Hovey (sinzui) wrote :

Oops OOPS-1494F1826 shows that that can be experienced.

Revision history for this message
Curtis Hovey (sinzui) wrote :

Hi mike. I see in the oops reports that tried to delete a milestone, but it failed. I think it failed because there was a private bug targeted. Did you rename the milestone or move the bug to another milestone to solve the problem?

Ursula Junque (ursinha)
tags: added: oops
Revision history for this message
Curtis Hovey (sinzui) wrote :

OOPS-1587EA377 happened recently. The user fixed remvoed the bug then completed the delete,

Curtis Hovey (sinzui)
Changed in launchpad-registry:
milestone: none → 10.05
status: Triaged → In Progress
Curtis Hovey (sinzui)
Changed in launchpad-registry:
assignee: nobody → Curtis Hovey (sinzui)
Curtis Hovey (sinzui)
Changed in launchpad-registry:
status: In Progress → Fix Committed
Revision history for this message
Ursula Junque (ursinha) wrote : Bug fixed by a commit
tags: added: qa-needstesting
Curtis Hovey (sinzui)
tags: added: qa-ok
removed: qa-needstesting
Curtis Hovey (sinzui)
Changed in launchpad-registry:
status: Fix Committed → Fix Released
Curtis Hovey (sinzui)
Changed in launchpad:
assignee: Curtis Hovey (sinzui) → nobody
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.