Skip to content

Commit 9d9c2e5

Browse files
committed
Merge remote-tracking branch 'origin/main' into cli-telemetry
2 parents 0649152 + 52bb84a commit 9d9c2e5

36 files changed

+515
-462
lines changed

.github/dependabot.yaml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ updates:
33
- package-ecosystem: "github-actions"
44
directory: "/"
55
schedule:
6-
interval: "monthly"
6+
interval: "weekly"
77
time: "06:00"
88
timezone: "America/Chicago"
99
labels: []
@@ -28,7 +28,7 @@ updates:
2828
- package-ecosystem: "gomod"
2929
directory: "/"
3030
schedule:
31-
interval: "monthly"
31+
interval: "weekly"
3232
time: "06:00"
3333
timezone: "America/Chicago"
3434
commit-message:
@@ -40,6 +40,18 @@ updates:
4040
update-types:
4141
- version-update:semver-patch
4242

43+
# Update our Dockerfile.
44+
- package-ecosystem: "docker"
45+
directory: "/scripts/"
46+
schedule:
47+
interval: "weekly"
48+
time: "06:00"
49+
timezone: "America/Chicago"
50+
ignore:
51+
# We need to coordinate terraform updates with the version hardcoded in
52+
# our Go code.
53+
- dependency-name: "terraform"
54+
4355
- package-ecosystem: "npm"
4456
directory: "/site/"
4557
schedule:

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141

4242
# Check for any typos!
4343
- name: Check for typos
44-
uses: crate-ci/typos@v1.14.8
44+
uses: crate-ci/typos@v1.14.9
4545
with:
4646
config: .github/workflows/typos.toml
4747
- name: Fix the typos

.github/workflows/security.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ jobs:
163163
- name: Send Slack notification on failure
164164
if: ${{ failure() }}
165165
run: |
166-
msg="❌ CodeQL Failed\n\nhttps://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
166+
msg="❌ Trivy Failed\n\nhttps://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
167167
curl \
168168
-qfsSL \
169169
-X POST \

.github/workflows/stale.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
- name: Checkout repository
3939
uses: actions/checkout@v2
4040
- name: Run delete-old-branches-action
41-
uses: beatlabs/delete-old-branches-action@v0.0.9
41+
uses: beatlabs/delete-old-branches-action@v0.0.10
4242
with:
4343
repo_token: ${{ github.token }}
4444
date: "6 months ago"

cli/agent.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ func (r *RootCmd) workspaceAgent() *clibase.Cmd {
263263
},
264264
{
265265
Flag: "ssh-max-timeout",
266-
Default: "60s",
266+
Default: "0",
267267
Env: "CODER_AGENT_SSH_MAX_TIMEOUT",
268268
Description: "Specify the max timeout for a SSH connection.",
269269
Value: clibase.DurationOf(&sshMaxTimeout),

cli/clitest/clitest.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ func Start(t *testing.T, inv *clibase.Invocation) {
137137
// before ours.
138138
waiter := StartWithWaiter(t, inv)
139139
t.Cleanup(func() {
140+
waiter.Cancel()
140141
<-closeCh
141142
})
142143

@@ -163,11 +164,16 @@ func Run(t *testing.T, inv *clibase.Invocation) {
163164
type ErrorWaiter struct {
164165
waitOnce sync.Once
165166
cachedError error
167+
cancelFunc context.CancelFunc
166168

167169
c <-chan error
168170
t *testing.T
169171
}
170172

173+
func (w *ErrorWaiter) Cancel() {
174+
w.cancelFunc()
175+
}
176+
171177
func (w *ErrorWaiter) Wait() error {
172178
w.waitOnce.Do(func() {
173179
var ok bool
@@ -241,5 +247,5 @@ func StartWithWaiter(t *testing.T, inv *clibase.Invocation) *ErrorWaiter {
241247
cleaningUp.Store(true)
242248
<-doneCh
243249
})
244-
return &ErrorWaiter{c: errCh, t: t}
250+
return &ErrorWaiter{c: errCh, t: t, cancelFunc: cancel}
245251
}

cli/gitssh_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ func prepareTestGitSSH(ctx context.Context, t *testing.T) (*codersdk.Client, str
5858

5959
// start workspace agent
6060
inv, root := clitest.New(t, "agent", "--agent-token", agentToken, "--agent-url", client.URL.String())
61-
agentClient := client
61+
agentClient := codersdk.New(client.URL)
62+
agentClient.SetSessionToken(agentToken)
6263
clitest.SetupConfig(t, agentClient, root)
63-
6464
clitest.Start(t, inv)
6565

6666
coderdtest.AwaitWorkspaceAgents(t, client, workspace.ID)

cli/server_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ func TestServer(t *testing.T) {
121121
)
122122

123123
const superDuperLong = testutil.WaitSuperLong * 3
124-
125124
ctx := testutil.Context(t, superDuperLong)
126125
clitest.Start(t, inv.WithContext(ctx))
127126

@@ -1430,6 +1429,7 @@ func TestServer(t *testing.T) {
14301429
wantConfig.Options[i].Name,
14311430
)
14321431
}
1432+
w.Cancel()
14331433
w.RequireSuccess()
14341434
})
14351435
})
@@ -1460,8 +1460,8 @@ func TestServer(t *testing.T) {
14601460
})
14611461
}
14621462

1463-
//nolint:tparallel,paralleltest // This test spawns or connects to an existing PostgreSQL instance.
14641463
func TestServer_Production(t *testing.T) {
1464+
t.Parallel()
14651465
if runtime.GOOS != "linux" || testing.Short() {
14661466
// Skip on non-Linux because it spawns a PostgreSQL instance.
14671467
t.SkipNow()
@@ -1471,7 +1471,8 @@ func TestServer_Production(t *testing.T) {
14711471
defer closeFunc()
14721472

14731473
// Postgres + race detector + CI = slow.
1474-
ctx := testutil.Context(t, testutil.WaitSuperLong*3)
1474+
ctx, cancelFunc := context.WithTimeout(context.Background(), testutil.WaitSuperLong*3)
1475+
defer cancelFunc()
14751476

14761477
inv, cfg := clitest.New(t,
14771478
"server",

cli/testdata/coder_agent_--help.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Starts the Coder workspace agent.
2121
--prometheus-address string, $CODER_AGENT_PROMETHEUS_ADDRESS (default: 127.0.0.1:2112)
2222
The bind address to serve Prometheus metrics.
2323

24-
--ssh-max-timeout duration, $CODER_AGENT_SSH_MAX_TIMEOUT (default: 60s)
24+
--ssh-max-timeout duration, $CODER_AGENT_SSH_MAX_TIMEOUT (default: 0)
2525
Specify the max timeout for a SSH connection.
2626

2727
--tailnet-listen-port int, $CODER_AGENT_TAILNET_LISTEN_PORT (default: 0)

cli/vscodessh_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ func TestVSCodeSSH(t *testing.T) {
6868
}
6969
return len(entries) > 0
7070
}, testutil.WaitLong, testutil.IntervalFast)
71+
waiter.Cancel()
7172

7273
if err := waiter.Wait(); err != nil {
7374
waiter.RequireIs(context.Canceled)

0 commit comments

Comments
 (0)