webhooks triggered before API calls can succeed

Summary

Our service is consuming the Gitlab Webhooks for pipelines. After we receive the webhook, we use the pipeline-id to make a call against the GitLab Pipeline API to get additional informations. From time to time it happens that the API does not return a valid pipeline. It turns out that, if we wait for some seconds after the webhook has been received, a valid response return in such cases. Therefor it seem that the Webhook fires events for pipelines that are not accessible by API yet.

Steps to reproduce

This is very hard, since this seems to be an timing-issue. I have observed this from multiple times a day to at least once a week.

Probably you need a loop that triggers pipelines, a hook that receives them and calls the API for that specific pipeline. You'll probably get an error eventually.

What is the current bug behavior?

Not getting a valid pipeline response for https://gitlab.com/api/v4/projects/${projectId}/pipelines/${pipelineId} after I have received a pipeline webhook for that specific pipelineId.

What is the expected correct behavior?

Return a valid pipeline response when requested after an webhook has been received.

Output of checks

This bug happens on GitLab.com

Edited Jul 01, 2019 by Daniel Galán y Martins
Assignee Loading
Time tracking Loading