OOPS creating duplicate merge proposal using API

Bug #520446 reported by Diogo Matsubara
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
High
Paul Hummer

Bug Description

As seen on OOPS-1488EA174 a BranchMergeProposalExists exception was raised while creating a "duplicate" merge proposal using the API

Steps to reproduce, assuming you already have a lp object:

In [1]: x = lp.branches.getByUrl(url='lp://staging/~launchpad-pqm/oops-tools/trunk')
In [2]: y = lp.branches.getByUrl(url='lp://staging/~matsubara/oops-tools/signature-with-pageid')
In [3]: matsubara = lp.people['matsubara']
In [4]: y.createMergeProposal(initial_comment='foo', needs_review=True, review_types="", reviewers=matsubara, target_branch=x)
Out[4]: <branch_merge_proposal at https://api.staging.launchpad.net/beta/~matsubara/oops-tools/signature-with-pageid/+merge/17444>
In [5]: y.createMergeProposal(initial_comment='foo', needs_review=True, review_types="", reviewers=matsubara, target_branch=x)
HTTPError: HTTP Error 500: Internal Server Error
There is already a branch merge proposal registered for branch lp://staging/~matsubara/oops-tools/signature-with-pageid to land on lp://staging/~launchpad-pqm/oops-tools/trunk that is still active.

Related branches

Revision history for this message
Diogo Matsubara (matsubara) wrote :

I haven't tried but this might be triggerable via web ui as well.

Revision history for this message
Tim Penhey (thumper) wrote :

Diogo, do you know what the expected failure mode is?

Changed in launchpad-code:
status: New → Triaged
importance: Undecided → High
Revision history for this message
Diogo Matsubara (matsubara) wrote :

Tim, I don't know exactly what the expected failure mode is, but I think it should be similar to when you try to use a bugtask transitiontoStatus() call with a wrong parameter. For example:

In [29]: bt.transitionToStatus(status='foo')
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)

ValueError: Invalid value 'foo' for parameter 'status': valid values are: "New", "Incomplete", "Invalid", "Won't Fix", "Confirmed", "Triaged", "In Progress", "Fix Committed", "Fix Released", "Unknown"

You get an exception but no OOPS is recorded. The exception message makes it clear why you're getting the error. Does that help?

Revision history for this message
Tim Penhey (thumper) wrote :

Yeah.

Tim Penhey (thumper)
tags: added: trivial
Paul Hummer (rockstar)
Changed in launchpad-code:
status: Triaged → In Progress
assignee: nobody → Paul Hummer (rockstar)
milestone: none → 10.03
Revision history for this message
Ursula Junque (ursinha) wrote : Bug fixed by a commit
Changed in launchpad-code:
status: In Progress → Fix Committed
tags: added: qa-needstesting
Paul Hummer (rockstar)
tags: added: qa-ok
removed: qa-needstesting
Paul Hummer (rockstar)
Changed in launchpad-code:
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.