Use env.UserHomeDir(ctx) instead of os.UserHomeDir()#4654
Merged
Conversation
…ilable This makes home directory resolution context-aware, allowing tests to override the home directory via context. Converts callsites in cmd/completion, libs/databrickscfg, experimental/aitools, experimental/ssh, and internal test utilities. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
denik
approved these changes
Mar 4, 2026
Change the InstallMCP field on Agent from func() error to func(ctx context.Context) error so InstallCursor can use env.UserHomeDir(ctx) instead of context.TODO(). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Revert internal/testutil/debug.go to os.UserHomeDir() to avoid an import cycle (libs/env tests import internal/testutil). Update ops_test.go to pass context.Background() to loadOrCreateConfigFile. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
New code should use env.UserHomeDir(ctx) from libs/env instead. Existing callsites that cannot be converted yet are annotated with nolint comments explaining why. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Collaborator
|
Commit: 746cc49
25 interesting tests: 8 FAIL, 7 KNOWN, 7 SKIP, 2 flaky, 1 BUG
Top 21 slowest tests (at least 2 minutes):
|
andrewnester
approved these changes
Mar 4, 2026
Collaborator
|
Commit: 4a3346f
46 interesting tests: 17 FAIL, 16 RECOVERED, 7 KNOWN, 4 flaky, 1 BUG, 1 SKIP
Top 50 slowest tests (at least 2 minutes):
|
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.
Summary
os.UserHomeDir()toenv.UserHomeDir(ctx)at callsites where context is availablecmd/completion,libs/databrickscfg,experimental/aitools,experimental/ssh/internal/server, and internal test utilitiesInstallMCPand agentConfigDirfunction signaturesforbidigolinter rule to reject newos.UserHomeDir()callslibs/gitandexperimental/ssh(public API changes) are annotated withnolintand left for separate PRsTest plan
experimental/aitoolstests passmake lintfullpasses with zero issues🤖 Generated with Claude Code