Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8115 +/- ##
=======================================
Coverage 85.23% 85.23%
=======================================
Files 638 638
Lines 42011 42017 +6
Branches 4937 4938 +1
=======================================
+ Hits 35807 35814 +7
Misses 5096 5096
+ Partials 1108 1107 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
a06b423 to
f9a34f7
Compare
|
/code-review |
There was a problem hiding this comment.
Code Review: Add group_id to MonitorTask (#8115)
The overall shape of the change is clean and focused: add a group_id column + index to MonitorTask, introduce an is_cancelled helper that maps awaiting_processing status to cancellation semantics, and stop showing paused tasks in the in-progress list on the frontend.
Must Fix
is_cancelled is mistyped as @classmethod (monitor_task.py:66): cls is unused in the method body — the method takes a db: Session + celery_id and performs a concrete record lookup. The existing module-level function pattern (create_monitor_task_with_execution_log, update_monitor_task_with_execution_log) is a better fit for this kind of named DB query. Using @classmethod here obscures intent and breaks the semantic contract of classmethods.
Suggestions
isInProgressuses raw string literals instead ofExecutionLogStatusenum values (InProgressMonitorTaskItem.tsx:97): the enum is already imported in the hook layer; using it here prevents silent breakage if values change.formatStatusForDisplayis duplicated in two co-located files (InProgressMonitorTaskItem.tsx:35andInProgressMonitorTasksList.tsx:21): this PR simplified both copies simultaneously, which is a natural moment to extract it into a sharedutils.tsin the same directory.- Test cleanup uses
db.delete()+db.commit()instead oftask.delete(db=db)(test_monitor_task.py:545–547,579–580): inconsistent with the rest of the test file.
Looks Good
group_idcolumn definition (String(255), nullable, indexed) is consistent withcelery_id.- Alembic migration
down_revision = 'd76443a8a2e3'correctly extends the current head — no fork introduced. - Removing
ExecutionLogStatus.PAUSEDfromdefaultStatusFiltersandisInProgressis the right approach; the loader-for-paused-tasks behaviour was the stated problem. - The
is_cancelleddocstring clearly explains theawaiting_processing↔ "paused/cancelled" mapping — good documentation for a non-obvious semantic. - Parametrized
test_is_cancelledcovers all relevant status branches cleanly.
🔬 Codegraph: unavailable
💡 Write /code-review in a comment to re-run this review.
061e3c0 to
40be113
Compare
speaker-ender
left a comment
There was a problem hiding this comment.
minor nits but approving as is
| const isInProgress = [ | ||
| "pending", | ||
| "in_processing", | ||
| "paused", |
There was a problem hiding this comment.
I removed the paused state here because it was showing a spinner, which made it look like the process was still running
Ticket ENG-3250
Description Of Changes
Add
group_idcolumn toMonitorTaskmodel andis_cancelled()class method to support task cancellation in fidesplus.group_id: nullable indexed column that groups tasks spawned from a single classify operation, enabling batch cancellationis_cancelled(): checks if a task's status isawaiting_processing(the cancellation status)This is the fides-side companion to fidesplus PR #3525.
Code Changes
group_idcolumn toMonitorTaskmodelMonitorTask.is_cancelled()class method9f21507db078group_idandis_cancelled()Steps to Confirm
group_idcolumn is added tomonitortasktablePre-Merge Checklist
CHANGELOG.mdupdatedmaindowngrade()migration is correct and works