OOPS on BadStateTransition when reviewing code by mail

Bug #326056 reported by Paul Hummer
4
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
High
Aaron Bentley

Bug Description

This is a weird edge case, but one that I think is worth filing a bug for.

So I did a code review for Entertainer and sent it, then immediately merged the branch into trunk and pushed up to launchpad. The scanner apparently marked the BMP as merged before my review with ' status approved' could get handled. This resulted in this oops: OOPS-1133CEMAIL5

If nothing else, maybe we should just catch the exception and silently pass an changing the status if it's in a state that doesn't make sense to go "back" to approved for (like non-final states).

Recently: OOPS-1138CEMAIL12, OOPS-1192CEMAIL4

Paul Hummer (rockstar)
Changed in launchpad-bazaar:
importance: Undecided → Low
status: New → Triaged
Revision history for this message
Aaron Bentley (abentley) wrote : Re: [Bug 326056] [NEW] OOPS on InvalidStateTransition when reviewing code by mail

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Paul Hummer wrote:
> So I did a code review for Entertainer and sent it, then immediately
> merged the branch into trunk and pushed up to launchpad. The scanner
> apparently marked the BMP as merged before my review with ' status
> approved' could get handled. This resulted in this oops:
> https://devpad.canonical.com/~matsubara/oops.cgi/2009-02-06/CEMAIL5

It's possible for something to be merged that is not approved, and it's
possible for something to be approved that isn't merged. So I think
that our model is slightly wrong. The ideal model would have two status
flags:

code review status: inactive, pending, approved, disapproved
merge status: inactive, queued, merged

If our model reflected this, then setting the review status to approved
would not change the merge status, and we could not get errors like this.

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkmMWt0ACgkQ0F+nu1YWqI22EACfad+Ksy0foLEJTuLVcFa+L2BP
ULYAn0GNmRB3Ru6JnJ78bJ99Mg+HR69L
=itMw
-----END PGP SIGNATURE-----

Revision history for this message
Tim Penhey (thumper) wrote : Re: [Bug 326056] [NEW] OOPS on InvalidStateTransition when reviewingcode bymail

On Sat, 07 Feb 2009 04:44:44 Aaron Bentley wrote:
> Paul Hummer wrote:
> > So I did a code review for Entertainer and sent it, then immediately
> > merged the branch into trunk and pushed up to launchpad. The scanner
> > apparently marked the BMP as merged before my review with ' status
> > approved' could get handled. This resulted in this oops:
> > https://devpad.canonical.com/~matsubara/oops.cgi/2009-02-06/CEMAIL5
>
> It's possible for something to be merged that is not approved, and it's
> possible for something to be approved that isn't merged. So I think
> that our model is slightly wrong. The ideal model would have two status
> flags:
>
> code review status: inactive, pending, approved, disapproved

s/disapproved/rejected/ :)

> merge status: inactive, queued, merged

Would we still want to somehow record merge_failed? As in we tried to merge
but failed due to either conflicts or test failures.

> If our model reflected this, then setting the review status to approved
> would not change the merge status, and we could not get errors like this.

Now that's a damn fine idea.

Revision history for this message
Aaron Bentley (abentley) wrote : Re: [Bug 326056] [NEW] OOPS on InvalidStateTransition when reviewingcode bymail

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Tim Penhey wrote:
> On Sat, 07 Feb 2009 04:44:44 Aaron Bentley wrote:
>> Paul Hummer wrote:
>>> So I did a code review for Entertainer and sent it, then immediately
>>> merged the branch into trunk and pushed up to launchpad. The scanner
>>> apparently marked the BMP as merged before my review with ' status
>>> approved' could get handled. This resulted in this oops:
>>> https://devpad.canonical.com/~matsubara/oops.cgi/2009-02-06/CEMAIL5
>> It's possible for something to be merged that is not approved, and it's
>> possible for something to be approved that isn't merged. So I think
>> that our model is slightly wrong. The ideal model would have two status
>> flags:
>>
>> code review status: inactive, pending, approved, disapproved
>
> s/disapproved/rejected/ :)
>
>> merge status: inactive, queued, merged
>
> Would we still want to somehow record merge_failed? As in we tried to merge
> but failed due to either conflicts or test failures.

I think that would make a lot of sense, because someone has to fix that
branch and re-queue it. We'd want to flag it specially in the UI.

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkmQMaQACgkQ0F+nu1YWqI2EswCggs+4m6OFs6Qz1d+ZYqlmv0ky
AKgAn2bKkSZkPmEFcRvHBjUihaeKxEiO
=r2QM
-----END PGP SIGNATURE-----

Revision history for this message
Monty Taylor (mordred) wrote : Re: OOPS on InvalidStateTransition when reviewing code by mail

I just hit this, and it seems like it might be slightly more common than just an edge case. In particular, it seems to take several minutes from the time I send an email and it winds its way through all of the various servers involved until launchpad processes it.

On the other hand, it's quite possible for me to push a merged revision in less time than it takes for the email to work - so there's a race condition where I approve email, commit, push, email arrives.

Also, honestly, if the merge request is auto-marked approved because it's been merged, and then the merge approval comes in, I think I'd rather see the message get added than an error thrown, given that the two intended states do not conflict.

My €0.02

Revision history for this message
Monty Taylor (mordred) wrote :

And at the very least... an email response saying "Oh hai! Ur branchiz can haz already merged" would be nice.

Revision history for this message
Jonathan Lange (jml) wrote :

It's telling users they've screwed up when they haven't and generating OOPSes. This is enough to make it a high priority bug.

Surely we can come up with something that will stop the errors without requiring substantial changes to our data model!

Changed in launchpad-bazaar:
importance: Low → High
description: updated
description: updated
Ursula Junque (ursinha)
description: updated
Aaron Bentley (abentley)
Changed in launchpad-code:
assignee: nobody → Aaron Bentley (abentley)
status: Triaged → Fix Committed
Aaron Bentley (abentley)
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.