How to throttle pipelines?


We’re using Gitlab to push updates to branches running on AWS servers.
We use Boxfuse to push our Java application to AWS EC2 instances, and to set up a DNS domain name that essentially looks like (as an example, with internatltesting replaced with our internally accessible domain).

My question is on how to handle when multiple commits come in at the same or very close to the same time? If 2 or more commits come in at the same time, all but one will fail because a deployment is already in progress. This also leads to more confusion because QA checks the status of a pipeline associated with the commit for a bug fix, because commits for bug fixes always contain the issue # so they are linked in gitlab.

I could run it on a schedule and update the staging server every, let’s say 15 minutes but then it raises the following questions:

  1. If I have multiple commits referencing different issues, and they all get “batched” into one push to the staging environment every 15 minutes, will the pipeline tracking in the commit understand that all those commits went into one pipeline and have the correct status once that pipeline containing all the pushes is finished?

  2. I’d prefer not to continue pushing every 15min regardless of if there was a commit or not. In essence, I’d like to throttle a pipeline to run at most once per 15 minutes, but to not run if there were no commits.

Any insight is greatly appreciated.

@bdeveloper7 lots of interesting discussion around this in the Issues:

Are those discussions relevant to what you’re experiencing?