fix(coderd): handle ignored errors across coderd packages#22851
Open
fix(coderd): handle ignored errors across coderd packages#22851
Conversation
35dee6d to
9e39484
Compare
Handle previously ignored error return values in coderd: - coderd/chats.go: check sendEvent errors, log on failure - coderd/chatd/chattest: thread testing.TB through server structs, replace log.Printf with t.Logf, check writeSSEEvent errors - coderd/chatd/chattool/createworkspace.go: log UpdateChatWorkspace failure instead of discarding both return values - coderd/chatd/chattool/execute.go: surface ProcessOutput error in the timeout message returned to the caller - coderd/provisionerdserver: log stream.Send failure in the DownloadFile error helper
9e39484 to
83387dd
Compare
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.
Address errcheck violations by properly handling errors that were previously assigned to blank identifiers across
coderd/sub-packages.Changes
chatd/chatprompt
json.Marshalerrors where function signature allows; use static JSON fallback where it does not.chatd/chatloop/compaction
json.Marshalerrors fromtryCompact; use static JSON fallback inpublishCompactionErrorhelper.chatd/chattest
log.Printf; return early from streaming handlers onwriteSSEEventfailure.chatd/chattool/createworkspace
UpdateChatWorkspaceerror at warn level via new logger field onCreateWorkspaceOptions.chatd/chattool/execute
ProcessOutputerror to timeout message so it is visible inExecuteResult.Error.chats.go
sendEventerrors at debug level, matching patterns already used elsewhere in the same file.database/db2sdk
json.Unmarshal; use static JSON fallbacks forjson.Marshalon known-safe map types.provisionerdserver
stream.Sendfailure at warn level with both send and original error context.provisionerjobs, workspaceagents, workspacebuilds
//nolint:errcheckfor HTTP response writes where status is already committed (standard pattern in the codebase).Part of the effort to enable
errcheck.check-blankin golangci-lint.🤖 This PR was created with the help of Coder Agents, and reviewed by a human 🏂🏻.