Skip to content

chore: refactor codersdk.Client creation with functional args#19759

Merged
spikecurtis merged 2 commits into
mainfrom
spike/client-builder
Sep 22, 2025
Merged

chore: refactor codersdk.Client creation with functional args#19759
spikecurtis merged 2 commits into
mainfrom
spike/client-builder

Conversation

@spikecurtis
Copy link
Copy Markdown
Contributor

@spikecurtis spikecurtis commented Sep 10, 2025

Adds ClientBuilder to build a codersdk.Client. This is a safer pattern than the current usage which modifies properties of the Client after creating it, opening us up to race conditions.

Refactors agentsdk to use the builder.

Copy link
Copy Markdown
Contributor Author

spikecurtis commented Sep 10, 2025

Comment thread codersdk/builder.go Outdated
@spikecurtis spikecurtis changed the title chore: refactor codersdk.Client creation into builder chore: refactor codersdk.Client creation with functional args Sep 18, 2025
Copy link
Copy Markdown
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making the change, looks good 👍🏻

Comment thread codersdk/agentsdk/agentsdk.go
Comment thread codersdk/client.go Outdated
@spikecurtis spikecurtis merged commit 5c2b9a5 into main Sep 22, 2025
27 checks passed
@spikecurtis spikecurtis deleted the spike/client-builder branch September 22, 2025 11:59
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 22, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants