projects.py passes _make_request args in the wrong order -- delete_card and update_card never work #22

Open
opened 2026-10-01 16:40:38 +02:00 by kade · 0 comments
Owner

_make_request's signature is _make_request(endpoint, method=...), but
modules/projects.py calls it with the arguments reversed:

# src/forgejo_client/modules/projects.py
url = f"{self.config.api_url}/projects/columns/cards/{card_id}"
return self.client._make_request("DELETE", url) is not None      # endpoint="DELETE", method=<url>
return self.client._make_request("PATCH", url, json=data)         # same

So endpoint="DELETE" and method=<a URL>. That never reaches the network; it
trips the raise ValueError(f"Unsupported method: {url}") branch, which the
blanket handler swallows into None. delete_card always returns False and
update_card always returns None.

Fix (in the working tree, part of the client.py rewrite)

Swap to self.client._make_request(url, method="DELETE", ...) /
(url, method="PATCH", ...).

Note: no regression test is included for the kanban module in this pass; the fix
is positional only and the surrounding live-service tests are the only coverage.
A test asserting the recorded method/url would be the natural follow-up.

`_make_request`'s signature is `_make_request(endpoint, method=...)`, but `modules/projects.py` calls it with the arguments reversed: ```python # src/forgejo_client/modules/projects.py url = f"{self.config.api_url}/projects/columns/cards/{card_id}" return self.client._make_request("DELETE", url) is not None # endpoint="DELETE", method=<url> return self.client._make_request("PATCH", url, json=data) # same ``` So `endpoint="DELETE"` and `method=<a URL>`. That never reaches the network; it trips the `raise ValueError(f"Unsupported method: {url}")` branch, which the blanket handler swallows into `None`. `delete_card` always returns `False` and `update_card` always returns `None`. ## Fix (in the working tree, part of the client.py rewrite) Swap to `self.client._make_request(url, method="DELETE", ...)` / `(url, method="PATCH", ...)`. Note: no regression test is included for the kanban module in this pass; the fix is positional only and the surrounding live-service tests are the only coverage. A test asserting the recorded method/url would be the natural follow-up.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kade/forgejo-client#22
No description provided.