Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetch pipelines by merge request instead of branch #212

Merged
merged 1 commit into from
Jun 17, 2019
Merged

Conversation

JaimeLennox
Copy link
Contributor

... 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

... if possible.

Since we operate on merge requests this makes more sense, but the
feature was only available from version 10.5.

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.
@b1rdex
Copy link

b1rdex commented Jul 31, 2019

This causes an error if ci is configured to run different tasks both on the branch and the merge request.

I have tests and all other things configured to be run on the branches because such tasks don't need a merge request to be run. Also, I have one task configured to be run on merge requests — it is used to toggle merge request settings (enable squash). So now Marge thinks that this simple task is my tests and merges even if actual tests are running and not finished yet.

Looks like that's because current_pipeline = next(iter(pipeline for pipeline in pipelines if pipeline.sha == commit_sha), None) line — Marge takes just one pipeline in accordance.

@b1rdex
Copy link

b1rdex commented Jul 31, 2019

Could we please make this behavior switchable through the config file?

@b1rdex
Copy link

b1rdex commented Aug 15, 2019

Extracted issue from comments to #227.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GitLab pipeline API change: detached pipeline refs changed - Marge fails to detect pipeline
3 participants