Repository navigation
refactor(codersdk): move chat settings client methods onto request helpers - #30962
ibetitsmike wants to merge 3 commits into
Conversation
…lpers Move the 33 chat settings client methods (the /chats/config endpoints and the organization model overrides) onto requestJSON and requestNoContent. Each converted method keeps its signature, HTTP method, path, body, and expected status. Error results are unchanged.
|
@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. Keep them coming! 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". |
|
@codex review
|
|
Codex Review: Didn't find any major issues. You're on a roll. 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". |
Moves the 33 chat settings client methods in
codersdk/chats.goonto therequestJSONandrequestNoContenthelpers from #30961: the deployment, organization, and user settings under/chats/config, and the organization model overrides. Each method drops its own request, status check, and decode block, so the file loses 283 lines.Why it is safe: the script from #30961 did the conversion, and this diff is exactly its output. It rewrites a method only when its body ends in the standard block, with a zero value that matches the decoded type, and it keeps the HTTP method, path, body, and expected status. #30961 shows that the helpers return the same errors as the code they replace.
-coverpkg=./codersdk, every converted method's success path runs.go test -overlay) fail existing coderd tests:UpdateOrganizationChatModelOverridewithout a body (TestChatModelOverrides),DeleteUserChatCompactionThresholdsending GET (TestUserChatCompactionThresholds),GetChatAdvisorConfigexpecting 201 (TestChatAdvisorConfig_GetDefault), andGetChatRetentionDaysreading the debug retention path (TestChatRetentionDays).Review focus: each hunk swaps one block for one call, so check the status argument against the deleted check.
UpdateOrganizationChatModelOverride,UpdateUserChatCustomPrompt, andUpdateUserChatCompactionThresholdreturn a body with 200. The other updates expect 204.Validation:
go test ./codersdk -count=1passes,golangci-lint run ./codersdk/reports 0 issues, and the pre-commit hook passed.Stack
This stack removes two unused chat exports from
codersdkand moves 72 chat client methods incodersdk/chats.goonto two shared request helpers. Client behavior does not change.