-
Notifications
You must be signed in to change notification settings - Fork 356
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
chore: bunify db/postgres_tasks.go #8764
Conversation
ddf8078
to
144c316
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #8764 +/- ##
========================================
Coverage 47.68% 47.69%
========================================
Files 1049 1049
Lines 167345 167230 -115
Branches 2241 2239 -2
========================================
- Hits 79804 79762 -42
+ Misses 87383 87310 -73
Partials 158 158
Flags with carried forward coverage won't be shown. Click here to find out more.
|
4dac9bf
to
e7c9565
Compare
42c737d
to
fac7217
Compare
e7c9565
to
8c2fe83
Compare
fac7217
to
98f5d9d
Compare
32092d7
to
d1bb042
Compare
98f5d9d
to
8897add
Compare
I'm unassigning myself since I don't plan on reviewing this since @stoksc left a comment If you want me to review let me know |
4939a49
to
de1bd2f
Compare
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.
lgtm, modulo some minor comments
8b72e5d
to
da2f941
Compare
de1bd2f
to
76fc2f8
Compare
✅ Deploy Preview for determined-ui canceled.
|
111a5c8
to
91e46dc
Compare
Description
Bunify methods in
db/postgres_tasks.go
, and add a context.Context parameter to those functions.For functions that call methods from
postgres_tasks.go
, definectx := context.Background()
if it's not already passed in as a parameter. For functions that passed in the db as a parameter, but no longer need it because the relevant method is bun-ified, remove the db parameter. (in other words, streamline the substitutions).Remove unused functions in
postgres_test_utils.go, postgres.go
.For the method
completeTrialsTask
, originally inpostgres_tasks.go
, remove the function wrapper, and insert it directly into thepostgres_trials.go
method where it's only used once.errors.Errorf(...) --> fmt.Errorf(...)
for all methods bun-ified, or majorly refactored.Unmocked the db in
telemetry_test.go
since there was a newly bunified db tasks call there -- followed the same template as postgres_tasks_intg_test.go & started the db in TestMain.Test Plan
See
postgres_tasks_intg_test.go
, originally from #8750, but edited here to include context.Context parameters etcCommentary (optional)
To limit the scope of this ticket:
model.TaskLogs
functions. They're tricky (use sql filters, or use queryProto for super long queries, or have better perf with bulk-insert than Bun), and part of theTaskLogBackend
interface. Honestly, I think this deserves its own ticket if we prioritize bun-ifying it. Untangling the db struct from theTaskLogBackend
interface also isn't super obvious.db/postgres_tasks.go
to thetask
module. The task db functions are called in several places within the db module still, so if we attempt to move it out before all these other calls are in separate modules, then we'll get a very messy import cycle. I propose bunifying all files in db first (or at least the job/cluster/checkpoint/experiment/trial) and then moving to their respective module. I'm happy to create another ticket or JIRA epic on the order of bunifying the db module & moving them if the team cares -- but (1) is this a high enough priority and (2) will this be a cluster/resource management/?? responsibility?Checklist
docs/release-notes/
.See Release Note for details.
Ticket
DET-7957