Fetch pipelines by merge request instead of branch #212
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
... if possible.
Since we operate on merge requests this makes more sense, but the feature was only available from version 10.5.
It allows us to fetch all pipelines for a particular merge request, including detached ones, which would otherwise not be fetched due to a different
ref
format.An annoyance of this route is that it doesn't allow ordering or sorting, which we use to determine the latest pipeline by. However it's very simple to just do this ourselves; the only downside is this is no longer
customizable, but nothing in the codebase appears to use this feature anyway.
The batch job tries cancel pipelines by their status, which we can't filter by for this route (unless we do it manually as well) so I've left that using the old method. This can mean some detached pipelines may
continue running after a batch job has completed, but this seems like a very minor issue.
Fixes: #185