Skip to content

Commit dba720e

Browse files
committed
Merge branch 'main' into colin/tailscale-up-retry
2 parents 6246b07 + e951778 commit dba720e

File tree

492 files changed

+9321
-4806
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

492 files changed

+9321
-4806
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/dogfood.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ on:
66
- main
77
paths:
88
- "dogfood/**"
9-
pull_request:
10-
paths:
11-
- "dogfood/**"
9+
# Uncomment these lines when testing with CI.
10+
# pull_request:
11+
# paths:
12+
# - "dogfood/**"
1213
workflow_dispatch:
1314

1415
jobs:

.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 \

.gitignore

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ site/e2e/test-results/*
2929
site/e2e/states/*.json
3030
site/playwright-report/*
3131
site/.swc
32+
site/dist/
3233

3334
# Make target for updating golden files (any dir).
3435
.gen-golden
@@ -47,8 +48,14 @@ site/stats/
4748
*.lock.hcl
4849
.terraform/
4950

50-
/.coderv2/*
51+
**/.coderv2/*
5152
**/__debug_bin
5253

5354
# direnv
5455
.envrc
56+
*.test
57+
58+
# Loadtesting
59+
./scaletest/terraform/.terraform
60+
./scaletest/terraform/.terraform.lock.hcl
61+
terraform.tfstate.*

.prettierignore

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ site/e2e/test-results/*
3232
site/e2e/states/*.json
3333
site/playwright-report/*
3434
site/.swc
35+
site/dist/
3536

3637
# Make target for updating golden files (any dir).
3738
.gen-golden
@@ -50,11 +51,17 @@ site/stats/
5051
*.lock.hcl
5152
.terraform/
5253

53-
/.coderv2/*
54+
**/.coderv2/*
5455
**/__debug_bin
5556

5657
# direnv
5758
.envrc
59+
*.test
60+
61+
# Loadtesting
62+
./scaletest/terraform/.terraform
63+
./scaletest/terraform/.terraform.lock.hcl
64+
terraform.tfstate.*
5865
# .prettierignore.include:
5966
# Helm templates contain variables that are invalid YAML and can't be formatted
6067
# by Prettier.

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
"codersdk",
2121
"cronstrue",
2222
"databasefake",
23+
"dbfake",
24+
"dbgen",
2325
"dbtype",
2426
"DERP",
2527
"derphttp",
@@ -34,6 +36,7 @@
3436
"Dsts",
3537
"embeddedpostgres",
3638
"enablements",
39+
"enterprisemeta",
3740
"errgroup",
3841
"eventsourcemock",
3942
"Failf",

Makefile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ cli/testdata/.gen-golden: $(wildcard cli/testdata/*.golden) $(wildcard cli/*.tpl
526526
go test ./cli -run="Test(CommandHelp|ServerYAML)" -update
527527
touch "$@"
528528

529-
helm/tests/testdata/.gen-golden: $(wildcard helm/tests/testdata/*.golden) $(GO_SRC_FILES)
529+
helm/tests/testdata/.gen-golden: $(wildcard helm/tests/testdata/*.yaml) $(wildcard helm/tests/testdata/*.golden) $(GO_SRC_FILES)
530530
go test ./helm/tests -run=TestUpdateGoldenFiles -update
531531
touch "$@"
532532

@@ -595,7 +595,7 @@ site/.eslintignore site/.prettierignore: .prettierignore Makefile
595595
done < "$<"
596596

597597
test: test-clean
598-
gotestsum -- -v -short ./...
598+
gotestsum --format standard-quiet -- -v -short ./...
599599
.PHONY: test
600600

601601
# When updating -timeout for this test, keep in sync with
@@ -608,9 +608,8 @@ test-postgres: test-clean test-postgres-docker
608608
--jsonfile="gotests.json" \
609609
--packages="./..." -- \
610610
-covermode=atomic -coverprofile="gotests.coverage" -timeout=20m \
611-
-parallel=4 \
612611
-coverpkg=./... \
613-
-count=1 -race -failfast
612+
-race -failfast
614613
.PHONY: test-postgres
615614

616615
test-postgres-docker:
@@ -627,6 +626,8 @@ test-postgres-docker:
627626
--detach \
628627
postgres:13 \
629628
-c shared_buffers=1GB \
629+
-c work_mem=1GB \
630+
-c effective_cache_size=1GB \
630631
-c max_connections=1000 \
631632
-c fsync=off \
632633
-c synchronous_commit=off \

agent/agent_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1020,7 +1020,7 @@ func TestAgentMetadata_Timing(t *testing.T) {
10201020
if runtime.GOOS == "windows" {
10211021
// Shell scripting in Windows is a pain, and we have already tested
10221022
// that the OS logic works in the simpler tests.
1023-
t.Skip()
1023+
t.SkipNow()
10241024
}
10251025
testutil.SkipIfNotTiming(t)
10261026
t.Parallel()

cli/dotfiles.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,10 @@ func (r *RootCmd) dotfiles() *clibase.Cmd {
225225
}
226226
}
227227

228+
// attempt to delete the file before creating a new symlink. This overwrites any existing symlinks
229+
// which are typically leftover from a previous call to coder dotfiles. We do this best effort and
230+
// ignore errors because the symlink may or may not exist. Any regular files are backed up above.
231+
_ = os.Remove(to)
228232
err = os.Symlink(from, to)
229233
if err != nil {
230234
return xerrors.Errorf("symlinking %s to %s: %w", from, to, err)

cli/dotfiles_test.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,17 @@ func TestDotfiles(t *testing.T) {
116116
b, err = os.ReadFile(filepath.Join(string(root), ".bashrc.bak"))
117117
require.NoError(t, err)
118118
require.Equal(t, string(b), "backup")
119+
120+
// check for idempotency
121+
inv, _ = clitest.New(t, "dotfiles", "--global-config", string(root), "--symlink-dir", string(root), "-y", testRepo)
122+
err = inv.Run()
123+
require.NoError(t, err)
124+
b, err = os.ReadFile(filepath.Join(string(root), ".bashrc"))
125+
require.NoError(t, err)
126+
require.Equal(t, string(b), "wow")
127+
b, err = os.ReadFile(filepath.Join(string(root), ".bashrc.bak"))
128+
require.NoError(t, err)
129+
require.Equal(t, string(b), "backup")
119130
})
120131
}
121132

cli/root.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,13 @@ func (r *RootCmd) Core() []*clibase.Cmd {
8787

8888
// Workspace Commands
8989
r.configSSH(),
90-
r.rename(),
91-
r.ping(),
9290
r.create(),
9391
r.deleteWorkspace(),
9492
r.list(),
93+
r.parameters(),
94+
r.ping(),
95+
r.rename(),
96+
r.scaletest(),
9597
r.schedules(),
9698
r.show(),
9799
r.speedtest(),
@@ -100,13 +102,11 @@ func (r *RootCmd) Core() []*clibase.Cmd {
100102
r.stop(),
101103
r.update(),
102104
r.restart(),
103-
r.parameters(),
104105

105106
// Hidden
106-
r.workspaceAgent(),
107-
r.scaletest(),
108107
r.gitssh(),
109108
r.vscodeSSH(),
109+
r.workspaceAgent(),
110110
}
111111
}
112112

cli/root_test.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import (
1313
"strings"
1414
"testing"
1515

16+
"github.com/charmbracelet/lipgloss"
17+
"github.com/muesli/termenv"
1618
"github.com/stretchr/testify/assert"
1719
"github.com/stretchr/testify/require"
1820

@@ -33,8 +35,17 @@ var updateGoldenFiles = flag.Bool("update", false, "update .golden files")
3335

3436
var timestampRegex = regexp.MustCompile(`(?i)\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(.\d+)?Z`)
3537

38+
// We need to override the global color profile.
39+
//
40+
//nolint:tparallel,paralleltest
3641
func TestCommandHelp(t *testing.T) {
37-
t.Parallel()
42+
ogColorProfile := lipgloss.ColorProfile()
43+
// ANSI256 escape codes are far easier for humans to parse in a diff,
44+
// but TrueColor is probably more popular with modern terminals.
45+
lipgloss.SetColorProfile(termenv.ANSI)
46+
t.Cleanup(func() {
47+
lipgloss.SetColorProfile(ogColorProfile)
48+
})
3849
rootClient, replacements := prepareTestData(t)
3950

4051
type testCase struct {

0 commit comments

Comments
 (0)