Skip to content

chore: refactor to directly create Client in Command Handlers#19760

Merged
spikecurtis merged 1 commit into
mainfrom
spike/init-client-directly
Sep 22, 2025
Merged

chore: refactor to directly create Client in Command Handlers#19760
spikecurtis merged 1 commit into
mainfrom
spike/init-client-directly

Conversation

@spikecurtis
Copy link
Copy Markdown
Contributor

@spikecurtis spikecurtis commented Sep 10, 2025

Refactors the CLI to create the *codersdk.Client in the handlers. This is groundwork for changing the rootCmd.InitClient() to use the new ClientOption​s.

It also improves variable locality, scoping the Client to the handler. This makes misuse less likely and reduces the memory allocations to just the command being executed, rather than allocating a Client for every command regardless of whether it is executed.

Copy link
Copy Markdown
Contributor Author

spikecurtis commented Sep 10, 2025

@spikecurtis spikecurtis marked this pull request as ready for review September 10, 2025 11:26
@github-actions github-actions Bot added the stale This issue is like stale bread. label Sep 18, 2025
@spikecurtis spikecurtis removed the stale This issue is like stale bread. label Sep 18, 2025
@spikecurtis spikecurtis force-pushed the spike/init-client-directly branch 2 times, most recently from 40ec132 to be3c72e Compare September 18, 2025 10:13
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.

I'm a 🪭!

@spikecurtis spikecurtis force-pushed the spike/init-client-directly branch from be3c72e to 3e0c9c1 Compare September 22, 2025 11:48
@spikecurtis spikecurtis changed the base branch from spike/client-builder to graphite-base/19760 September 22, 2025 11:59
@spikecurtis spikecurtis force-pushed the spike/init-client-directly branch from 3e0c9c1 to a1b320d Compare September 22, 2025 11:59
@graphite-app graphite-app Bot changed the base branch from graphite-base/19760 to main September 22, 2025 12:00
@spikecurtis spikecurtis force-pushed the spike/init-client-directly branch from a1b320d to 19ea167 Compare September 22, 2025 12:00
Copy link
Copy Markdown
Contributor Author

spikecurtis commented Sep 22, 2025

Merge activity

  • Sep 22, 1:13 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Sep 22, 1:14 PM UTC: @spikecurtis merged this pull request with Graphite.

@spikecurtis spikecurtis merged commit 606ae89 into main Sep 22, 2025
27 checks passed
@spikecurtis spikecurtis deleted the spike/init-client-directly branch September 22, 2025 13:14
@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