RFR: 1687: Workaround bug in GitLab where merge request LIST API may serve stale data

Magnus Ihse Bursie ihse at openjdk.org
Thu Dec 1 16:43:57 UTC 2022

On Mon, 28 Nov 2022 21:43:24 GMT, Erik Joelsson <erikj at openjdk.org> wrote:

> This patch provides a workaround for a GitLab bug that we are currently encountering. The issue has been fixed upstream, but until we have it deployed in our instance, we need to work around it.
> GitLab sometimes serves stale data for merge requests from list queries. For Skara this means that label changes aren't always picked up. I have verified that up-to-date data is always received when fetching single merge requests by ID, so the patch simply re-fetches MRs to make sure the data is always up to date. I'm also adding logging to track when stale data is detected. This will help us verify (at least empirically) when the GitLab issue resolved for us.


forge/src/main/java/org/openjdk/skara/forge/gitlab/GitLabRepository.java line 201:

> 199:             var newData = request.get("merge_requests/" + id).execute();
> 200:             // We can't compare the full json object returned from a list query
> 201:             // and get query call as they will always be different. The part we

And you are sure the differences don't matter further down the processing chain?


Marked as reviewed by ihse (Reviewer).

PR: https://git.openjdk.org/skara/pull/1427

More information about the skara-dev mailing list