Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8115 +/- ##
=======================================
Coverage 85.47% 85.47%
=======================================
Files 650 650
Lines 42416 42422 +6
Branches 4980 4981 +1
=======================================
+ Hits 36253 36259 +6
Misses 5055 5055
Partials 1108 1108 ☔ 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
adamsachs
left a comment
There was a problem hiding this comment.
BE looks straightforward here, just a small nit for consideration
Ticket ENG-3250
Description Of Changes
Add
group_idcolumn toMonitorTaskmodel andis_monitor_task_paused()function to support task stopping in fidesplus.group_id: nullable indexed column that groups tasks spawned from a single classify operation, enabling batch stoppingis_monitor_task_paused(): checks if a task's status isawaiting_processing(the paused/stopped state)This is the fides-side companion to fidesplus PR #3525.
Code Changes
group_idcolumn toMonitorTaskmodelis_monitor_task_paused()standalone function9f21507db078pausedfromisInProgressstatuses, simplifiedformatStatusForDisplay, removedpausedfrom default status filtersgroup_idandis_monitor_task_paused()db_dataset.ymlwithgroup_iddata category annotationSteps to Confirm
group_idcolumn is added tomonitortasktablePre-Merge Checklist
CHANGELOG.mdupdatedmaindowngrade()migration is correct and works