Skip to content

Commit 74d2789

Browse files
committed
Merge branch 'main' into dean/template-activity-bump-dur
2 parents f770ce0 + e659957 commit 74d2789

File tree

644 files changed

+20817
-10596
lines changed

Some content is hidden

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

644 files changed

+20817
-10596
lines changed

.dockerignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Ignore all files and folders
2+
**
3+
4+
# Include flake.nix and flake.lock
5+
!flake.nix
6+
!flake.lock

.github/workflows/ci.yaml

Lines changed: 15 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
fetch-depth: 1
4747
# For pull requests it's not necessary to checkout the code
4848
- name: check changed files
49-
uses: dorny/paths-filter@v2
49+
uses: dorny/paths-filter@v3
5050
id: filter
5151
with:
5252
filters: |
@@ -131,7 +131,7 @@ jobs:
131131
echo "LINT_CACHE_DIR=$dir" >> $GITHUB_ENV
132132
133133
- name: golangci-lint cache
134-
uses: buildjet/cache@v3
134+
uses: buildjet/cache@v4
135135
with:
136136
path: |
137137
${{ env.LINT_CACHE_DIR }}
@@ -141,7 +141,7 @@ jobs:
141141
142142
# Check for any typos
143143
- name: Check for typos
144-
uses: crate-ci/typos@v1.17.1
144+
uses: crate-ci/typos@v1.18.0
145145
with:
146146
config: .github/workflows/typos.toml
147147

@@ -305,7 +305,7 @@ jobs:
305305
api-key: ${{ secrets.DATADOG_API_KEY }}
306306

307307
- name: Check code coverage
308-
uses: codecov/codecov-action@v3
308+
uses: codecov/codecov-action@v4
309309
# This action has a tendency to error out unexpectedly, it has
310310
# the `fail_ci_if_error` option that defaults to `false`, but
311311
# that is no guarantee, see:
@@ -353,7 +353,7 @@ jobs:
353353
api-key: ${{ secrets.DATADOG_API_KEY }}
354354

355355
- name: Check code coverage
356-
uses: codecov/codecov-action@v3
356+
uses: codecov/codecov-action@v4
357357
# This action has a tendency to error out unexpectedly, it has
358358
# the `fail_ci_if_error` option that defaults to `false`, but
359359
# that is no guarantee, see:
@@ -412,7 +412,7 @@ jobs:
412412
working-directory: site
413413

414414
- name: Check code coverage
415-
uses: codecov/codecov-action@v3
415+
uses: codecov/codecov-action@v4
416416
# This action has a tendency to error out unexpectedly, it has
417417
# the `fail_ci_if_error` option that defaults to `false`, but
418418
# that is no guarantee, see:
@@ -516,7 +516,8 @@ jobs:
516516
NODE_OPTIONS: "--max_old_space_size=4096"
517517
STORYBOOK: true
518518
with:
519-
buildScriptName: "storybook:build"
519+
# Do a fast, testing build for change previews
520+
buildScriptName: "storybook:ci"
520521
exitOnceUploaded: true
521522
# This will prevent CI from failing when Chromatic detects visual changes
522523
exitZeroOnChanges: true
@@ -530,6 +531,8 @@ jobs:
530531
# Run TurboSnap to trace file dependencies to related stories
531532
# and tell chromatic to only take snapshots of relevent stories
532533
onlyChanged: true
534+
# Avoid uploading single files, because that's very slow
535+
zip: true
533536

534537
# This is a separate step for mainline only that auto accepts and changes
535538
# instead of holding CI up. Since we squash/merge, this is defensive to
@@ -547,13 +550,16 @@ jobs:
547550
autoAcceptChanges: true
548551
# This will prevent CI from failing when Chromatic detects visual changes
549552
exitZeroOnChanges: true
553+
# Do a full build with documentation for mainline builds
550554
buildScriptName: "storybook:build"
551555
projectToken: 695c25b6cb65
552556
workingDir: "./site"
553557
storybookBaseDir: "./site"
554558
# Run TurboSnap to trace file dependencies to related stories
555559
# and tell chromatic to only take snapshots of relevent stories
556560
onlyChanged: true
561+
# Avoid uploading single files, because that's very slow
562+
zip: true
557563

558564
offlinedocs:
559565
name: offlinedocs
@@ -726,7 +732,7 @@ jobs:
726732
727733
# Define specific tags
728734
tags=("$tag" "main" "latest")
729-
735+
730736
# Create and push a multi-arch manifest for each tag
731737
# we are adding `latest` tag and keeping `main` for backward
732738
# compatibality
@@ -741,7 +747,7 @@ jobs:
741747
742748
- name: Prune old images
743749
if: github.ref == 'refs/heads/main'
744-
uses: vlaurin/action-ghcr-prune@v0.5.0
750+
uses: vlaurin/action-ghcr-prune@v0.6.0
745751
with:
746752
token: ${{ secrets.GITHUB_TOKEN }}
747753
organization: coder
@@ -856,62 +862,6 @@ jobs:
856862
TOKEN_SYDNEY: ${{ secrets.FLY_SYDNEY_CODER_PROXY_SESSION_TOKEN }}
857863
TOKEN_SAO_PAULO: ${{ secrets.FLY_SAO_PAULO_CODER_PROXY_SESSION_TOKEN }}
858864

859-
deploy-legacy-proxies:
860-
runs-on: ubuntu-latest
861-
timeout-minutes: 30
862-
needs: build
863-
if: github.ref == 'refs/heads/main' && !github.event.pull_request.head.repo.fork
864-
permissions:
865-
contents: read
866-
id-token: write
867-
steps:
868-
- name: Authenticate to Google Cloud
869-
uses: google-github-actions/auth@v2
870-
with:
871-
workload_identity_provider: projects/573722524737/locations/global/workloadIdentityPools/github/providers/github
872-
service_account: coder-ci@coder-dogfood.iam.gserviceaccount.com
873-
874-
- name: Set up Google Cloud SDK
875-
uses: google-github-actions/setup-gcloud@v2
876-
877-
- name: Download build artifacts
878-
uses: actions/download-artifact@v4
879-
with:
880-
name: coder
881-
path: ./build
882-
883-
- name: Install Release
884-
run: |
885-
set -euo pipefail
886-
887-
regions=(
888-
# gcp-region-id instance-name systemd-service-name
889-
"australia-southeast1-b coder-sydney coder-workspace-proxy"
890-
"europe-west3-c coder-europe coder-workspace-proxy"
891-
"southamerica-east1-b coder-brazil coder-workspace-proxy"
892-
)
893-
894-
deb_pkg=$(find ./build -name "coder_*_linux_amd64.deb" -print -quit)
895-
if [ -z "$deb_pkg" ]; then
896-
echo "deb package $deb_pkg not found"
897-
ls -l ./build
898-
exit 1
899-
fi
900-
901-
gcloud config set project coder-dogfood
902-
for region in "${regions[@]}"; do
903-
echo "::group::$region"
904-
set -- $region
905-
906-
set -x
907-
gcloud config set compute/zone "$1"
908-
gcloud compute scp "$deb_pkg" "${2}:/tmp/coder.deb"
909-
gcloud compute ssh "$2" -- /bin/sh -c "set -eux; sudo dpkg -i --force-confdef /tmp/coder.deb; sudo systemctl daemon-reload; sudo service '$3' restart"
910-
set +x
911-
912-
echo "::endgroup::"
913-
done
914-
915865
# sqlc-vet runs a postgres docker container, runs Coder migrations, and then
916866
# runs sqlc-vet to ensure all queries are valid. This catches any mistakes
917867
# in migrations or sqlc queries that makes a query unable to be prepared.

.github/workflows/contrib.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
pull-requests: write
2727
steps:
2828
- name: auto-approve dependabot
29-
uses: hmarr/auto-approve-action@v3
29+
uses: hmarr/auto-approve-action@v4
3030
if: github.actor == 'dependabot[bot]'
3131

3232
cla:

.github/workflows/dogfood.yaml

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,14 @@ on:
77
paths:
88
- "dogfood/**"
99
- ".github/workflows/dogfood.yaml"
10+
- "flake.lock"
11+
- "flake.nix"
1012
pull_request:
1113
paths:
1214
- "dogfood/**"
1315
- ".github/workflows/dogfood.yaml"
16+
- "flake.lock"
17+
- "flake.nix"
1418
workflow_dispatch:
1519

1620
jobs:
@@ -45,39 +49,65 @@ jobs:
4549
username: ${{ secrets.DOCKERHUB_USERNAME }}
4650
password: ${{ secrets.DOCKERHUB_PASSWORD }}
4751

48-
- name: Build and push
52+
- name: Build and push Non-Nix image
4953
uses: depot/build-push-action@v1
5054
with:
5155
project: b4q6ltmpzh
5256
token: ${{ secrets.DEPOT_TOKEN }}
5357
buildx-fallback: true
5458
context: "{{defaultContext}}:dogfood"
5559
pull: true
60+
save: true
5661
push: ${{ github.ref == 'refs/heads/main' }}
5762
tags: "codercom/oss-dogfood:${{ steps.docker-tag-name.outputs.tag }},codercom/oss-dogfood:latest"
5863

64+
- name: Build and push Nix image
65+
uses: depot/build-push-action@v1
66+
with:
67+
project: b4q6ltmpzh
68+
token: ${{ secrets.DEPOT_TOKEN }}
69+
buildx-fallback: true
70+
context: "."
71+
file: "dogfood/Dockerfile.nix"
72+
pull: true
73+
save: true
74+
push: ${{ github.ref == 'refs/heads/main' }}
75+
tags: "codercom/oss-dogfood-nix:${{ steps.docker-tag-name.outputs.tag }},codercom/oss-dogfood-nix:latest"
76+
5977
deploy_template:
6078
needs: build_image
61-
if: github.ref == 'refs/heads/main'
6279
runs-on: ubuntu-latest
6380
steps:
6481
- name: Checkout
6582
uses: actions/checkout@v4
6683

84+
- name: Setup Terraform
85+
uses: ./.github/actions/setup-tf
86+
87+
- name: Terraform init and validate
88+
run: |
89+
cd dogfood
90+
terraform init -upgrade
91+
terraform validate
92+
6793
- name: Get short commit SHA
94+
if: github.ref == 'refs/heads/main'
6895
id: vars
6996
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
7097

7198
- name: Get latest commit title
99+
if: github.ref == 'refs/heads/main'
72100
id: message
73101
run: echo "pr_title=$(git log --format=%s -n 1 ${{ github.sha }})" >> $GITHUB_OUTPUT
74102

75103
- name: "Get latest Coder binary from the server"
104+
if: github.ref == 'refs/heads/main'
76105
run: |
77106
curl -fsSL "https://dev.coder.com/bin/coder-linux-amd64" -o "./coder"
78107
chmod +x "./coder"
79108
80109
- name: "Push template"
110+
if: github.ref == 'refs/heads/main'
81111
run: |
82112
./coder templates push $CODER_TEMPLATE_NAME --directory $CODER_TEMPLATE_DIR --yes --name=$CODER_TEMPLATE_VERSION --message="$CODER_TEMPLATE_MESSAGE" --variable jfrog_url=${{ secrets.JFROG_URL }}
83113
env:

.github/workflows/pr-auto-assign.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- name: Assign author
17-
uses: toshimaru/auto-author-assign@v2.0.1
17+
uses: toshimaru/auto-author-assign@v2.1.0

.github/workflows/pr-deploy.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ jobs:
119119
echo "NEW=$NEW" >> $GITHUB_OUTPUT
120120
121121
- name: Check changed files
122-
uses: dorny/paths-filter@v2
122+
uses: dorny/paths-filter@v3
123123
id: filter
124124
with:
125125
base: ${{ github.ref }}
@@ -163,7 +163,7 @@ jobs:
163163
runs-on: "ubuntu-latest"
164164
steps:
165165
- name: Find Comment
166-
uses: peter-evans/find-comment@v2
166+
uses: peter-evans/find-comment@v3
167167
id: fc
168168
with:
169169
issue-number: ${{ needs.get_info.outputs.PR_NUMBER }}
@@ -173,7 +173,7 @@ jobs:
173173

174174
- name: Comment on PR
175175
id: comment_id
176-
uses: peter-evans/create-or-update-comment@v3
176+
uses: peter-evans/create-or-update-comment@v4
177177
with:
178178
comment-id: ${{ steps.fc.outputs.comment-id }}
179179
issue-number: ${{ needs.get_info.outputs.PR_NUMBER }}
@@ -441,7 +441,7 @@ jobs:
441441
echo "Slack notification sent"
442442
443443
- name: Find Comment
444-
uses: peter-evans/find-comment@v2
444+
uses: peter-evans/find-comment@v3
445445
id: fc
446446
with:
447447
issue-number: ${{ env.PR_NUMBER }}
@@ -450,7 +450,7 @@ jobs:
450450
direction: last
451451

452452
- name: Comment on PR
453-
uses: peter-evans/create-or-update-comment@v3
453+
uses: peter-evans/create-or-update-comment@v4
454454
env:
455455
STATUS: ${{ needs.get_info.outputs.NEW == 'true' && 'Created' || 'Updated' }}
456456
with:

.github/workflows/release.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ jobs:
321321

322322
- name: Start Packer builds
323323
if: ${{ !inputs.dry_run }}
324-
uses: peter-evans/repository-dispatch@v2
324+
uses: peter-evans/repository-dispatch@v3
325325
with:
326326
token: ${{ secrets.CDRCI_GITHUB_TOKEN }}
327327
repository: coder/packages
@@ -408,6 +408,11 @@ jobs:
408408
if: ${{ !inputs.dry_run }}
409409

410410
steps:
411+
- name: Sync fork
412+
run: gh repo sync cdrci/winget-pkgs -b master
413+
env:
414+
GH_TOKEN: ${{ github.token }}
415+
411416
- name: Checkout
412417
uses: actions/checkout@v4
413418
with:

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,10 +170,10 @@
170170
"workspaceapps",
171171
"workspacebuilds",
172172
"workspacename",
173-
"wsconncache",
174173
"wsjson",
175174
"xerrors",
176175
"xlarge",
176+
"xsmall",
177177
"yamux"
178178
],
179179
"cSpell.ignorePaths": ["site/package.json", ".vscode/settings.json"],

Makefile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,10 @@ gen: \
475475
site/.eslintignore \
476476
site/e2e/provisionerGenerated.ts \
477477
site/src/theme/icons.json \
478-
examples/examples.gen.json
478+
examples/examples.gen.json \
479+
tailnet/tailnettest/coordinatormock.go \
480+
tailnet/tailnettest/coordinateemock.go \
481+
tailnet/tailnettest/multiagentmock.go
479482
.PHONY: gen
480483

481484
# Mark all generated files as fresh so make thinks they're up-to-date. This is
@@ -502,6 +505,9 @@ gen/mark-fresh:
502505
site/e2e/provisionerGenerated.ts \
503506
site/src/theme/icons.json \
504507
examples/examples.gen.json \
508+
tailnet/tailnettest/coordinatormock.go \
509+
tailnet/tailnettest/coordinateemock.go \
510+
tailnet/tailnettest/multiagentmock.go \
505511
"
506512
for file in $$files; do
507513
echo "$$file"
@@ -529,6 +535,9 @@ coderd/database/querier.go: coderd/database/sqlc.yaml coderd/database/dump.sql $
529535
coderd/database/dbmock/dbmock.go: coderd/database/db.go coderd/database/querier.go
530536
go generate ./coderd/database/dbmock/
531537

538+
tailnet/tailnettest/coordinatormock.go tailnet/tailnettest/multiagentmock.go tailnet/tailnettest/coordinateemock.go: tailnet/coordinator.go tailnet/multiagent.go
539+
go generate ./tailnet/tailnettest/
540+
532541
tailnet/proto/tailnet.pb.go: tailnet/proto/tailnet.proto
533542
protoc \
534543
--go_out=. \

0 commit comments

Comments
 (0)