fix!: remove zammad_delete_attachment, Zammad has no such endpoint - #322
fix!: remove zammad_delete_attachment, Zammad has no such endpoint#322jovamateus26 wants to merge 1 commit into
Conversation
The tool could never succeed. client.delete_attachment called
api.ticket_article_attachment.destroy(attachment_id, article_id,
ticket_id), but zammad_py inherits Resource.destroy(self, id) — a single
id — so every call raised:
Resource.destroy() takes 2 positional arguments but 4 were given
Fixing the arity would not help. Zammad routes only
GET /ticket_attachment/:ticket_id/:article_id/:id (config/routes/ticket.rb);
there is no DELETE counterpart, so the call would 404 regardless. The
closest supported operation is deleting the whole article via
DELETE /ticket_articles/:id.
The unit tests passed because MagicMock accepts any signature; a spec'd
mock would have caught it. Replaced them with a guard asserting the tool
is not registered.
Removes: zammad_delete_attachment tool, ZammadClient.delete_attachment,
DeleteAttachmentParams, DeleteAttachmentResult, AttachmentDeletionError,
and their README entries. Tool count in ARCHITECTURE.md 22 -> 21.
BREAKING CHANGE: the zammad_delete_attachment tool is gone. It never
worked, so no working integration can depend on it.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning Review limit reached
Next review available in: 59 minutes Limit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?Wait for the limit to reset, then comment An organization admin can change what happens after included review limits in Billing. How do review limits work?CodeRabbit enforces per-developer PR review limits within each organization. For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (8)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| Documentation | 1 minor |
🟢 Metrics -4 complexity
Metric Results Complexity -4
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
|
Same note as on #321 about the checks: GitHub Actions are waiting on your approval — Codacy's single "new issue" is an Info-level docs nit, and this PR's own numbers make the case better than I can: The one added is So Prospector is enforcing a numpy-ish docstring convention that this project doesn't use anywhere, and the "0 new issues" gate charges it to whichever PR touches a line. Net, this PR removes 11 more findings than it adds. Happy to reword that one docstring into a single line if you want the gate green, or to send a separate PR setting the pydocstyle convention to |
Fixes #320
Problem
zammad_delete_attachmentfails on every call:client.delete_attachmentcallsapi.ticket_article_attachment.destroy(attachment_id, article_id, ticket_id), butTicketArticleAttachmentonly overridesdownload()— itsdestroy()is the inheritedResource.destroy(self, id).Correcting the arity would not help. Zammad routes exactly one attachment path (
config/routes/ticket.rb):GET only. There is no DELETE counterpart at any URL shape, so the tool cannot be made to work against the Zammad REST API. The closest supported operation is deleting the whole article (
DELETE /api/v1/ticket_articles/:id). Verified against Zammad 6.5 sources in a running container.Change
Removes the dead surface rather than shipping a tool that always errors:
zammad_delete_attachmenttoolZammadClient.delete_attachmentDeleteAttachmentParams,DeleteAttachmentResultAttachmentDeletionError(had no other caller)ARCHITECTURE.md: 22 → 21Upload, listing and download are untouched — those endpoints exist and work.
Tests
The old tests passed because
MagicMockaccepts a call signature the real class rejects; a spec'd mock would have caught this at the assert. Replaced them withtest_no_attachment_deletion_tool_is_registered, which asserts the tool is absent and records why in the docstring, so it does not silently come back.215 passed, coverage 88.12% (gate 86%).
ruff check,ruff formatandmypy mcp_zammadclean.Your call
I marked this
fix!because it drops a tool from the public surface — though since it never worked, no functioning integration can depend on it.If you would rather keep the name registered, I am happy to rewrite this as: keep the tool, raise a clear
NotSupportedErrorexplaining the Zammad limitation and pointing at article deletion. Say the word and I will push that instead.The historical design docs under
docs/plans/are left as-is, since they record what was planned at the time.