Delete milestone will fail if private bugs are targeted.

Bug #462036 reported by Curtis Hovey on 2009-10-27
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
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

Curtis Hovey (sinzui) wrote :

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

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) on 2010-02-03
tags: added: oops
Curtis Hovey (sinzui) wrote :

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

Curtis Hovey (sinzui) on 2010-05-14
Changed in launchpad-registry:
milestone: none → 10.05
status: Triaged → In Progress
Curtis Hovey (sinzui) on 2010-05-14
Changed in launchpad-registry:
assignee: nobody → Curtis Hovey (sinzui)
Curtis Hovey (sinzui) on 2010-05-18
Changed in launchpad-registry:
status: In Progress → Fix Committed
Curtis Hovey (sinzui) on 2010-05-19
tags: added: qa-ok
removed: qa-needstesting
Curtis Hovey (sinzui) on 2010-06-02
Changed in launchpad-registry:
status: Fix Committed → Fix Released
Curtis Hovey (sinzui) on 2017-05-15
Changed in launchpad:
assignee: Curtis Hovey (sinzui) → nobody
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers