Uploaded image for project: 'OpenShift Pipelines'
  1. OpenShift Pipelines
  2. SRVKP-9442

PaC creates GitLab MR comments even when commit status update fails for non-permission errors

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • None
    • Pipelines as Code
    • None
    • 2

      Description of problem:

      When using Pipelines-as-Code (PaC) with GitLab, PaC attempts to create or update the commit status on the target project. If this operation fails, PaC incorrectly assumes the failure is due to permissions (e.g., missing access token rights). As a result, PaC posts a comment on the Merge Request indicating that the pipeline run has started, even though the commit status update may have failed for other reasons.

      We observed the following behavior:

      • GitLab returns errors such as:
        • 400 {message: Cannot transition status via :run from :running}
      • PaC does not differentiate between permission errors (401/403) and other technical errors (e.g., 400 transition errors).
      • In all failure cases, PaC proceeds to post an MR comment that suggests the commit status was created.
      • This results in misleading MR comments and incorrect state representation.

      Prerequisites (if any, like setup, operators/versions):

      Steps to Reproduce

       # <steps>

       

      Actual results:

      Expected results:

      **

      PaC should:

      1. Only post a comment on the MR when the commit status creation fails due to actual permission errors (401 or 403).
      1. Avoid posting MR comments when the failure is caused by other GitLab API errors (e.g., 400 status transition errors).
      1. Log these non-permission errors but not mislead users by posting the standard “pipeline run started” comment.

      Reproducibility (Always/Intermittent/Only Once):

      Acceptance criteria: 

       

      Definition of Done:

      Build Details:

      Additional info (Such as Logs, Screenshots, etc):

       

       *

              rh-ee-abghosh Abhishek Ghosh
              rh-ee-abghosh Abhishek Ghosh
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: