You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(server): webhook filters treat a null wildcard list as empty - #41715
Go webhook senders such as Forgejo and Gitea encode an empty list as null. An unassigned issue therefore arrives with "assignees": null, while GitHub sends []. A filter over a [] wildcard path on that list, such as body.issue.assignees[].login notEquals bot, passed for an unassigned GitHub issue but failed for every unassigned Forgejo or Gitea issue. The task then skipped those deliveries, and only the filter-failure log showed why.
Change
lookup() in apps/server/src/scheduledTasks/webhookTemplate.ts now resolves a wildcard segment that holds null to an empty list. Filters and prompt placeholders share that resolver, so both read a null list exactly as they read []. An absent key still resolves to missing and fails every op, as the filter rules from #22194 require.
Scope
This is a small fix of an obvious bug, so it has no issue: the same event with the same filter gets a different result depending on whether the sender writes an empty list as [] or as null. It follows #23282, which made an empty [] list pass notEquals but did not cover null.
Verification
Added a null-assignees case to the existing "treats an empty or missing wildcard list as nothing to match" test in webhookFilter.test.ts. It fails on main and passes with the fix.
webhookFilter.test.ts, webhookTemplate.test.ts, and ScheduledTaskService.webhook.test.ts pass, 74 tests.
Ran findFailedWebhookFilter with body.issue.assignees[].login notEquals bot against payloads with assignees set to [], null, and absent. Before the fix only [] passed. After it, [] and null pass and absent still fails.
Confirmed the null encoding on a live Forgejo instance: Codeberg's API (Forgejo 17.0) returns "assignees": null for unassigned issues. I did not capture an actual Forgejo webhook delivery. Webhook payloads use the same issue conversion as the API.
Model: Claude Opus 5.5. Harness: Claude Code in T3 Code.
Reviewing files that changed from the base of the PR and between 40c8267 and 72dd9a3.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Walkthrough
Wildcard lookup now returns an empty list when a wildcard selects null. Other non-array values still return undefined. A test checks that notEquals passes when the assignee list is null.
Changes: Webhook wildcard lookup
Layer / File(s)
Summary
Wildcard lookup and null handling apps/server/src/scheduledTasks/webhookTemplate.ts, apps/server/src/scheduledTasks/webhookFilter.test.ts
The lookup documentation and behavior specify that a wildcard maps over array elements, omits elements without the requested path, returns an empty list for null, and returns undefined for other non-arrays. The test checks that notEquals passes when the assignee list is null.
Webhook filters and prompt placeholders now treat a null wildcard list such as unassigned-issue assignees from Forgejo or Gitea as an empty list. This matches GitHub's behavior and affects only that narrow case. No merge-blocking risk was identified.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: webhook filters now treat a null wildcard list as empty. It matches the lookup() change in webhookTemplate.ts and the added null-assignees test. It follows the convent…
Description check
The description follows the template's sections: Problem, Change, Scope, and Verification. The Problem section gives the expected and actual behavior with a concrete Forgejo/Gitea example. The Change …
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the main change: webhook filters now treat a null wildcard list as empty. It matches the lookup() change in webhookTemplate.ts and the added null-assignees test. It follows the conventional commit format and is specific, so it passes.
Full details: Description check
Explanation
The description follows the template's sections: Problem, Change, Scope, and Verification. The Problem section gives the expected and actual behavior with a concrete Forgejo/Gitea example. The Change section explains the lookup() fix and why absent keys still fail. The Scope section explains why no issue exists and links the related PR #22194 and #23282. Verification lists the tests run, the observed before/after results, and a note on what was not checked (no captured live Forgejo webhook delivery). The description is mostly complete, so it passes. It does not include a model/harness line in the required format, but it does include one at the end.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Fix failing CI checks
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Go senders such as Forgejo and Gitea encode an empty list as null, so
an unassigned issue arrives with "assignees": null. A wildcard path
over that list resolved to undefined, and notEquals then failed, so a
filter like body.issue.assignees[].login notEquals bot skipped every
unassigned issue while passing the same delivery from GitHub, which
sends []. A wildcard segment that holds null now resolves to an empty
list. An absent key still fails every op.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rebased onto main at 67c442a. The earlier CI run merged this branch onto a main that had the stoppedNow typecheck break from #41685 and #41362, which #41709 fixed a few minutes later. The diff is unchanged.
This branch has not been deployed
No deployments
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
size:XS0-9 changed lines (additions + deletions).vouch:unvouchedAuthor is not yet trusted in the VOUCHED list.
1 participant
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.
Problem
Go webhook senders such as Forgejo and Gitea encode an empty list as null. An unassigned issue therefore arrives with "assignees": null, while GitHub sends []. A filter over a [] wildcard path on that list, such as body.issue.assignees[].login notEquals bot, passed for an unassigned GitHub issue but failed for every unassigned Forgejo or Gitea issue. The task then skipped those deliveries, and only the filter-failure log showed why.
Change
lookup() in apps/server/src/scheduledTasks/webhookTemplate.ts now resolves a wildcard segment that holds null to an empty list. Filters and prompt placeholders share that resolver, so both read a null list exactly as they read []. An absent key still resolves to missing and fails every op, as the filter rules from #22194 require.
Scope
This is a small fix of an obvious bug, so it has no issue: the same event with the same filter gets a different result depending on whether the sender writes an empty list as [] or as null. It follows #23282, which made an empty [] list pass notEquals but did not cover null.
Verification
Model: Claude Opus 5.5. Harness: Claude Code in T3 Code.