Skip to content

chore: remove unused fields of ULIDFieldFilter, keep the eq, neq, oeq - #4223

Merged
tothandras merged 3 commits into
mainfrom
chore/simplify-ulidfilter
Apr 24, 2026
Merged

tothandras merged 3 commits into
mainfrom
chore/simplify-ulidfilter

Conversation

@borosr

@borosr borosr commented Apr 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • API Changes

    • Simplified ULID filtering: removed fuzzy substring and presence/absence options — only strict equality and exact-list matching remain.
    • OpenAPI/Swagger spec updated to reflect the new filter behavior.
  • Behavior

    • Request parsing/handling adjusted so unsupported ULID operators no longer trigger certain rejections; only strict mismatches are treated as errors.
  • Tests

    • Negative tests for the removed operators were removed.

@borosr
borosr requested a review from a team as a code owner April 24, 2026 11:07
@borosr borosr self-assigned this Apr 24, 2026
@borosr borosr added the release-note/ignore Ignore this change when generating release notes label Apr 24, 2026
@coderabbitai

coderabbitai Bot commented Apr 24, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 655fcef6-5642-473f-9e92-a2883d796068

📥 Commits

Reviewing files that changed from the base of the PR and between 07fbc7c and 6a5b5bf.

⛔ Files ignored due to path filters (1)
  • api/v3/openapi.yaml is excluded by !**/openapi.yaml
📒 Files selected for processing (2)
  • api/spec/packages/aip/src/common/parameters.tsp
  • api/v3/api.gen.go

📝 Walkthrough

Walkthrough

Removes fuzzy ULID filtering options (contains, ocontains, $exists) from the API spec and updates generated code, parsing, and conversion so ULID filters only support strict equality (eq, neq) and comma-delimited exact match (oeq).

Changes

Cohort / File(s) Summary
API spec
api/spec/packages/aip/src/common/parameters.tsp
Deleted contains, ocontains, and exists members from ULIDFieldFilter.object.
Generated OpenAPI
api/v3/api.gen.go
Regenerated embedded Swagger/OpenAPI payload and adjusted ULID filter docs to indicate exact-match-only; decoding/resolution logic unchanged.
Filter types
api/v3/filters/filter.go
Removed Contains, Ocontains, and Exists fields from FilterULID struct and corresponding JSON schema.
Filter parsing
api/v3/filters/parse.go
Dropped support for parsing contains, ocontains, and existence syntaxes; parser now accepts only eq, neq, oeq for ULID.
Filter conversion
api/v3/filters/convert.go
FromAPIFilterULID no longer produces parts from Exists/Contains/Ocontains; only remaining operators generate query parts.
Handlers
api/v3/handlers/events/convert.go
Relaxed validation: handler no longer rejects filters using Contains/Ocontains/Exists (only Neq still triggers rejection).
Tests
api/v3/handlers/events/list_test.go
Removed negative tests that asserted rejection for Contains/Ocontains/Exists on customer_id filters.

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant Handler as API Handler
  participant Parser as Filter Parser
  participant Converter as Filter Converter
  participant Builder as Filter Builder
  Client->>Handler: HTTP request with filter[customer_id]=...
  Handler->>Parser: parse filter tokens (allowed: eq, neq, oeq)
  Parser-->>Handler: parsed operator/value (unsupported ops -> ErrUnsupportedOperator)
  Handler->>Converter: convert parsed API filter to internal parts
  Converter-->>Builder: provide parts for building query (contains/ocontains/exists excluded)
  Builder-->>Handler: built query/filter
  Handler->>Client: respond with filtered results
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • tothandras
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: removing unused ULID filter fields (contains, ocontains, exists) while keeping the core comparison operators (eq, neq, oeq).
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/simplify-ulidfilter

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@tothandras
tothandras merged commit 5f30643 into main Apr 24, 2026
26 of 27 checks passed
@tothandras
tothandras deleted the chore/simplify-ulidfilter branch April 24, 2026 12:17

This branch was previously deployed

1 inactive deployment
dev — 6a5b5bfe Deployed Apr 24, 2026 by borosr via Migration Checks #13833
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-note/ignore Ignore this change when generating release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants