Open
Description
Thank you for this project, which is very useful! gitlab project-commit-status list works fine. However, gitlab project-commit-status create does not. It appears that code was last updated in #511.
Description of the problem, including code/CLI snippet
$ gitlab -d --server-url=SERVER project-commit-status create --project-id 'FOO' --commit-id HASH --state pending --context sampleExpected Behavior
It creates an external commit status called "sample" in commit HASH of project FOO
Actual Behavior
...
DEBUG:http.client:send: b'POST /api/v4/projects/%7Bproject_id%7D/statuses/%7Bcommit_id%7D HTTP/1.1\r\nHost: SERVER\r\nUser-Agent: python-gitlab/8.3.0\r\nAccept-Encoding: gzip, deflate\r\nAccept: */*\r\nConnection: keep-alive\r\nContent-type: application/json\r\nContent-Length: 39\r\nPRIVATE-TOKEN: [MASKED]\r\n\r\n'
DEBUG:http.client:send: b'{"state": "pending", "context": "sample"}'
DEBUG:http.client:reply: 'HTTP/1.1 404 Not Found\r\n'
...
The POST URL is /api/v4/projects/%7Bproject_id%7D/statuses/%7Bcommit_id%7D --- the project_id and commit_id haven't been filled in. In my own tracing, that appears to be because self._parent is None when ProjectCommitStatusManager.create() is called.
Specifications
- python-gitlab version: Tested with pip python-gitlab v8.3.0 and with main @ 51eb17e
- Gitlab server version (or gitlab.com): 19.3.5
Metadata
Metadata
Assignees
Labels
No labels
Activity
Arham-Begani commentedon Oct 20, 2026
I am investigating a focused fix for the CLI creation path. The current CLI removes the parent IDs from the payload after expanding the manager's list URL, but commit-status creation uses a different URL and has no parent object to expand it from.
I plan to preserve the existing Python API behavior and add regression coverage through the actual CLI dispatch, including a namespaced project ID and checking that parent IDs do not leak into the JSON body. I checked the open PRs and found no matching implementation; please flag any ongoing work so I can avoid duplicating it.
An automated OpenAI Codex agent is preparing and testing this contribution on behalf of Arham-Begani. Any PR will disclose that assistance and report actual validation and limitations.