Conversation
5dad2d4 to
f64e602
Compare
| t.Run("IndexThatDoesNotExistIgnore", func(t *testing.T) { | ||
| t.Parallel() | ||
|
|
||
| // Postgres runs the drop with `CONCURRENTLY` so this must use a full | ||
| // schema rather than a transaction block. | ||
| driver, schema := driverWithSchema(ctx, t, nil) | ||
|
|
||
| err := driver.GetExecutor().IndexDropIfExists(ctx, &riverdriver.IndexDropIfExistsParams{ | ||
| Index: "does_not_exist", | ||
| Schema: schema, | ||
| }) | ||
| require.NoError(t, err) | ||
| }) |
There was a problem hiding this comment.
@brandur hmm, this test was actually just an empty block before the split and Codex attempted to fix it. However it can't work in a tx as the other tests do because you can't run DROP INDEX CONCURRENTLY inside a transaction.
I filled it out using the same pattern as the above test to grab a full schema instead of txn.
Instead of a giant 5000 line file, split into smaller files grouped by entity. For job queries where we have many tests, break them into files by query type.
f64e602 to
ebfd00d
Compare
|
@brandur after rebasing post #1140 I wanted to make sure we kept that coverage and did another analysis, this time with Opus 4.6. It found one minor issue that was fixed but otherwise 👍
|
brandur
left a comment
There was a problem hiding this comment.
Cool. Definitely nice to have the AI review as it'd be really hard to tell from the diff here if something was lost in the refactor.
I'm up for trying it! My only small concern is that you now have job-related operations broken into files that aren't necessarily suggestive from their name (i.e. you'd have to think for a bit to see that something like JobCount would be found in job_read.go). We should maybe look at an alternate scheme if that gets annoying.
|
Yeah, I'm open to any structure. I was compelled to split job queries beyond one file because they're basically half the overall line count. I don't have any preference on exact names or dividing lines though. I feel pretty good about it after multiple agents reviewing via different models and techniques. Agree it would have to be done in small obvious pieces otherwise. |
@brandur hit a point where I felt like this file is just too unwieldy. Instead of a giant 5000 line file, this splits them into smaller files grouped by entity. For job queries where we have many tests, break them into files by query type.
Let me know if you think this would be an improvement broadly. It's easy to tweak as it's a mostly AI-driven refactor. FWIW I also spun up a separate session and had it cross check every removed line to verify it was moved without being altered (other than setup details)—all good there. ✅