-
Bug
-
Resolution: Unresolved
-
Normal
-
None
-
None
-
None
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:
- Only post a comment on the MR when the commit status creation fails due to actual permission errors (401 or 403).
- Avoid posting MR comments when the failure is caused by other GitLab API errors (e.g., 400 status transition errors).
- 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):