Comment 2 for bug 612171

Revision history for this message
James Westby (james-w) wrote : Re: [Bug 612171] Re: Error generating merge proposal diff when "source branch has pending writes"

BranchMergeProposalJobSource.iterReady() calls checkReady(), and catches
exceptions that the job isn't ready and waits.

UpdatePreviewDiffJob.run() calls checkReady() but lets the exception
bubble up, which ends up sending an email.

If the state of the branch changes between the two events then this
behaviour will happen.

I think run() needs a way to signal that the job should be deferred for some
time to handle this.

There are other issues too, such as the email not having much
information.

The cases that the user would be mailed about would be:

        if bmp.source_branch.last_scanned_id is None:
            raise UpdatePreviewDiffNotReady(
                'The source branch has no revisions.')
        if bmp.target_branch.last_scanned_id is None:
            raise UpdatePreviewDiffNotReady(
                'The target branch has no revisions.')
        if bmp.source_branch.pending_writes:
            raise UpdatePreviewDiffNotReady(
                'The source branch has pending writes.')

where I'm not sure any of them are useful.

The first two should give an empty diff on the merge proposal or
something. The latter should just delay, and then oops if it has been
delayed multiple times, as there is something wrong.

Thanks,

James