Handle Duo code review assignment timing issue on MR creation

Description

Raised in feedback issue: #517386 (comment 2347821895).

When adding GitLabDuo as a reviewer when creating an MR, for an existing branch with code changes, GitLabDuo will respond with "There's nothing for me to review." instead of reviewing the actual code changes. The review will only be done when we trigger a "re-review".

The Issue

MR created and GitLabDuo triggered. However, instead of reviewing the code changes. GitLabDuo stated "There's nothing for me to review."

How to replicate

  1. Create a new branch
  2. Make some code changes
  3. Create a new MR and add "/assign_reviewer @GitLabDuo" to the description

Possible solution

We should probably need to delay the execution of Duo code review until async diff creation gets finished. We may need to implement a retry logic for that.

Edited by François Rosé