Skip to content

Commit 055fc2e

Browse files
committed
refactor: split coderd/gitauth into two, add cli/gitauth
Ref: #9380
1 parent bc9fdd1 commit 055fc2e

File tree

7 files changed

+6
-7
lines changed

7 files changed

+6
-7
lines changed

agent/agent.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ import (
3737
"github.com/coder/coder/v2/agent/agentssh"
3838
"github.com/coder/coder/v2/agent/reconnectingpty"
3939
"github.com/coder/coder/v2/buildinfo"
40-
"github.com/coder/coder/v2/coderd/database"
41-
"github.com/coder/coder/v2/coderd/gitauth"
40+
"github.com/coder/coder/v2/cli/gitauth"
4241
"github.com/coder/coder/v2/codersdk"
4342
"github.com/coder/coder/v2/codersdk/agentsdk"
4443
"github.com/coder/coder/v2/tailnet"
@@ -523,7 +522,7 @@ func (a *agent) reportLifecycleLoop(ctx context.Context) {
523522
func (a *agent) setLifecycle(ctx context.Context, state codersdk.WorkspaceAgentLifecycle) {
524523
report := agentsdk.PostLifecycleRequest{
525524
State: state,
526-
ChangedAt: database.Now(),
525+
ChangedAt: time.Now().UTC(), // Like `database.Now()`, but avoid importing coderd/database.
527526
}
528527

529528
a.lifecycleMu.Lock()

cli/gitaskpass.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111

1212
"github.com/coder/coder/v2/cli/clibase"
1313
"github.com/coder/coder/v2/cli/cliui"
14-
"github.com/coder/coder/v2/coderd/gitauth"
14+
"github.com/coder/coder/v2/cli/gitauth"
1515
"github.com/coder/coder/v2/codersdk"
1616
"github.com/coder/retry"
1717
)
File renamed without changes.

coderd/gitauth/askpass_test.go renamed to cli/gitauth/askpass_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55

66
"github.com/stretchr/testify/require"
77

8-
"github.com/coder/coder/v2/coderd/gitauth"
8+
"github.com/coder/coder/v2/cli/gitauth"
99
)
1010

1111
func TestCheckCommand(t *testing.T) {
File renamed without changes.

coderd/gitauth/vscode_test.go renamed to cli/gitauth/vscode_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"github.com/spf13/afero"
1111
"github.com/stretchr/testify/require"
1212

13-
"github.com/coder/coder/v2/coderd/gitauth"
13+
"github.com/coder/coder/v2/cli/gitauth"
1414
)
1515

1616
func TestOverrideVSCodeConfigs(t *testing.T) {

cli/root.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ import (
3535
"github.com/coder/coder/v2/cli/clibase"
3636
"github.com/coder/coder/v2/cli/cliui"
3737
"github.com/coder/coder/v2/cli/config"
38+
"github.com/coder/coder/v2/cli/gitauth"
3839
"github.com/coder/coder/v2/coderd"
39-
"github.com/coder/coder/v2/coderd/gitauth"
4040
"github.com/coder/coder/v2/coderd/telemetry"
4141
"github.com/coder/coder/v2/codersdk"
4242
"github.com/coder/coder/v2/codersdk/agentsdk"

0 commit comments

Comments
 (0)