Title: Error when triggering a pipeline for a merge request: "The resulting pipeline would have been empty" · Issue #3075 · python-gitlab/python-gitlab · GitHub
Open Graph Title: Error when triggering a pipeline for a merge request: "The resulting pipeline would have been empty" · Issue #3075 · python-gitlab/python-gitlab
X Title: Error when triggering a pipeline for a merge request: "The resulting pipeline would have been empty" · Issue #3075 · python-gitlab/python-gitlab
Description: Description of the problem, including code/CLI snippet I’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...
Open Graph Description: Description of the problem, including code/CLI snippet I’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 ...
X Description: Description of the problem, including code/CLI snippet I’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: "...
Opengraph URL: https://github.com/python-gitlab/python-gitlab/issues/3075
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Error when triggering a pipeline for a merge request: \"The resulting pipeline would have been empty\"","articleBody":"## Description of the problem, including code/CLI snippet\r\nI’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.\r\n\r\nHere’s the code I’m using:\r\n```\r\nimport gitlab\r\nfrom .constants import URL, TOKEN, PROJECT_ID, MR_ID\r\n\r\ngl = gitlab.Gitlab(url=URL, private_token=TOKEN)\r\n\r\nresponse = gl.http_request(\r\n \"POST\",\r\n f\"/projects/{PROJECT_ID}/merge_requests/{MR_ID}/pipelines\",\r\n timeout=60,\r\n retry_transient_errors=True,\r\n)\r\n\r\nprint(response)\r\n```\r\n\r\nAnd here’s my .gitlab-ci.yml configuration:\r\n```\r\npre-commit:\r\n image: python:3.12-bookworm\r\n\r\n before_script:\r\n - apt update\r\n - apt install -y --no-install-recommends pipx\r\n - PATH=\"/root/.local/bin:$PATH\"\r\n - pipx install pre-commit\r\n\r\n script:\r\n - pre-commit run --all-files\r\n ```\r\n\r\n## Expected Behavior\r\nThe pipeline should be triggered successfully, and the pre-commit job defined in the .gitlab-ci.yml file should run.\r\n\r\n## Actual Behavior\r\nThe pipeline fails to trigger, and I receive the following error:\r\n```\r\nTraceback (most recent call last):\r\n File \"/Users/neXeacon/Desktop/marge-bot/test.py\", line 7, in \u003cmodule\u003e\r\n response = gl.http_request(\r\n \"POST\",\r\n f\"/projects/{PROJECT_ID}/merge_requests/{MR_ID}/pipelines\",\r\n timeout=60,\r\n retry_transient_errors=True,\r\n )\r\n File \"/Users/neXeacon/Desktop/marge-bot/venv/lib/python3.13/site-packages/gitlab/client.py\", line 773, in http_request\r\n raise gitlab.exceptions.GitlabHttpError(\r\ngitlab.exceptions.GitlabHttpError: 400: {'base': ['The resulting pipeline would have been empty. Review the rules configuration for the relevant jobs.']}\r\n```\r\n\r\n## Specifications\r\n\r\n - python-gitlab version: 5.3.0\r\n - Gitlab server version (or gitlab.com): 8.7.1\r\n","author":{"url":"https://github.com/hailatGH","@type":"Person","name":"hailatGH"},"datePublished":"2025-01-02T12:16:30.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/3075/python-gitlab/issues/3075"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:355552b3-5e22-b47d-31b4-bcc606e4acc2 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C626:DA633:ABFDFE0:DE2FF77:69766454 |
| html-safe-nonce | e5b8ed99ea348adad075849067a68751abd6fcd55c5f2f0d9b870f1e1c9de8cf |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNjI2OkRBNjMzOkFCRkRGRTA6REUyRkY3Nzo2OTc2NjQ1NCIsInZpc2l0b3JfaWQiOiI1ODkwMDI3NzQ2NzM3MTUzMTA4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 5825e0a86330147df132ae140c7efe8bae2c360a7da9564924524345e73ded60 |
| hovercard-subject-tag | issue:2765934052 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python-gitlab/python-gitlab/3075/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7a6621abb80ef6f93e5555ed2243f7deb4c131f22d27d6a1e3c5cac929346dc3/python-gitlab/python-gitlab/issues/3075 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7a6621abb80ef6f93e5555ed2243f7deb4c131f22d27d6a1e3c5cac929346dc3/python-gitlab/python-gitlab/issues/3075 |
| og:image:alt | Description of the problem, including code/CLI snippet I’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 ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | hailatGH |
| hostname | github.com |
| expected-hostname | github.com |
| None | 032152924a283b83384255d9489e7b93b54ba01da8d380b05ecd3953b3212411 |
| turbo-cache-control | no-preview |
| go-import | github.com/python-gitlab/python-gitlab git https://github.com/python-gitlab/python-gitlab.git |
| octolytics-dimension-user_id | 28886265 |
| octolytics-dimension-user_login | python-gitlab |
| octolytics-dimension-repository_id | 8077625 |
| octolytics-dimension-repository_nwo | python-gitlab/python-gitlab |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 8077625 |
| octolytics-dimension-repository_network_root_nwo | python-gitlab/python-gitlab |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 5b577f6be6482e336e3c30e8daefa30144947b17 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width