-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Fix issue filters on list endpoint #8119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: preview
Are you sure you want to change the base?
Conversation
WalkthroughThe Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant Endpoint as IssueListCreateAPIEndpoint
participant Backend as ComplexFilterBackend
participant Legacy as issue_filters
Client->>Endpoint: GET /issues (with JSON or query params)
rect rgb(200,220,255)
Note over Endpoint,Backend: JSON filter phase
Endpoint->>Backend: filter_queryset(issue_queryset)
Backend-->>Endpoint: filtered_issue_queryset
Endpoint->>Backend: filter_queryset(total_issue_queryset)
Backend-->>Endpoint: filtered_total_issue_queryset
end
rect rgb(220,200,255)
Note over Endpoint,Legacy: Legacy query-param phase
Endpoint->>Legacy: issue_filters(request.query_params, "GET")
Legacy-->>Endpoint: legacy_filters (if any)
Endpoint->>Endpoint: apply legacy_filters to both querysets
end
Endpoint-->>Client: paginated & filtered issue response
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (3)📓 Common learnings📚 Learning: 2025-10-29T09:17:54.815ZApplied to files:
📚 Learning: 2025-07-23T18:18:06.875ZApplied to files:
🧬 Code graph analysis (1)apps/api/plane/api/views/issue.py (5)
🔇 Additional comments (3)
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. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
apps/api/plane/api/views/issue.py(3 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: NarayanBavisetti
Repo: makeplane/plane PR: 7460
File: apps/api/plane/app/serializers/draft.py:112-122
Timestamp: 2025-07-23T18:18:06.875Z
Learning: In the Plane codebase serializers, workspace_id is not consistently passed in serializer context, so parent issue validation in DraftIssueCreateSerializer only checks project_id rather than both workspace_id and project_id. The existing project member authentication system already validates that users can only access projects they belong to, providing sufficient security without risking breaking functionality by adding workspace_id validation where the context might not be available.
Learnt from: NarayanBavisetti
Repo: makeplane/plane PR: 7905
File: apps/api/plane/app/views/search/base.py:241-276
Timestamp: 2025-10-29T09:17:54.815Z
Learning: In apps/api/plane/app/views/search/base.py, the `filter_intakes` method uses `Issue.objects` (base manager) instead of `Issue.issue_objects` (custom manager) because the custom manager filters out all intake statuses, which would prevent querying pending and snoozed intake issues.
📚 Learning: 2025-10-29T09:17:54.815Z
Learnt from: NarayanBavisetti
Repo: makeplane/plane PR: 7905
File: apps/api/plane/app/views/search/base.py:241-276
Timestamp: 2025-10-29T09:17:54.815Z
Learning: In apps/api/plane/app/views/search/base.py, the `filter_intakes` method uses `Issue.objects` (base manager) instead of `Issue.issue_objects` (custom manager) because the custom manager filters out all intake statuses, which would prevent querying pending and snoozed intake issues.
Applied to files:
apps/api/plane/api/views/issue.py
🧬 Code graph analysis (1)
apps/api/plane/api/views/issue.py (5)
apps/api/plane/utils/filters/filter_backend.py (1)
ComplexFilterBackend(10-313)apps/api/plane/utils/filters/filterset.py (1)
IssueFilterSet(120-262)apps/api/plane/utils/issue_filters.py (1)
issue_filters(424-459)apps/api/plane/api/views/base.py (1)
filter_queryset(55-58)apps/api/plane/app/views/base.py (1)
filter_queryset(158-161)
🔇 Additional comments (1)
apps/api/plane/api/views/issue.py (1)
53-54: LGTM: Imports are correct.The imports for ComplexFilterBackend, IssueFilterSet, and issue_filters are properly structured and match the available utilities.
Move filter_backends and filterset_class from WorkspaceIssueAPIEndpoint to IssueListCreateAPIEndpoint where self.filter_queryset() is actually called. This resolves the issue identified by CodeRabbit review where the filter configuration was on a different class than where it was being used.
Description
In Plane CE
v1.1.0the project issues list endpoint (IssueListCreateAPIEndpoint) is not wired to DRF’s filter stack, so query params such aspriority=urgentare ignored and pagination counts reflect the entire project instead of the filtered subset. This patch imports the existingComplexFilterBackend,IssueFilterSet, and legacyissue_filters, applying them to both the result and total-count querysets so the REST API mirrors the in-product filtering behavior.Type of Change
Screenshots and Media (if applicable)
Not applicable
Test Scenarios
curl https://plane.domain.tld/api/v1/workspaces/<slug>/projects/<project_id>/issues/?priority=urgentstate_groupfilters to ensure other query params work as expected.References
Not applicable
Summary by CodeRabbit