ref(hybridcloud): Read webhook bucket keys through one helper - #123678
Open
vaind wants to merge 2 commits into
Open
ref(hybridcloud): Read webhook bucket keys through one helper#123678vaind wants to merge 2 commits into
vaind wants to merge 2 commits into
Conversation
This was referenced Sep 4, 2026
The unit test came off the gate-removal PR, where its coercion and non-dict cases were asserting this helper's behaviour rather than that one's.
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.
Five parsers each read the id their mailbox is bucketed on, and each one disagreed about what to do with a body it did not expect.
githubrequired anint, so a payload sending"1"fell back to the unsplit mailbox.gitlabreturned the value uncoerced, so a string id raisedTypeErrorat the modulo, and a non-dictprojectraisedAttributeErrorbefore ever getting there.jira_servercaughtValueErrorbut notTypeError, so{"issue": {"id": []}}raised out of the parser.jiraandvstswere already right, and the shared reader is exactly what they did.BaseRequestParser.bucket_key_at(data, *path)is that: read the value, coerce it to an int, fall back to the integration-level mailbox on anything else. All five go through it now.What changes
An unusable key falls back instead of raising, in the three parsers that did not already do that. It also stops discarding id
0--gitlabandjira_servertested the value for truthiness, and0is the first bucket of a split, not the absence of one.None of it fires on a real payload, per each provider's own docs. GitHub types
repository.idas a requiredinteger, format: int64-- never a string, which is what made that fixture wrong. GitLab typesproject.idas an integer and omitsprojectentirely on group-scoped events, which both the old reader and this one answer with the integration-level mailbox. Jira Server is the one provider whoseissue.idreally does arrive as a string ("id": "99291"), and its reader already coerced it.So no mailbox name moves on deploy. Every branch this changes is reached only by a payload shape no provider sends, which is the point: they were five different answers to a case none of them had.
Reviewer notes
One GitHub fixture claimed
"repository": {"id": "1"}. Real payloads send a number -- the cell handler doesstr(event["repository"]["id"])-- so the fixture was wrong and is now1, which is what every other GitHub test already used. That is the one test whose mailbox name moves:test_issue_deleted_routingwas landing ongithub:<id>:issuesbecause the string was rejected, and now lands ongithub:<id>:1:issueslike every other repository-carrying payload.The gitlab
mailbox_bucket_idunit test comes from the gate-removal PR (#123449), where its coercion and non-dict-projectcases were asserting this helper rather than that one.Refs CW-1987