-
Notifications
You must be signed in to change notification settings - Fork 30
When deleting pending dataset, cancel its convert_to_wkw job #9116
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: master
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughAdds cancellation of pending Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 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 (4)📚 Learning: 2025-05-12T13:07:29.637ZApplied to files:
📚 Learning: 2025-04-28T14:18:04.368ZApplied to files:
📚 Learning: 2025-01-27T12:06:42.865ZApplied to files:
📚 Learning: 2025-01-13T09:06:15.202ZApplied to files:
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
🔇 Additional comments (2)
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: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
app/models/dataset/DatasetService.scala(3 hunks)app/models/job/Job.scala(1 hunks)frontend/javascripts/admin/job/job_list_view.tsx(3 hunks)unreleased_changes/9116.md(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-05-12T13:07:29.637Z
Learnt from: frcroth
Repo: scalableminds/webknossos PR: 8609
File: app/models/dataset/Dataset.scala:753-775
Timestamp: 2025-05-12T13:07:29.637Z
Learning: In the `updateMags` method of DatasetMagsDAO (Scala), the code handles different dataset types distinctly:
1. Non-WKW datasets have `magsOpt` populated and use the first branch which includes axisOrder, channelIndex, and credentialId.
2. WKW datasets will have `wkwResolutionsOpt` populated and use the second branch which includes cubeLength.
3. The final branch is a fallback for legacy data.
This ensures appropriate fields are populated for each dataset type.
Applied to files:
app/models/dataset/DatasetService.scala
🧬 Code graph analysis (2)
app/models/dataset/DatasetService.scala (3)
app/models/job/Job.scala (1)
cancelConvertToWkwJobForDataset(214-224)util/src/main/scala/com/scalableminds/util/tools/Fox.scala (6)
Fox(28-228)Fox(230-303)runIf(167-176)s(234-238)s(238-248)s(248-257)webknossos-datastore/app/com/scalableminds/webknossos/datastore/models/datasource/DataSourceStatus.scala (1)
DataSourceStatus(3-12)
app/models/job/Job.scala (5)
app/models/job/JobResultLinks.scala (1)
datasetId(18-18)app/utils/sql/SimpleSQLDAO.scala (1)
run(28-48)app/utils/sql/SqlInterpolation.scala (1)
q(20-39)app/models/job/JobState.scala (1)
JobState(5-8)app/models/job/JobCommand.scala (1)
JobCommand(5-22)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: backend-tests
- GitHub Check: frontend-tests
- GitHub Check: build-smoketest-push
🔇 Additional comments (3)
unreleased_changes/9116.md (1)
1-2: LGTM!The changelog entry accurately describes the new feature and its benefits (no failed job notifications, saves compute).
frontend/javascripts/admin/job/job_list_view.tsx (1)
506-506: LGTM!These column width adjustments improve the table layout consistency. The widths are appropriate for Job Id (120px), Date (190px), and State (120px) content.
app/models/job/Job.scala (1)
214-222: Implementation is correct.The method properly uses
manualStatefor cancellation (consistent with the job cancellation protocol) and correctly filters for active jobs (PENDINGorSTARTED). The query's comparison ofcommandArgs->>'dataset_id'with$datasetIdworks correctly because Slick's SQL interpolation automatically converts ObjectId to its string representation via theObjectIdValuehandler, matching the string-formatted dataset_id stored in the JSON field.
MichaelBuessemeyer
left a 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.
Awesome looks good and works well 🎉
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.
Everything looks nicey dicey 🎲 (wrong pr xD)
When a dataset with a pending conversion job is deleted by the user, that job is now cancelled, so the user won’t get a failed job notification and server compute power is saved.
Also slipped in here: small styling follow-up for #9068
Steps to test:
Issues:
$PR_NUMBER.mdfile inunreleased_changesor use./tools/create-changelog-entry.py)