- Notifications
You must be signed in to change notification settings - Fork673
Error when triggering a pipeline for a merge request: "The resulting pipeline would have been empty"#3076
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
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
|
BetaWas this translation helpful?Give feedback.
All reactions
👍 2
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:
Create a newpipeline for a merge request. A pipeline created from this endpoint doesn’t run a regular branch/tag pipeline. To create jobs, configure .gitlab-ci.yml with only: [merge_requests].
Also look athttps://docs.gitlab.com/ee/ci/yaml/ and search formerge_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 ?
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 athttps://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 ? |
BetaWas this translation helpful?Give feedback.
All reactions
-
@hailatGH Hopefully that information will be helpful. |
BetaWas this translation helpful?Give feedback.
All reactions
-
@JohnVillalovos indeed it helped well, thank you |
BetaWas this translation helpful?Give feedback.
All reactions
-
@hailatGH Glad to hear it. |
BetaWas this translation helpful?Give feedback.
All reactions
-
Has |
BetaWas this translation helpful?Give feedback.
All reactions
This discussion was converted from issue #3075 on January 02, 2025 17:27.