Skip to content

Commit 361538c

Browse files
committed
Merge branch 'main' of https://github.com/coder/coder into dk/pubsub-latency
2 parents 7d055d2 + e14f8fb commit 361538c

File tree

103 files changed

+2685
-1308
lines changed

Some content is hidden

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

103 files changed

+2685
-1308
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ runs:
77
- name: Install Terraform
88
uses: hashicorp/setup-terraform@v3
99
with:
10-
terraform_version: 1.5.7
10+
terraform_version: 1.6.6
1111
terraform_wrapper: false

.github/workflows/ci.yaml

Lines changed: 58 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,10 @@ jobs:
3737
k8s: ${{ steps.filter.outputs.k8s }}
3838
ci: ${{ steps.filter.outputs.ci }}
3939
db: ${{ steps.filter.outputs.db }}
40+
gomod: ${{ steps.filter.outputs.gomod }}
4041
offlinedocs-only: ${{ steps.filter.outputs.offlinedocs_count == steps.filter.outputs.all_count }}
4142
offlinedocs: ${{ steps.filter.outputs.offlinedocs }}
43+
tailnet-integration: ${{ steps.filter.outputs.tailnet-integration }}
4244
steps:
4345
- name: Checkout
4446
uses: actions/checkout@v4
@@ -90,6 +92,9 @@ jobs:
9092
- "scaletest/**"
9193
- "tailnet/**"
9294
- "testutil/**"
95+
gomod:
96+
- "go.mod"
97+
- "go.sum"
9398
ts:
9499
- "site/**"
95100
- "Makefile"
@@ -103,11 +108,34 @@ jobs:
103108
- ".github/workflows/ci.yaml"
104109
offlinedocs:
105110
- "offlinedocs/**"
111+
tailnet-integration:
112+
- "tailnet/**"
113+
- "go.mod"
114+
- "go.sum"
106115
107116
- id: debug
108117
run: |
109118
echo "${{ toJSON(steps.filter )}}"
110119
120+
update-flake:
121+
needs: changes
122+
if: needs.changes.outputs.gomod == 'true'
123+
runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }}
124+
steps:
125+
- name: Checkout
126+
uses: actions/checkout@v4
127+
with:
128+
fetch-depth: 1
129+
130+
- name: Setup Go
131+
uses: ./.github/actions/setup-go
132+
133+
- name: Update Nix Flake SRI Hash
134+
run: ./scripts/update-flake.sh
135+
136+
- name: Ensure No Changes
137+
run: git diff --exit-code
138+
111139
lint:
112140
needs: changes
113141
if: needs.changes.outputs.offlinedocs-only == 'false' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main'
@@ -142,7 +170,7 @@ jobs:
142170
143171
# Check for any typos
144172
- name: Check for typos
145-
uses: crate-ci/typos@v1.20.10
173+
uses: crate-ci/typos@v1.21.0
146174
with:
147175
config: .github/workflows/typos.toml
148176

@@ -361,6 +389,34 @@ jobs:
361389
with:
362390
api-key: ${{ secrets.DATADOG_API_KEY }}
363391

392+
# Tailnet integration tests only run when the `tailnet` directory or `go.sum`
393+
# and `go.mod` are changed. These tests are to ensure we don't add regressions
394+
# to tailnet, either due to our code or due to updating dependencies.
395+
#
396+
# These tests are skipped in the main go test jobs because they require root
397+
# and mess with networking.
398+
test-go-tailnet-integration:
399+
runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }}
400+
needs: changes
401+
# Unnecessary to run on main for now
402+
if: needs.changes.outputs.tailnet-integration == 'true' || needs.changes.outputs.ci == 'true'
403+
timeout-minutes: 20
404+
steps:
405+
- name: Checkout
406+
uses: actions/checkout@v4
407+
with:
408+
fetch-depth: 1
409+
410+
- name: Setup Go
411+
uses: ./.github/actions/setup-go
412+
413+
# Used by some integration tests.
414+
- name: Install Nginx
415+
run: sudo apt-get update && sudo apt-get install -y nginx
416+
417+
- name: Run Tests
418+
run: make test-tailnet-integration
419+
364420
test-js:
365421
runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }}
366422
needs: changes
@@ -861,7 +917,7 @@ jobs:
861917
- name: "Dependency Review"
862918
id: review
863919
# TODO: Replace this with the latest release once https://github.com/actions/dependency-review-action/pull/761 is merged.
864-
uses: actions/dependency-review-action@49fbbe0acb033b7824f26d00b005d7d598d76301
920+
uses: actions/dependency-review-action@82ab8f69c78827a746628706b5d2c3f87231fd4c
865921
with:
866922
allow-licenses: Apache-2.0, BSD-2-Clause, BSD-3-Clause, CC0-1.0, ISC, MIT, MIT-0, MPL-2.0
867923
allow-dependencies-licenses: "pkg:golang/github.com/pelletier/go-toml/v2"

.github/workflows/release.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,9 @@ jobs:
178178
env:
179179
EV_SIGNING_CERT: ${{ secrets.EV_SIGNING_CERT }}
180180

181-
- name: Test migrations from current ref to main
182-
run: |
183-
make test-migrations
181+
# - name: Test migrations from current ref to main
182+
# run: |
183+
# make test-migrations
184184

185185
# Setup GCloud for signing Windows binaries.
186186
- name: Authenticate to Google Cloud

.github/workflows/weekly-docs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
file-path: "./README.md"
3030

3131
- name: Send Slack notification
32-
if: failure() && github.event_name != 'workflow_dispatch'
32+
if: failure() && github.event_name == 'schedule'
3333
run: |
3434
curl -X POST -H 'Content-type: application/json' -d '{"msg":"Broken links found in the documentation. Please check the logs at ${{ env.LOGS_URL }}"}' ${{ secrets.DOCS_LINK_SLACK_WEBHOOK }}
3535
echo "Sent Slack notification"

.vscode/settings.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,5 +222,7 @@
222222
"go.testFlags": ["-short", "-coverpkg=./..."],
223223
// We often use a version of TypeScript that's ahead of the version shipped
224224
// with VS Code.
225-
"typescript.tsdk": "./site/node_modules/typescript/lib"
225+
"typescript.tsdk": "./site/node_modules/typescript/lib",
226+
// Playwright tests in VSCode will open a browser to live "view" the test.
227+
"playwright.reuseBrowser": true
226228
}

Makefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -827,6 +827,18 @@ test-race:
827827
gotestsum --junitfile="gotests.xml" -- -race -count=1 ./...
828828
.PHONY: test-race
829829

830+
test-tailnet-integration:
831+
env \
832+
CODER_TAILNET_TESTS=true \
833+
CODER_MAGICSOCK_DEBUG_LOGGING=true \
834+
TS_DEBUG_NETCHECK=true \
835+
GOTRACEBACK=single \
836+
go test \
837+
-exec "sudo -E" \
838+
-timeout=5m \
839+
-count=1 \
840+
./tailnet/test/integration
841+
830842
# Note: we used to add this to the test target, but it's not necessary and we can
831843
# achieve the desired result by specifying -count=1 in the go test invocation
832844
# instead. Keeping it here for convenience.

0 commit comments

Comments
 (0)