Skip to content

Commit bda22ea

Browse files
committed
Merge branch 'main' of https://github.com/coder/coder into bq/refactor-few-services
2 parents fc932a6 + b3c9839 commit bda22ea

File tree

74 files changed

+1131
-1035
lines changed

Some content is hidden

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

74 files changed

+1131
-1035
lines changed

.github/workflows/ci.yaml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
offlinedocs: ${{ steps.filter.outputs.offlinedocs }}
4040
steps:
4141
- name: Checkout
42-
uses: actions/checkout@v3
42+
uses: actions/checkout@v4
4343
with:
4444
fetch-depth: 1
4545
# For pull requests it's not necessary to checkout the code
@@ -110,7 +110,7 @@ jobs:
110110
runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }}
111111
steps:
112112
- name: Checkout
113-
uses: actions/checkout@v3
113+
uses: actions/checkout@v4
114114
with:
115115
fetch-depth: 1
116116

@@ -137,7 +137,7 @@ jobs:
137137
138138
# Check for any typos
139139
- name: Check for typos
140-
uses: crate-ci/typos@v1.16.10
140+
uses: crate-ci/typos@v1.16.11
141141
with:
142142
config: .github/workflows/typos.toml
143143

@@ -165,7 +165,7 @@ jobs:
165165
if: needs.changes.outputs.docs-only == 'false' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main'
166166
steps:
167167
- name: Checkout
168-
uses: actions/checkout@v3
168+
uses: actions/checkout@v4
169169
with:
170170
fetch-depth: 1
171171

@@ -209,7 +209,7 @@ jobs:
209209
timeout-minutes: 7
210210
steps:
211211
- name: Checkout
212-
uses: actions/checkout@v3
212+
uses: actions/checkout@v4
213213
with:
214214
fetch-depth: 1
215215

@@ -248,7 +248,7 @@ jobs:
248248
- windows-2019
249249
steps:
250250
- name: Checkout
251-
uses: actions/checkout@v3
251+
uses: actions/checkout@v4
252252
with:
253253
fetch-depth: 1
254254

@@ -317,7 +317,7 @@ jobs:
317317
timeout-minutes: 25
318318
steps:
319319
- name: Checkout
320-
uses: actions/checkout@v3
320+
uses: actions/checkout@v4
321321
with:
322322
fetch-depth: 1
323323

@@ -365,7 +365,7 @@ jobs:
365365
timeout-minutes: 25
366366
steps:
367367
- name: Checkout
368-
uses: actions/checkout@v3
368+
uses: actions/checkout@v4
369369
with:
370370
fetch-depth: 1
371371

@@ -398,7 +398,7 @@ jobs:
398398
id-token: write
399399
steps:
400400
- name: Checkout
401-
uses: actions/checkout@v3
401+
uses: actions/checkout@v4
402402
with:
403403
fetch-depth: 0
404404

@@ -486,7 +486,7 @@ jobs:
486486
timeout-minutes: 20
487487
steps:
488488
- name: Checkout
489-
uses: actions/checkout@v3
489+
uses: actions/checkout@v4
490490
with:
491491
fetch-depth: 1
492492

@@ -516,7 +516,7 @@ jobs:
516516
timeout-minutes: 20
517517
steps:
518518
- name: Checkout
519-
uses: actions/checkout@v3
519+
uses: actions/checkout@v4
520520
with:
521521
fetch-depth: 1
522522

@@ -582,7 +582,7 @@ jobs:
582582
if: needs.changes.outputs.ts == 'true' || needs.changes.outputs.ci == 'true'
583583
steps:
584584
- name: Checkout
585-
uses: actions/checkout@v3
585+
uses: actions/checkout@v4
586586
with:
587587
# Required by Chromatic for build-over-build history, otherwise we
588588
# only get 1 commit on shallow checkout.
@@ -647,7 +647,7 @@ jobs:
647647
if: needs.changes.outputs.offlinedocs == 'true' || needs.changes.outputs.ci == 'true'
648648
steps:
649649
- name: Checkout
650-
uses: actions/checkout@v3
650+
uses: actions/checkout@v4
651651
with:
652652
# 0 is required here for version.sh to work.
653653
fetch-depth: 0
@@ -727,7 +727,7 @@ jobs:
727727
DOCKER_CLI_EXPERIMENTAL: "enabled"
728728
steps:
729729
- name: Checkout
730-
uses: actions/checkout@v3
730+
uses: actions/checkout@v4
731731
with:
732732
fetch-depth: 0
733733

.github/workflows/docker-base.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
if: github.repository_owner == 'coder'
3333
steps:
3434
- name: Checkout
35-
uses: actions/checkout@v3
35+
uses: actions/checkout@v4
3636

3737
- name: Docker login
3838
uses: docker/login-action@v2

.github/workflows/dogfood.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
runs-on: buildjet-4vcpu-ubuntu-2204
2424
steps:
2525
- name: Checkout
26-
uses: actions/checkout@v3
26+
uses: actions/checkout@v4
2727

2828
- name: Get branch name
2929
id: branch-name
@@ -61,7 +61,7 @@ jobs:
6161
runs-on: ubuntu-latest
6262
steps:
6363
- name: Checkout
64-
uses: actions/checkout@v3
64+
uses: actions/checkout@v4
6565

6666
- name: Get short commit SHA
6767
id: vars

.github/workflows/nightly-gauntlet.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
timeout-minutes: 240
1818
steps:
1919
- name: Checkout
20-
uses: actions/checkout@v3
20+
uses: actions/checkout@v4
2121

2222
- name: Setup Go
2323
uses: ./.github/actions/setup-go
@@ -44,7 +44,7 @@ jobs:
4444
timeout-minutes: 10
4545
steps:
4646
- name: Checkout
47-
uses: actions/checkout@v3
47+
uses: actions/checkout@v4
4848

4949
- name: Setup Go
5050
uses: ./.github/actions/setup-go

.github/workflows/pr-deploy.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
PR_OPEN: ${{ steps.check_pr.outputs.pr_open }}
4949
steps:
5050
- name: Checkout
51-
uses: actions/checkout@v3
51+
uses: actions/checkout@v4
5252

5353
- name: Check if PR is open
5454
id: check_pr
@@ -78,7 +78,7 @@ jobs:
7878
runs-on: "ubuntu-latest"
7979
steps:
8080
- name: Checkout
81-
uses: actions/checkout@v3
81+
uses: actions/checkout@v4
8282
with:
8383
fetch-depth: 0
8484

@@ -202,7 +202,7 @@ jobs:
202202
CODER_IMAGE_TAG: ${{ needs.get_info.outputs.CODER_IMAGE_TAG }}
203203
steps:
204204
- name: Checkout
205-
uses: actions/checkout@v3
205+
uses: actions/checkout@v4
206206
with:
207207
fetch-depth: 0
208208

@@ -296,7 +296,7 @@ jobs:
296296
kubectl create namespace "pr${{ env.PR_NUMBER }}"
297297
298298
- name: Checkout
299-
uses: actions/checkout@v3
299+
uses: actions/checkout@v4
300300

301301
- name: Check and Create Certificate
302302
if: needs.get_info.outputs.NEW == 'true' || github.event.inputs.deploy == 'true'

.github/workflows/release.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
version: ${{ steps.version.outputs.version }}
4141
steps:
4242
- name: Checkout
43-
uses: actions/checkout@v3
43+
uses: actions/checkout@v4
4444
with:
4545
fetch-depth: 0
4646

@@ -409,7 +409,7 @@ jobs:
409409

410410
steps:
411411
- name: Checkout
412-
uses: actions/checkout@v3
412+
uses: actions/checkout@v4
413413
with:
414414
fetch-depth: 0
415415

@@ -489,7 +489,7 @@ jobs:
489489

490490
steps:
491491
- name: Checkout
492-
uses: actions/checkout@v3
492+
uses: actions/checkout@v4
493493
with:
494494
fetch-depth: 0
495495

.github/workflows/security.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }}
2727
steps:
2828
- name: Checkout
29-
uses: actions/checkout@v3
29+
uses: actions/checkout@v4
3030

3131
- name: Initialize CodeQL
3232
uses: github/codeql-action/init@v2
@@ -59,7 +59,7 @@ jobs:
5959
runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }}
6060
steps:
6161
- name: Checkout
62-
uses: actions/checkout@v3
62+
uses: actions/checkout@v4
6363
with:
6464
fetch-depth: 0
6565

.github/workflows/stale.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
runs-on: ubuntu-latest
3535
steps:
3636
- name: Checkout repository
37-
uses: actions/checkout@v3
37+
uses: actions/checkout@v4
3838
- name: Run delete-old-branches-action
3939
uses: beatlabs/delete-old-branches-action@v0.0.10
4040
with:

coderd/apidoc/docs.go

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/apidoc/swagger.json

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/httpapi/url.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package httpapi
22

33
import (
44
"fmt"
5+
"hash/crc32"
56
"net"
67
"regexp"
78
"strings"
@@ -18,6 +19,8 @@ var (
1819
nameRegex))
1920

2021
validHostnameLabelRegex = regexp.MustCompile(`^[a-z0-9]([-a-z0-9]*[a-z0-9])?$`)
22+
23+
crcTable = crc32.MakeTable(crc32.IEEE)
2124
)
2225

2326
// ApplicationURL is a parsed application URL hostname.
@@ -39,7 +42,12 @@ func (a ApplicationURL) String() string {
3942
_, _ = appURL.WriteString(a.WorkspaceName)
4043
_, _ = appURL.WriteString("--")
4144
_, _ = appURL.WriteString(a.Username)
42-
return appURL.String()
45+
hostname := appURL.String()
46+
47+
if len(hostname) < 64 { // max length for the subdomain level
48+
return hostname
49+
}
50+
return fmt.Sprintf("app-%08x", crc32.Checksum([]byte(hostname), crcTable))
4351
}
4452

4553
// ParseSubdomainAppURL parses an ApplicationURL from the given subdomain. If

coderd/httpapi/url_test.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,16 @@ func TestApplicationURLString(t *testing.T) {
4242
},
4343
Expected: "8080--agent--workspace--user",
4444
},
45+
{
46+
Name: "LongAppName",
47+
URL: httpapi.ApplicationURL{
48+
AppSlugOrPort: "0123456789012345678901234567890123456789",
49+
AgentName: "agent",
50+
WorkspaceName: "workspace",
51+
Username: "user",
52+
},
53+
Expected: "app-90667f72",
54+
},
4555
}
4656

4757
for _, c := range testCases {

coderd/provisionerjobs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ func (api *API) provisionerJobResources(rw http.ResponseWriter, r *http.Request,
149149
}
150150

151151
apiAgent, err := convertWorkspaceAgent(
152-
api.DERPMap(), *api.TailnetCoordinator.Load(), agent, convertApps(dbApps), api.AgentInactiveDisconnectTimeout,
152+
api.DERPMap(), *api.TailnetCoordinator.Load(), agent, convertProvisionedApps(dbApps), api.AgentInactiveDisconnectTimeout,
153153
api.DeploymentValues.AgentFallbackTroubleshootingURL.String(),
154154
)
155155
if err != nil {

0 commit comments

Comments
 (0)