Skip to content

Commit 287100c

Browse files
committed
Merge branch 'main' into addproxy
2 parents 87b5113 + f76e7b1 commit 287100c

File tree

189 files changed

+5653
-1845
lines changed

Some content is hidden

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

189 files changed

+5653
-1845
lines changed

.github/workflows/coder.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
- name: Checkout
3535
uses: actions/checkout@v2
3636
- name: typos-action
37-
uses: crate-ci/typos@v1.12.8
37+
uses: crate-ci/typos@v1.12.12
3838
with:
3939
config: .github/workflows/typos.toml
4040
- name: Fix Helper
@@ -89,14 +89,14 @@ jobs:
8989
style-lint-golangci:
9090
name: style/lint/golangci
9191
timeout-minutes: 5
92-
runs-on: ubuntu-latest
92+
runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }}
9393
steps:
9494
- uses: actions/checkout@v3
9595
- uses: actions/setup-go@v3
9696
with:
9797
go-version: "~1.19"
9898
- name: golangci-lint
99-
uses: golangci/golangci-lint-action@v3.2.0
99+
uses: golangci/golangci-lint-action@v3.3.0
100100
with:
101101
version: v1.48.0
102102

@@ -171,7 +171,7 @@ jobs:
171171
gen:
172172
name: "style/gen"
173173
timeout-minutes: 8
174-
runs-on: ubuntu-latest
174+
runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }}
175175
needs: changes
176176
if: needs.changes.outputs.docs-only == 'false'
177177
steps:
@@ -276,7 +276,7 @@ jobs:
276276
277277
test-go:
278278
name: "test/go"
279-
runs-on: ${{ matrix.os }}
279+
runs-on: ${{ matrix.os == 'ubuntu-latest' && github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || matrix.os }}
280280
timeout-minutes: 20
281281
strategy:
282282
matrix:
@@ -356,7 +356,7 @@ jobs:
356356

357357
test-go-postgres:
358358
name: "test/go/postgres"
359-
runs-on: ubuntu-latest
359+
runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }}
360360
# This timeout must be greater than the timeout set by `go test` in
361361
# `make test-postgres` to ensure we receive a trace of running
362362
# goroutines. Setting this to the timeout +5m should work quite well
@@ -417,7 +417,7 @@ jobs:
417417

418418
deploy:
419419
name: "deploy"
420-
runs-on: ubuntu-latest
420+
runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }}
421421
timeout-minutes: 30
422422
needs: changes
423423
if: |

.github/workflows/dogfood.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
steps:
1818
- name: Get branch name
1919
id: branch-name
20-
uses: tj-actions/branch-names@v6.1
20+
uses: tj-actions/branch-names@v6.2
2121

2222
- name: "Branch name to Docker tag name"
2323
id: docker-tag-name

.github/workflows/release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ env:
2626

2727
jobs:
2828
release:
29-
runs-on: ubuntu-latest
29+
runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }}
3030
env:
3131
# Necessary for Docker manifest
3232
DOCKER_CLI_EXPERIMENTAL: "enabled"

.github/workflows/typos.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ MacOS = "macOS"
77
[default.extend-words]
88
# do as sudo replacement
99
doas = "doas"
10+
darcula = "darcula"
1011

1112
[files]
1213
extend-exclude = [

agent/apphealth.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func NewWorkspaceAppHealthReporter(logger slog.Logger, apps []codersdk.Workspace
3333
hasHealthchecksEnabled := false
3434
health := make(map[string]codersdk.WorkspaceAppHealth, 0)
3535
for _, app := range apps {
36-
health[app.Name] = app.Health
36+
health[app.DisplayName] = app.Health
3737
if !hasHealthchecksEnabled && app.Health != codersdk.WorkspaceAppHealthDisabled {
3838
hasHealthchecksEnabled = true
3939
}
@@ -85,21 +85,21 @@ func NewWorkspaceAppHealthReporter(logger slog.Logger, apps []codersdk.Workspace
8585
}()
8686
if err != nil {
8787
mu.Lock()
88-
if failures[app.Name] < int(app.Healthcheck.Threshold) {
88+
if failures[app.DisplayName] < int(app.Healthcheck.Threshold) {
8989
// increment the failure count and keep status the same.
9090
// we will change it when we hit the threshold.
91-
failures[app.Name]++
91+
failures[app.DisplayName]++
9292
} else {
9393
// set to unhealthy if we hit the failure threshold.
9494
// we stop incrementing at the threshold to prevent the failure value from increasing forever.
95-
health[app.Name] = codersdk.WorkspaceAppHealthUnhealthy
95+
health[app.DisplayName] = codersdk.WorkspaceAppHealthUnhealthy
9696
}
9797
mu.Unlock()
9898
} else {
9999
mu.Lock()
100100
// we only need one successful health check to be considered healthy.
101-
health[app.Name] = codersdk.WorkspaceAppHealthHealthy
102-
failures[app.Name] = 0
101+
health[app.DisplayName] = codersdk.WorkspaceAppHealthHealthy
102+
failures[app.DisplayName] = 0
103103
mu.Unlock()
104104
}
105105

agent/apphealth_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ func TestAppHealth(t *testing.T) {
2727
defer cancel()
2828
apps := []codersdk.WorkspaceApp{
2929
{
30-
Name: "app1",
30+
DisplayName: "app1",
3131
Healthcheck: codersdk.Healthcheck{},
3232
Health: codersdk.WorkspaceAppHealthDisabled,
3333
},
3434
{
35-
Name: "app2",
35+
DisplayName: "app2",
3636
Healthcheck: codersdk.Healthcheck{
3737
// URL: We don't set the URL for this test because the setup will
3838
// create a httptest server for us and set it for us.
@@ -69,7 +69,7 @@ func TestAppHealth(t *testing.T) {
6969
defer cancel()
7070
apps := []codersdk.WorkspaceApp{
7171
{
72-
Name: "app2",
72+
DisplayName: "app2",
7373
Healthcheck: codersdk.Healthcheck{
7474
// URL: We don't set the URL for this test because the setup will
7575
// create a httptest server for us and set it for us.
@@ -102,7 +102,7 @@ func TestAppHealth(t *testing.T) {
102102
defer cancel()
103103
apps := []codersdk.WorkspaceApp{
104104
{
105-
Name: "app2",
105+
DisplayName: "app2",
106106
Healthcheck: codersdk.Healthcheck{
107107
// URL: We don't set the URL for this test because the setup will
108108
// create a httptest server for us and set it for us.
@@ -137,7 +137,7 @@ func TestAppHealth(t *testing.T) {
137137
defer cancel()
138138
apps := []codersdk.WorkspaceApp{
139139
{
140-
Name: "app2",
140+
DisplayName: "app2",
141141
Healthcheck: codersdk.Healthcheck{
142142
// URL: We don't set the URL for this test because the setup will
143143
// create a httptest server for us and set it for us.
@@ -187,7 +187,7 @@ func setupAppReporter(ctx context.Context, t *testing.T, apps []codersdk.Workspa
187187
mu.Lock()
188188
for name, health := range req.Healths {
189189
for i, app := range apps {
190-
if app.Name != name {
190+
if app.DisplayName != name {
191191
continue
192192
}
193193
app.Health = health

cli/deployment/config.go

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ func newConfig() *codersdk.DeploymentConfig {
132132
ProxyTrustedHeaders: &codersdk.DeploymentConfigField[[]string]{
133133
Name: "Proxy Trusted Headers",
134134
Flag: "proxy-trusted-headers",
135-
Usage: "Headers to trust for forwarding IP addresses. e.g. Cf-Connecting-IP True-Client-Ip, X-Forwarded-for",
135+
Usage: "Headers to trust for forwarding IP addresses. e.g. Cf-Connecting-Ip, True-Client-Ip, X-Forwarded-For",
136136
},
137137
ProxyTrustedOrigins: &codersdk.DeploymentConfigField[[]string]{
138138
Name: "Proxy Trusted Origins",
@@ -289,10 +289,18 @@ func newConfig() *codersdk.DeploymentConfig {
289289
Default: "tls12",
290290
},
291291
},
292-
TraceEnable: &codersdk.DeploymentConfigField[bool]{
293-
Name: "Trace Enable",
294-
Usage: "Whether application tracing data is collected.",
295-
Flag: "trace",
292+
Trace: &codersdk.TraceConfig{
293+
Enable: &codersdk.DeploymentConfigField[bool]{
294+
Name: "Trace Enable",
295+
Usage: "Whether application tracing data is collected. It exports to a backend configured by environment variables. See: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md",
296+
Flag: "trace",
297+
},
298+
HoneycombAPIKey: &codersdk.DeploymentConfigField[string]{
299+
Name: "Trace Honeycomb API Key",
300+
Usage: "Enables trace exporting to Honeycomb.io using the provided API Key.",
301+
Flag: "trace-honeycomb-api-key",
302+
Secret: true,
303+
},
296304
},
297305
SecureAuthCookie: &codersdk.DeploymentConfigField[bool]{
298306
Name: "Secure Auth Cookie",

cli/deployment/config_test.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,16 @@ func TestConfig(t *testing.T) {
114114
require.Equal(t, config.TLS.Enable.Value, true)
115115
require.Equal(t, config.TLS.MinVersion.Value, "tls10")
116116
},
117+
}, {
118+
Name: "Trace",
119+
Env: map[string]string{
120+
"CODER_TRACE_ENABLE": "true",
121+
"CODER_TRACE_HONEYCOMB_API_KEY": "my-honeycomb-key",
122+
},
123+
Valid: func(config *codersdk.DeploymentConfig) {
124+
require.Equal(t, config.Trace.Enable.Value, true)
125+
require.Equal(t, config.Trace.HoneycombAPIKey.Value, "my-honeycomb-key")
126+
},
117127
}, {
118128
Name: "OIDC",
119129
Env: map[string]string{
@@ -192,6 +202,7 @@ func TestConfig(t *testing.T) {
192202
}} {
193203
tc := tc
194204
t.Run(tc.Name, func(t *testing.T) {
205+
t.Helper()
195206
for key, value := range tc.Env {
196207
t.Setenv(key, value)
197208
}

0 commit comments

Comments
 (0)