FIX: #13846: General task not retrieved - #13870
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughWhen building task query filters, region- and district-based OR predicates were extended to also require tasks to have TaskContext.GENERAL. A unit test was added to verify that GENERAL-context tasks scoped to a region/district appear in task directory queries. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
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.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@sormas-backend/src/test/java/de/symeda/sormas/backend/task/TaskFacadeEjbTest.java`:
- Around line 123-149: The test testTaskDirectoryForGeneralTasks in
TaskFacadeEjbTest currently calls getIndexList(new
TaskCriteria().taskContext(TaskContext.GENERAL).taskStatus(TaskStatus.DONE),
...) but does not set region or district so the new GENERAL-path in
TaskService.buildCriteriaFilter (which only runs when taskCriteria.getRegion()
!= null or getDistrict() != null) is not exercised; update the test to set
either taskCriteria.region(...) or taskCriteria.district(...) (use the created
rdcf.region/district UUIDs or their references) before calling getIndexList so
the TaskContext.GENERAL branch in buildCriteriaFilter is executed and the
assertion validates the fix.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 5108336d-74b5-4005-96cf-d0b3a70456e1
📒 Files selected for processing (2)
sormas-backend/src/main/java/de/symeda/sormas/backend/task/TaskService.javasormas-backend/src/test/java/de/symeda/sormas/backend/task/TaskFacadeEjbTest.java
|
SonarCloud analysis: https://sonarcloud.io/dashboard?id=SORMAS-Project&pullRequest=13870 |
1 similar comment
|
SonarCloud analysis: https://sonarcloud.io/dashboard?id=SORMAS-Project&pullRequest=13870 |
|
This naive implementation has one downside: general tasks will be retrieved BUT they will not be attached to region or district, therefore for countries actively using regions and districts all general tasks will be returned without able to distinguish between a district or region. Those information could be added in the task entity for general tasks only |
Fixes #13846
Summary by CodeRabbit
Bug Fixes
Tests