Bug creation does not respect bug sharing policy

Bug #1036185 reported by Curtis Hovey
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
High
William Grant

Bug Description

A bug's information type can be changed any other type, though the bug sharing policy does not permit it.

Related branches

William Grant (wgrant)
Changed in launchpad:
assignee: nobody → William Grant (wgrant)
status: Triaged → In Progress
Revision history for this message
Launchpad QA Bot (lpqabot) wrote :
tags: added: qa-needstesting
Changed in launchpad:
status: In Progress → Fix Committed
Curtis Hovey (sinzui)
tags: added: qa-ok
removed: qa-needstesting
Changed in launchpad:
status: Fix Committed → In Progress
Revision history for this message
Curtis Hovey (sinzui) wrote :

I don't think this is complete. The default bug creation rule are enforced, but the transition rules are not enforced.

For example I set bugs are proprietary only.
    https://qastaging.launchpad.net/lp-dev-utils/+sharing

I reported
    https://bugs.qastaging.launchpad.net/lp-dev-utils/+bug/939548

which was proprietary when It was created. The UI would not let me choose another type. I expected an error to be raised when I ran this API function:
def test_bug_sharing_policy():
    lp = Launchpad.login_with(
        'testing', service_root='https://api.qastaging.launchpad.net',
        version='devel')
    bug = lp.bugs['939548']
    bug.transitionToInformationType(
        information_type="Public")

But there was no error, when I refreshed the page, the bug was public, even though the policy says I will not permit it.

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

This is roughly what I think is missing.

class BugInformationTypeNotPermitted:
    """The information type is forbidden by the project's BugSharingPolicy."""

Bug.transitionToInformationType()
        if information_type not in self.getAllowedBugInformationTypes():
            raise BugSharingPolicyError()

^ Maybe we want to treat this as a separate bug because creation policy is correct, we just want to revise Bug.transitionToInformationType().

I also see we need to remove the from_api arg and drop the BugCannotBePrivate guard, because we do allow proprietary. I will report this as a separate bug.

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

I reported the Bug.transitionToInformationType() issue as Bug #1039631.

summary: - Bugs don't respect bug sharing policy
+ Bug creation does not respect bug sharing policy
Changed in launchpad:
status: In Progress → Fix Committed
Curtis Hovey (sinzui)
Changed in launchpad:
status: Fix Committed → Fix Released
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.