gitlab-ci-pipelines-exporter icon indicating copy to clipboard operation
gitlab-ci-pipelines-exporter copied to clipboard

Handle specific ref name during api calls for mr pipelines from project with merge results/trains enabled

Open tidalf opened this issue 2 years ago • 4 comments

This fixes this issue https://github.com/mvisonneau/gitlab-ci-pipelines-exporter/issues/280 for our setup.

Not sure it's fine as is, or if it'd be better to try to retrieve the settings of the project.

tidalf avatar Jun 29 '23 19:06 tidalf

@mvisonneau any chance for this to be merged? 🙏 I have the same problem, latest gcpe image can't find MR pipeline for the repo with merge trains enabled. Works fine for repos without merge trains.

Art3mK avatar Oct 30 '23 12:10 Art3mK

Yes ! Would be lovely if @mvisonneau can have a look :)

kalw avatar Nov 10 '23 14:11 kalw

I've just been battling with this issue for quite a while and stumbled into this PR. So this proposal would work for all MRs that have at least 1 regular MR pipeline and 1 MR results pipeline. There's a regex which filters the discovered refs before execution ever reaches the changes in this proposal. Here it is: https://github.com/mvisonneau/gitlab-ci-pipelines-exporter/blob/0687efd1075d33283c3762a135aa24de94ffe21c/pkg/schemas/ref.go#L13

This means that only MR refs with /head (regular MR pipelines) are considered. Meaning that if you have enabled MR result pipelines, all the refs will be /merge (with the exception of when there are conflicts, as stated in gitlab docs, search for "conflict").

Here's a git patch in another thread that works for us. This one ensures that both the regular MR pipelines and MR results pipelines are gathered and exported: https://github.com/mvisonneau/gitlab-ci-pipelines-exporter/issues/534#issuecomment-1870465381

mj3c avatar Dec 27 '23 16:12 mj3c