refactor(vcs): report the events a delivery describes - #128
Merged
Conversation
A delivery was read as one event, which holds for every provider here but not for all of them: a Bitbucket push reports each ref it touched in a single delivery, and only the first would have been seen. getEvents() replaces getEvent() and hands back the events a delivery describes, empty when it describes none. Providers that carry one event per delivery return the one they parsed, so what callers read is unchanged beyond the list around it.
Meldiron
reviewed
Aug 7, 2026
| } | ||
|
|
||
| $result = $this->vcsAdapter->getEvent('installation', $payload); | ||
| $result = $this->vcsAdapter->getEvents('installation', $payload)[0]; |
Contributor
There was a problem hiding this comment.
In all palces that we did this, lets also assertIsArray and assertCount 1
Reading the first event said nothing about how many came back, so a delivery parsed into none or several would have failed on the event's contents rather than on the count that explains it.
Meldiron
approved these changes
Aug 7, 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.
Splits the webhook-parsing change out of #125 so that PR carries only Bitbucket.
What changes
getEvent()becomesgetEvents()and returns the events a delivery describes rather than a single event.getEvent()no longer exists.A delivery was read as one event, which holds for every provider on
mainbut not for all of them: a Bitbucket push reports each ref it touched in one delivery, and only the first would ever have been seen.Shape
Providers here carry one event per delivery, so each returns the one it parsed inside a list. A delivery describing nothing still returns an empty list, which now reads as "no events" rather than "one empty event".
['branch' => 'main', ...][['branch' => 'main', ...]][][]Follow-ups
getEvents()like the rest.Green on all six adapters.