Skip to content

Add async option to merge request pipeline create API

What does this MR do and why?

This is related to #463355 as this endpoint often times out. Allowing it to be created asynchronously will mean that we can create pipelines that take longer than 60s to create.

From my local testing this change has almost no UX impact on the merge requests pipeline page. That is because we are already polling for new pipelines constantly so having it created async shouldn't really matter to the user. I even tested the scenario where the pipeline config is broken and both provide a similar UX before and after. The only real difference is that you might have to wait slightly longer for the polling interval to see the new pipeline when you create it async.

There are more ideas in #463355 about how we might like to stream/poll from some endpoint to know if the specific pipeline I just tried to create failed or not. From a UX perspective this only seems relevant to timeouts today as it seems these are the ones where a user gets a flash notice of the failure. But the async process basically makes the timeouts go away so it is less relevant. In any case this is behind a feature flag and it will make me and other GitLab maintainers much more productive right now as we often cannot even start a pipeline and we're wasting a lot of resources trying and timing out constantly.

In future, if we need, we can update this API to return an identifier related to the async pipeline you created and then we can add a new endpoint to see whether or not your request succeeded. This could be done by streaming or polling and we could either use ActionCable subscriptions to notify the clients or we could store these recent jobs in redis with a short timeout if that's simpler than a whole new GraphQL endpoint.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After
With good pipeline before after
With broken pipeline config before-broken-pipeline after-broken-pipeline

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

Related to #463355

Edited by Dylan Griffith

Merge request reports