Diff_refs empty after MR is created

Hi, since few days our CI automation which relies on gitlab.com events hook and API calls is experiencing issues with the merge_requests endpoint.

As soon as a MR is created, we receive an event from gitlab.com then our automation query the API to get more details about the MR via the api/v4/projects/<:repo:>/merge_requests/<:id:>. Then the automation expects to find the diff_refs object with relevant data.

However since few days the diff_refs attribute is reported as None by the python JSON decoder.

{ā€¦, ā€˜latest_build_finished_atā€™: None, ā€˜first_deployed_to_production_atā€™: None, ā€˜pipelineā€™: None, ā€˜head_pipelineā€™: None, ā€˜diff_refsā€™: None, ā€˜merge_errorā€™: None, ā€˜first_contributionā€™: False, ā€˜userā€™: {ā€˜can_mergeā€™: True}}

We discovered that adding some delay after we received the ā€œmerge requested created eventā€ (few seconds) then the diff_refs becomes an object with the expected base_sha, head_sha and start_sha attributes.

So my questions are:

  • did any changes happen on gitlab.com that added or increased the delay for the diff_refs attribute to be available and correctly set ?
  • should we expect a delay and update our automation to keep retry fetching the MR details via the API until the diff_refs attribute is available ?

Thanks for your help
Fabien

Fabien,

Iā€™m seeing the same issue where diff_refs comes back as nil or empty, even when it shouldnā€™t. I donā€™t know for sure when it started, but I went on vacation and it was present, and I came back and it was gone! Itā€™s possible itā€™s a new bug that was released, since the documentation still makes it seem like those values should be present (Merge requests API | GitLab). If you and others agree itā€™s a new bug, please make an issue on GitLab.

Thanks for the input @emmasax4 Iā€™ve opened an issue diff_refs empty after MR is created (#386562) Ā· Issues Ā· GitLab.org / GitLab Ā· GitLab