Conversation
Add commands to manage webhooks in a Prismic repository: create, list, view, remove, test, enable, disable, status, add-header, remove-header, and set-triggers. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
c0da499 to
21b0a37
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| body.set("releasesCreated", webhookConfig.documentsUnpublished.toString()); | ||
| body.set("releasesUpdated", webhookConfig.documentsUnpublished.toString()); | ||
| body.set("tagsCreated", webhookConfig.documentsUnpublished.toString()); | ||
| body.set("documentsPublished", webhookConfig.documentsUnpublished.toString()); |
There was a problem hiding this comment.
All trigger fields use wrong property value
High Severity
In both createWebhook and updateWebhook, every trigger field reads its value from webhookConfig.documentsUnpublished instead of the corresponding property. For example, documentsPublished uses webhookConfig.documentsUnpublished, releasesCreated uses webhookConfig.documentsUnpublished, etc. This means all triggers are always set to whatever the documentsUnpublished value is, completely ignoring the caller's intended per-trigger settings.
Additional Locations (1)
| body.set("releasesCreated", webhookConfig.documentsUnpublished.toString()); | ||
| body.set("releasesUpdated", webhookConfig.documentsUnpublished.toString()); | ||
| body.set("tagsCreated", webhookConfig.documentsUnpublished.toString()); | ||
| body.set("documentsPublished", webhookConfig.documentsUnpublished.toString()); |
There was a problem hiding this comment.
Duplicate key overwrites documentsPublished, tagsDeleted never set
High Severity
In both createWebhook and updateWebhook, the last body.set call uses the key "documentsPublished" instead of "tagsDeleted". This means tagsDeleted is never sent to the API, and the documentsPublished value is set twice (with the second call overwriting the first). The tagsDeleted trigger can never be configured through either function.


Resolves:
Description
Add webhook management commands to the CLI. This introduces the
prismic webhookcommand with subcommands for creating, listing, viewing, removing, testing, enabling, disabling webhooks, as well as managing custom HTTP headers and triggers.Depends on #34 (removal of the dead webhook files from main).
Checklist
Preview
How to QA 1
Build and run
./dist/index.mjs webhookto see the help output. Individual subcommands can be tested against a Prismic repository with--repo.Note
Medium Risk
Adds new networked CLI functionality that mutates webhook configuration in Prismic repos; mistakes in request payload mapping (e.g., trigger fields) could lead to incorrect webhook settings or unexpected event delivery.
Overview
Adds a new top-level
prismic webhookcommand with subcommands tolist,create,view,remove,test,enable/disable, checkstatus, and manage webhook headers and trigger events.Introduces a
wroomclient (src/clients/wroom.ts) that calls Prismic repository settings endpoints (withprismic-authcookie) to fetch, create, update, trigger, and delete webhooks, usingvalibotschemas for response validation andFormDatafor writes.Written by Cursor Bugbot for commit 21b0a37. This will update automatically on new commits. Configure here.
Footnotes
Please use these labels when submitting a review:
⚠️ #issue: Strongly suggest a change.
❓ #ask: Ask a question.
💡 #idea: Suggest an idea.
🎉 #nice: Share a compliment. ↩