Skip to content

Commit 0e9437e

Browse files
committed
Merge branch 'main' into dean/user-maintenance-window
2 parents 3dbd077 + 19f5835 commit 0e9437e

File tree

160 files changed

+3490
-2263
lines changed

Some content is hidden

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

160 files changed

+3490
-2263
lines changed

.devcontainer/Dockerfile

Lines changed: 0 additions & 83 deletions
This file was deleted.

.devcontainer/devcontainer.json

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,12 @@
1-
// For format details, see https://aka.ms/devcontainer.json
21
{
32
"name": "Development environments on your infrastructure",
4-
5-
// Sets the run context to one level up instead of the .devcontainer folder.
6-
"context": ".",
7-
8-
// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename.
9-
"dockerFile": "Dockerfile",
10-
11-
// Use 'forwardPorts' to make a list of ports inside the container available locally.
12-
// "forwardPorts": [],
13-
14-
"postStartCommand": "dockerd",
15-
16-
// privileged is required by GitHub codespaces - https://github.com/microsoft/vscode-dev-containers/issues/727
17-
"runArgs": [
18-
"--cap-add=SYS_PTRACE",
19-
"--security-opt",
20-
"seccomp=unconfined",
21-
"--privileged",
22-
"--init"
23-
]
3+
"image": "codercom/oss-dogfood:latest",
4+
5+
"features": {
6+
// See all possible options here https://github.com/devcontainers/features/tree/main/src/docker-in-docker
7+
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
8+
},
9+
// SYS_PTRACE to enable go debugging
10+
// without --priviliged the Github Codespace build fails (not required otherwise)
11+
"runArgs": ["--cap-add=SYS_PTRACE", "--privileged"]
2412
}

.github/actions/setup-go/action.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: |
44
inputs:
55
version:
66
description: "The Go version to use."
7-
default: "1.20.5"
7+
default: "1.20.6"
88
runs:
99
using: "composite"
1010
steps:

.github/dependabot.yaml

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ updates:
4848
patterns:
4949
- "go.nhat.io/otelsql"
5050
- "go.opentelemetry.io/otel*"
51+
golang-x:
52+
patterns:
53+
- "golang.org/x/*"
5154

5255
# Update our Dockerfile.
5356
- package-ecosystem: "docker"
@@ -89,23 +92,36 @@ updates:
8992
- dependency-name: "@types/node"
9093
update-types:
9194
- version-update:semver-major
92-
93-
- package-ecosystem: "terraform"
94-
directory: "/examples/templates"
95-
schedule:
96-
interval: "monthly"
97-
time: "06:00"
98-
timezone: "America/Chicago"
99-
commit-message:
100-
prefix: "chore"
101-
labels: []
102-
ignore:
103-
# We likely want to update this ourselves.
104-
- dependency-name: "coder/coder"
10595
groups:
106-
examples-terraform:
96+
npm-react:
10797
patterns:
108-
- "*"
98+
- "react*"
99+
- "@types/react*"
100+
npm-xterm:
101+
patterns:
102+
- "xterm*"
103+
npm-xstate:
104+
patterns:
105+
- "xstate"
106+
- "@xstate*"
107+
npm-mui:
108+
patterns:
109+
- "@mui*"
110+
npm-storybook:
111+
patterns:
112+
- "@storybook*"
113+
- "storybook*"
114+
npm-eslint:
115+
patterns:
116+
- "eslint*"
117+
- "@eslint*"
118+
- "@typescript-eslint/eslint-plugin"
119+
- "@typescript-eslint/parser"
120+
npm-jest:
121+
patterns:
122+
- "jest*"
123+
- "@swc/jest"
124+
- "@types/jest"
109125

110126
# Update dogfood.
111127
- package-ecosystem: "docker"

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ jobs:
122122
123123
# Check for any typos
124124
- name: Check for typos
125-
uses: crate-ci/typos@v1.14.12
125+
uses: crate-ci/typos@v1.16.0
126126
with:
127127
config: .github/workflows/typos.toml
128128

.github/workflows/typos.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Jetbrains = "JetBrains"
44
IST = "IST"
55
MacOS = "macOS"
66
AKS = "AKS"
7+
O_WRONLY = "O_WRONLY"
78

89
[default.extend-words]
910
AKS = "AKS"
@@ -25,4 +26,6 @@ extend-exclude = [
2526
"**XService**.ts",
2627
"**identity.go",
2728
"scripts/ci-report/testdata/**",
29+
"**/*_test.go",
30+
"**/*.test.tsx"
2831
]

.golangci.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
# Over time we should try tightening some of these.
33

44
linters-settings:
5+
exhaustruct:
6+
include:
7+
# Gradually extend to cover more of the codebase.
8+
- 'httpmw\.\w+'
59
gocognit:
610
min-complexity: 46 # Min code complexity (def 30).
711

@@ -195,6 +199,10 @@ issues:
195199
# We use assertions rather than explicitly checking errors in tests
196200
- errcheck
197201
- forcetypeassert
202+
- exhaustruct # This is unhelpful in tests.
203+
- path: scripts/*
204+
linters:
205+
- exhaustruct
198206

199207
fix: true
200208
max-issues-per-linter: 0
@@ -219,6 +227,7 @@ linters:
219227
- errcheck
220228
- errname
221229
- errorlint
230+
- exhaustruct
222231
- exportloopref
223232
- forcetypeassert
224233
- gocritic

agent/usershell/usershell_darwin.go

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,25 @@
11
package usershell
22

3-
import "os"
3+
import (
4+
"os"
5+
"os/exec"
6+
"path/filepath"
7+
"strings"
8+
9+
"golang.org/x/xerrors"
10+
)
411

512
// Get returns the $SHELL environment variable.
6-
func Get(_ string) (string, error) {
7-
return os.Getenv("SHELL"), nil
13+
func Get(username string) (string, error) {
14+
// This command will output "UserShell: /bin/zsh" if successful, we
15+
// can ignore the error since we have fallback behavior.
16+
out, _ := exec.Command("dscl", ".", "-read", filepath.Join("/Users", username), "UserShell").Output()
17+
s, ok := strings.CutPrefix(string(out), "UserShell: ")
18+
if ok {
19+
return strings.TrimSpace(s), nil
20+
}
21+
if s = os.Getenv("SHELL"); s != "" {
22+
return s, nil
23+
}
24+
return "", xerrors.Errorf("shell for user %q not found via dscl or in $SHELL", username)
825
}

agent/usershell/usershell_other.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,8 @@ func Get(username string) (string, error) {
2727
}
2828
return parts[6], nil
2929
}
30-
return "", xerrors.Errorf("user %q not found in /etc/passwd", username)
30+
if s := os.Getenv("SHELL"); s != "" {
31+
return s, nil
32+
}
33+
return "", xerrors.Errorf("shell for user %q not found in /etc/passwd or $SHELL", username)
3134
}

agent/usershell/usershell_other_test.go

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)