Repository navigation
refactor: delete the FinalizeStaleChatDebugRows query - #30995
Draft
ibetitsmike wants to merge 1 commit into
Draft
ibetitsmike wants to merge 1 commit into
ibetitsmike wants to merge 1 commit into
Conversation
FinalizeStale was the only caller, and it is gone. Delete the query, its dbauthz wrapper and test, and TestFinalizeStaleChatDebugRows. The two partial indexes that served the query stay until a migration drops them.
This was referenced Oct 18, 2026
ibetitsmike
added a commit
that referenced
this pull request
Oct 18, 2026
Moves this layer onto the updated #30933, which now sits on the stale-sweep deletion stack (#30995), without rewriting history. The tree is the new parent plus this layer's own diff, with one forced change: the deletion stack removed the database/sql import from chatdebug/service_test.go because its last user was a deleted test, and this layer's TestService_StartRun still uses sql.NullString, so the merge re-adds the import.
ibetitsmike
added a commit
that referenced
this pull request
Oct 18, 2026
Moves this layer onto the updated #30934, which now sits on the stale-sweep deletion stack (#30995), without rewriting history. The only conflict was the test file's import block: the deletion stack dropped the "time" import with the heartbeat tests, and this layer adds "testing/synctest". The layer's net line changes are unchanged.
ibetitsmike
added a commit
that referenced
this pull request
Oct 18, 2026
…finalize-once Moves this layer onto the updated #30980, which now sits on the stale-sweep deletion stack (#30995), without rewriting history. The deletion stack removed the stream heartbeats, so the merge drops them from the shared lifecycle too: streamStep loses heartbeatDone and startHeartbeat, finalizeLocked no longer closes the heartbeat channel, neither wrapper calls step.startHeartbeat(), and launchHeartbeat is gone. The rest of the layer's diff is unchanged.
ibetitsmike
added this pull request to stack #31004
October 18, 2026 18:59
This was referenced Oct 18, 2026
Draft
Collaborator
Author
|
@codex review
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Deletes the
FinalizeStaleChatDebugRowsquery. #30989 deletedchatdebug.Service.FinalizeStale, its only caller. This is the last of three PRs that delete the stale debug-run sweep.chatdebug.sqland regenerates the querier, dbmock and dbmetrics code.make gen/dbleaves the dbmetrics wrapper of a deleted query behind, so I removed it by hand.TestMethodTestSuitecase, andTestFinalizeStaleChatDebugRowsfromquerier_test.go.codersdk.ChatDebugStatuscomment no longer names the query.Why it is safe: nothing calls the query after #30989. #30988 explains why no reader of the debug
updated_atcolumns needs the sweep and why dbpurge cannot delete a live run.Review focus: the partial indexes
idx_chat_debug_runs_staleandidx_chat_debug_steps_stalefrom migration 000468 served only this query. They stay in this PR; #31009, at the top of this stack, drops them in a migration.Validation:
make gen/dbandgo build ./....go test -count=1passes for./coderd/database/dbauthz/ -run TestMethodTestSuite,./coderd/database/ -run ChatDebug,./codersdk/and./coderd/database/dbpurge/. The pre-commit hook passed.Stack
This stack deletes the stale debug-run sweep, then simplifies the chatdebug debug-run, stream wrapper and step numbering code, and last drops the indexes the sweep used. The debug-run and stream wrapper refactors each sit on a test-only layer that pins the behavior they keep.
FinalizeStaleand the stale thresholdFinalizeStaleChatDebugRowsquery