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.
BranchMergeProp osalJobSource. iterReady( ) calls checkReady(), and catches
exceptions that the job isn't ready and waits.
UpdatePreviewDi ffJob.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: ffNotReady(
'The source branch has no revisions.') branch. last_scanned_ id is None: ffNotReady(
'The target branch has no revisions.') branch. pending_ writes: ffNotReady(
'The source branch has pending writes.')
raise UpdatePreviewDi
if bmp.target_
raise UpdatePreviewDi
if bmp.source_
raise UpdatePreviewDi
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