Error when triggering a pipeline for a merge request: "The resulting pipeline would have been empty" #3076
-
Description of the problem, including code/CLI snippetI’m trying to trigger a pipeline for a merge request using the python-gitlab package, but I’m encountering a 400 error with the message: "The resulting pipeline would have been empty." My GitLab CI configuration does not include any rules for the job, so I’m unsure why this error is occurring. Here’s the code I’m using:
And here’s my .gitlab-ci.yml configuration:
Expected BehaviorThe pipeline should be triggered successfully, and the pre-commit job defined in the .gitlab-ci.yml file should run. Actual BehaviorThe pipeline fails to trigger, and I receive the following error:
Specifications
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
This doesn't sound like a python-gitlab issue to me. Please look at: https://docs.gitlab.com/ee/api/merge_requests.html#create-merge-request-pipeline From the first part of the docs there it says:
Also look at https://docs.gitlab.com/ee/ci/yaml/ and search for Any reason to not use: https://python-gitlab.readthedocs.io/en/stable/gl_objects/merge_requests.html#merge-request-pipelines ? |
Beta Was this translation helpful? Give feedback.
-
Has |
Beta Was this translation helpful? Give feedback.
This doesn't sound like a python-gitlab issue to me.
Please look at: https://docs.gitlab.com/ee/api/merge_requests.html#create-merge-request-pipeline
From the first part of the docs there it says:
Also look at https://docs.gitlab.com/ee/ci/yaml/ and search for
merge_requests
. Looks like it is required to have in the.gitlab-ci.yml
aonly: merge_requests
in your config.Any reason to not use: https://python-gitlab.readthedocs.io/en/stable/gl_objects/merge_requests.html#merge-request-pipelines ?