openshift-pipelines/pipelines-as-code

Pipelines as Code don't report pipeline results on GitLab Merge Requests anymore

Closed this issue ยท 1 comments

Bibz87 commented

PaC used to report pipeline successes/failures in my GitLab Merge Requests but it doesn't do that anymore. I can't see any errors in the logs and the GitLab access token has the right permissions to create merge request notes. It used to work fine a month ago; around August 3rd, 2023.

From what I could find, the GitLab provider uses the X-Gitlab-Event header to detect which type of event it is processing and checks for pull_request or Merge_Request before sending a status update (the exact line in the code is located here). However, it looks like X-Gitlab-Event has a value of Merge Request Hook and changing the check to look for Merge Request (with a space instead of an underscore) seems to fix the issue. I have no clue if this can cause other side-effects or breaking changes with older GitLab instances.

I updated to GitLab 16.2.3 on August 4th but besides that I was unable to properly identify why the feature was working fine before or why it's broken now. Right now I'm using PaC 0.20.0 but as the containers have their imagePullPolicy set to Always, it is hard to determine what exact version I was using before the problem appeared.

As a side-effect, changing Merge_Request to Merge Request made PaC write a Merge Request comment (Starting Pipelinerun [...] in namespace [...]) whenever a pipeline is started. I've never seen that before and I think it's a nice feature! ๐Ÿ˜„

As a side-effect, changing Merge_Request to Merge Request made PaC write a Merge Request comment (Starting Pipelinerun [...] in namespace [...]) whenever a pipeline is started. I've never seen that before and I think it's a nice feature! ๐Ÿ˜„

this should always have been the behaviour ๐Ÿ˜ž

we need to make our gitlab test more robust, but at least the reporting should work now!