-
Notifications
You must be signed in to change notification settings - Fork 564
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
[Feature] Find Tasks with advanced filtering #8725
base: develop
Are you sure you want to change the base?
Conversation
WalkthroughThis pull request introduces an advanced task filtering mechanism across multiple files in the task management system. The changes centralize task filtering options by creating a new Changes
Sequence DiagramsequenceDiagram
participant Client
participant Controller
participant Service
participant Repository
Client->>Controller: Request tasks with advanced filters
Controller->>Service: Call task retrieval method with filters
Service->>Service: Build advanced where condition
Service->>Repository: Execute query with advanced filters
Repository-->>Service: Return filtered tasks
Service-->>Controller: Return paginated tasks
Controller-->>Client: Respond with filtered tasks
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
⏰ Context from checks skipped due to timeout of 90000ms (3)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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: 3
🧹 Nitpick comments (4)
packages/contracts/src/lib/task.model.ts (2)
113-129
: LGTM! Comprehensive and well-organized filtering interface.The interface provides a flexible and extensive set of filtering options. Good use of optional properties and consistent typing with ID.
Consider adding JSDoc comments to document the purpose and usage of each filter property, especially for less obvious ones like
dailyPlans
.
131-133
: Consider removing potentially redundant interface.The
IAdvancedTaskFiltering
interface seems redundant as it only wraps an optionalITaskAdvancedFilter
. Consider usingITaskAdvancedFilter
directly since its properties are already optional.-export interface IAdvancedTaskFiltering { - filters?: ITaskAdvancedFilter; -}packages/core/src/lib/tasks/task.controller.ts (1)
72-74
: Update API documentation to reflect advanced filtering capabilities.The method signatures have been consistently updated to support advanced filtering, but the @ApiOperation and @ApiResponse decorators need to be updated to document these new capabilities.
For each affected method, update the documentation to include information about the advanced filtering options. Example:
@ApiOperation({ summary: 'Get tasks by pagination.' }) +@ApiOperation({ + summary: 'Get tasks by pagination with advanced filtering options.', + description: 'Retrieves a paginated list of tasks with support for filtering by projects, teams, modules, sprints, members, tags, and more.' +})Also applies to: 122-124, 140-142, 158-160, 227-227, 244-246
packages/core/src/lib/tasks/dto/task-advanced-filter.dto.ts (1)
6-70
: Enhance API documentation with property descriptions.While the implementation is solid, consider adding descriptions to the @ApiPropertyOptional decorators to improve API documentation. This would help API consumers better understand the purpose of each filter.
Example enhancement:
-@ApiPropertyOptional({ type: Array }) +@ApiPropertyOptional({ + type: Array, + description: 'Filter tasks by associated projects' +})Also consider grouping related properties (status/priority/size) together in the class definition for better maintainability.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
packages/contracts/src/lib/task.model.ts
(2 hunks)packages/core/src/lib/tasks/dto/index.ts
(1 hunks)packages/core/src/lib/tasks/dto/task-advanced-filter.dto.ts
(1 hunks)packages/core/src/lib/tasks/task.controller.ts
(7 hunks)packages/core/src/lib/tasks/task.service.ts
(15 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: Codacy Static Code Analysis
- GitHub Check: test
- GitHub Check: build
🔇 Additional comments (5)
packages/contracts/src/lib/task.model.ts (1)
92-99
: LGTM! Well-structured interface extension.The interface properly extends ITaskAdvancedFilter while maintaining specific view-related filters. Good separation of concerns between generic advanced filters and view-specific filters.
packages/core/src/lib/tasks/task.controller.ts (1)
26-33
: LGTM! Well-organized imports.Good use of destructuring and clear naming convention for DTOs.
packages/core/src/lib/tasks/dto/index.ts (1)
6-6
: LGTM! Export follows established pattern.The new export statement follows the existing barrel file pattern and correctly exposes the new DTO.
packages/core/src/lib/tasks/dto/task-advanced-filter.dto.ts (2)
1-5
: LGTM! Clean implementation with proper imports and interface.The class correctly implements the ITaskAdvancedFilter interface and imports all necessary decorators and types.
1-71
: Verify the performance impact of multiple array filters.The DTO allows for multiple array-based filters that could be combined. Ensure that the underlying query implementation can handle these combinations efficiently, especially when multiple filters are used simultaneously.
Let's check the service implementation:
✅ Verification successful
Multiple array filters implementation is performant
The current implementation efficiently handles multiple array filters by:
- Using SQL IN clauses through TypeORM's In operator
- Applying filters at the database level rather than in application memory
- Conditionally including only non-empty filters to avoid unnecessary conditions
The implementation follows database best practices and doesn't require optimization.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Search for the service method handling these filters ast-grep --pattern 'async $method($_) { $$$ where: { $$$ } $$$ }'Length of output: 79
Script:
#!/bin/bash # Find task service files fd "task.*service" packages/core/src # Search for imports of TaskAdvancedFilterDTO rg "TaskAdvancedFilterDTO" -A 5 # Search for query implementations with filters rg "where.*\{" -A 10 packages/core/src/lib/tasksLength of output: 39056
Script:
#!/bin/bash # Search for index definitions in task entity rg "@Index|@Entity" -A 5 packages/core/src/lib/tasks/task.entity.ts # Look for any performance-related configurations rg "typeorm.*config" -A 10 packages/coreLength of output: 1446
View your CI Pipeline Execution ↗ for commit 10b7a30.
☁️ Nx Cloud last updated this comment at |
PR
Please note: we will close your PR without comment if you do not check the boxes above and provide ALL requested information.
Summary by CodeRabbit
Release Notes: Task Advanced Filtering Enhancement
New Features
Improvements