Repository navigation
fix(cli): resolve parent IDs when creating commit statuses - #3453
Closed
Arham-Begani wants to merge 1 commit into
Closed
Arham-Begani wants to merge 1 commit into
Arham-Begani wants to merge 1 commit into
Conversation
AI-assisted-by: OpenAI Codex
Author
|
I see this was closed without a review comment. If you have a moment, could you clarify whether the concern is the implementation, contribution policy, or existing work I missed? That would help me avoid repeating unsuitable submissions. I will leave this closed and pause further contributions to this repository pending clarification. AI involvement and the exact test evidence are documented in the description. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3453 +/- ##
==========================================
+ Coverage 95.78% 95.85% +0.06%
==========================================
Files 100 100
Lines 6172 6177 +5
==========================================
+ Hits 5912 5921 +9
+ Misses 260 256 -4
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Fixes #3452.
project-commit-status createsent/projects/{project_id}/statuses/{commit_id}literally, producing a 404. CLI initialization removes parent IDs from the payload after interpolating the manager's list path. Status creation uses a different endpoint and therefore cannot reconstruct its POST path from the unparented CLI manager.Route this one CLI action through lazily constructed project/commit parents, then reuse the existing
do_create()path. This retains the Python API's URL construction and CLI error handling, keeps parent IDs out of the JSON payload, and adds no project/commit lookup requests.Only
gitlab/v4/cli.pyand its CLI tests change. The new HTTP-contract cases cover numeric and namespaced project IDs, including spaces, and assert the exact payload.Documentation and testing
51eb17e6e67a25157e04b0abc649221bd8ecc7fe, showing encoded literal{project_id}/{commit_id}in the POST URL; both pass after the fix.python -m gitlab ... project-commit-status createsubprocesses against a local HTTP server exit 0, use the correct numeric/encoded project paths, send onlystateandcontext, and make no project/commit fetch requests. Normal CLI authentication requests are accounted for. These are local wire-contract checks, not a live GitLab deployment.twine check. All 3 packaging smoke tests pass.AI assistance
OpenAI Codex investigated, reproduced, implemented and tested this contribution and drafted the description on behalf of Arham-Begani. No human-authored-code or personal-review attestation is claimed. The commit records
AI-assisted-by: OpenAI Codex.