Skip to content

fix: Centralize assignee filter parsing and accept frontend unassigned sentinel#2250

Merged
daryllimyt merged 1 commit intomainfrom
codex/fix-unassigned-case-filtering-error
Mar 4, 2026
Merged

fix: Centralize assignee filter parsing and accept frontend unassigned sentinel#2250
daryllimyt merged 1 commit intomainfrom
codex/fix-unassigned-case-filtering-error

Conversation

@daryllimyt
Copy link
Contributor

@daryllimyt daryllimyt commented Mar 4, 2026

Motivation

  • Accept the frontend sentinel __UNASSIGNED__ (in addition to legacy unassigned) for assignee filters and propagate that intent to service calls.
  • Remove duplicated parsing logic from routers and centralize validation and parsing in a single helper to reduce code duplication and ensure consistent behavior.

Description

  • Add tracecat/cases/filters.py which implements parse_assignee_filter and the UNASSIGNED_ASSIGNEE_IDENTIFIERS set and returns a ParsedAssigneeFilter dict with assignee_ids and include_unassigned.
  • Replace inline assignee parsing in tracecat/cases/router.py and tracecat/cases/internal_router.py with calls to parse_assignee_filter and wire the returned assignee_ids and include_unassigned into service calls.
  • Remove the prior local _parse_assignee_filter implementation and related duplication from router.py.
  • Add unit tests: new tests/unit/test_case_filters.py to validate parsing behavior (legacy and frontend sentinels, mixed UUID + sentinel, and invalid identifier), and extend tests/unit/api/test_api_cases.py with two tests to ensure the API accepts the frontend sentinel and forwards it into service method calls.

Testing

  • Ran pytest tests/unit/test_case_filters.py and the new tests passed.
  • Ran the updated API unit tests pytest tests/unit/api/test_api_cases.py::test_search_cases_accepts_frontend_unassigned_sentinel and pytest tests/unit/api/test_api_cases.py::test_search_case_aggregates_accepts_frontend_unassigned_sentinel, and both passed.
  • Ran pytest tests/unit -q to validate the unit test suite for the changed modules and all tests completed successfully.

Codex Task


Summary by cubic

Centralized assignee filter parsing and added support for the frontend "UNASSIGNED" sentinel so searches include unassigned cases correctly. This removes duplicated parsing in routers and ensures consistent service call parameters.

  • New Features

    • Accept "UNASSIGNED" (and legacy "unassigned") in assignee filters; include_unassigned is set correctly.
    • When the sentinel is used, API forwards assignee_ids=None and include_unassigned=True to services.
  • Refactors

    • Added parse_assignee_filter in tracecat/cases/filters.py and removed inline parsing from cases/router.py and cases/internal_router.py.
    • Added unit tests for parser behavior and API endpoints.

Written for commit 5aafecd. Summary will update on new commits.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 5 files

@daryllimyt daryllimyt changed the title Centralize assignee filter parsing and accept frontend unassigned sentinel fix: Centralize assignee filter parsing and accept frontend unassigned sentinel Mar 4, 2026
@daryllimyt daryllimyt requested a review from jordan-umusu March 4, 2026 20:41
@daryllimyt daryllimyt merged commit b6d4fc5 into main Mar 4, 2026
19 checks passed
@daryllimyt daryllimyt deleted the codex/fix-unassigned-case-filtering-error branch March 4, 2026 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants