Repository navigation
Conversation
Orgs\Hooks::edit() posted to /orgs/{org}/hooks, the create endpoint, and
has no parameter for the hook ID, so every call created another webhook.
Add editHook($org, $id, ...), which patches /orgs/{org}/hooks/{id} with a
JSON body that contains only the given values. Deprecate edit() and make
it throw instead of creating a duplicate hook.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 12, 2026
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary of Changes
Orgs\Hooks::edit()sentPOST /orgs/{org}/hooks— the endpoint that creates a webhook — and expected201. It has no hook ID parameter at all, so it could never edit a hook; every call created a duplicate webhook. The unit test asserted exactly that.Orgs\Hooks::editHook($org, $id, $url = null, $contentType = null, $secret = null, $insecureSsl = null, array $events = [], $active = null):PATCH /orgs/{org}/hooks/{id}with a JSON body that contains only the given values.edit()is deprecated (runtime deprecation, removal in 5.0) and throws aBadMethodCallExceptionpointing toeditHook()instead of creating another hook. This is a behaviour change in 4.x: code that callededit()and silently got a new hook now gets an exception. The finding offered "throw or delegate"; delegating is impossible becauseedit()has no hook ID.symfony/deprecation-contracts(^2|^3, as in the other framework packages) fortrigger_deprecation().create()still sends a form-encoded body; that is fixed separately together with the other methods that do so. The event whitelist is unchanged (editHook()validates likecreate()).Testing Instructions
Tests/Package/Orgs/HooksTest.php:testEditexpects the deprecation and the exception and no request;testEditHook/testEditHookPartialcheck thePATCHpath and the JSON body; the validation tests moved toeditHook().Documentation Changes Required
docs/overview.md: new "Organization webhooks" section. When #66 is merged, itspackages.mdtable fororgs->hooksneedseditHookadded. The 5.x removal ofedit()follows in a separate PR.🤖 Generated with Claude Code