Added is all of operator to member label filters#27945
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (10)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (8)
WalkthroughThis PR adds support for the 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
c8972c1 to
76410ae
Compare
|
| Command | Status | Duration | Result |
|---|---|---|---|
nx build @tryghost/signup-form |
✅ Succeeded | <1s | View ↗ |
nx build @tryghost/portal |
✅ Succeeded | <1s | View ↗ |
nx build @tryghost/comments-ui |
✅ Succeeded | <1s | View ↗ |
nx build @tryghost/sodo-search |
✅ Succeeded | <1s | View ↗ |
nx build @tryghost/activitypub |
✅ Succeeded | 1s | View ↗ |
nx build @tryghost/announcement-bar |
✅ Succeeded | <1s | View ↗ |
nx build @tryghost/admin-toolbar |
✅ Succeeded | <1s | View ↗ |
nx run-many -t test:unit -p @tryghost/posts,@tr... |
✅ Succeeded | 2m 48s | View ↗ |
Additional runs (5) |
✅ Succeeded | ... | View ↗ |
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗
☁️ Nx Cloud last updated this comment at 2026-06-15 12:41:01 UTC
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/posts/src/views/filters/filter-codecs.ts`:
- Around line 64-68: The single-value 'is-all' serializer currently emits a
grouped clause `(field:val)` which doesn't round-trip because
extractAllOfPredicates() only rebuilds 'is-all' from groups of two-or-more;
update the SET_OPERATOR_SERIALIZERS entry for 'is-all' to check values.length
and for a single value delegate to the existing serializeSetMembership('')
serializer (same behavior as 'is-any'), otherwise keep the current grouped
serialization that uses serializeScalarValue; reference
SET_OPERATOR_SERIALIZERS, serializeSetMembership, serializeScalarValue, and
extractAllOfPredicates when locating and changing the code.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 343dbedb-e215-4b37-9370-720858f46e16
📒 Files selected for processing (10)
apps/posts/src/views/filters/filter-codecs.test.tsapps/posts/src/views/filters/filter-codecs.tsapps/posts/src/views/filters/filter-query-core.test.tsapps/posts/src/views/filters/filter-query-core.tsapps/posts/src/views/members/member-fields.test.tsapps/posts/src/views/members/member-fields.tsapps/posts/src/views/members/member-filter-query.test.tsapps/posts/src/views/members/member-filter-query.tsapps/posts/src/views/members/use-member-filter-fields.test.tsapps/posts/src/views/members/use-member-filter-fields.ts
ref https://linear.app/ghost/issue/BER-3664/add-is-all-of-operator-to-member-label-filters Members need to filter for contacts that have every selected label, while preserving existing any-of and none-of semantics and round-tripping grouped NQL back into the filter UI.
ref https://linear.app/ghost/issue/BER-3664/add-is-all-of-operator-to-member-label-filters - the hand-rolled paren/quote scanner misread a trailing backslash in a quoted value as an escaped quote, so grouped all-of filters containing such values reparsed as separate any-of predicates - replaced the scanner with a probe parse: NQL only flattens parentheses when they are redundant, so parsing the filter with a probe predicate AND-ed alongside preserves the outer group as a nested $and, delegating all quoting rules to the real parser
ref https://linear.app/ghost/issue/BER-3664/add-is-all-of-operator-to-member-label-filters - the parse side of is-all was label-specific: a hard-coded extractor recognised only label/labels keys, so any other set field adopting is-all would serialize the grouped form but silently fail to parse it back - replaced it with a shared extractor in filter-query-core that activates for any field declaring the is-all operator, with alias keys coming from the existing parseKeys mechanism instead of being hard-coded - converted setCodec's serialize branches into an operator-serializer table so adding a set operator is a table entry rather than a special-cased early return
76410ae to
4884ed7
Compare

ref https://linear.app/ghost/issue/BER-3664/add-is-all-of-operator-to-member-label-filters
Member label filters could only express "has any of these labels" or "has none of these labels", so there was no way to find members that carry every selected label.
(label:alpha+label:vip)) so the backend ANDs the label clausesis-alloperator gets serialization and parsing for free, with alias keys (labels) coming from the existingparseKeysmechanism, so extending it to e.g. tiers is a one-line change