Skip to content

Commit c7f8fcc

Browse files
committed
Merge branch 'main' into dean/agent-api-test
2 parents 3b9d365 + fd7f85b commit c7f8fcc

File tree

897 files changed

+37934
-15553
lines changed

Some content is hidden

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

897 files changed

+37934
-15553
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ provisionersdk/proto/*.go linguist-generated=true
1212
*.tfstate.dot linguist-generated=true
1313
*.tfplan.dot linguist-generated=true
1414
site/src/api/typesGenerated.ts linguist-generated=true
15+
site/src/pages/SetupPage/countries.tsx linguist-generated=true

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ runs:
1717
- name: Setup Node
1818
uses: buildjet/setup-node@v3
1919
with:
20-
node-version: 18.17.0
20+
node-version: 18.19.0
2121
# See https://github.com/actions/setup-node#caching-global-packages-data
2222
cache: "pnpm"
2323
cache-dependency-path: ${{ inputs.directory }}/pnpm-lock.yaml

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ runs:
77
- name: Setup sqlc
88
uses: sqlc-dev/setup-sqlc@v4
99
with:
10-
sqlc-version: "1.24.0"
10+
sqlc-version: "1.25.0"

.github/dependabot.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,12 @@ updates:
3838
commit-message:
3939
prefix: "chore"
4040
labels: []
41+
open-pull-requests-limit: 15
4142
ignore:
4243
# Ignore patch updates for all dependencies
4344
- dependency-name: "*"
4445
update-types:
4546
- version-update:semver-patch
46-
groups:
47-
go:
48-
patterns:
49-
- "*"
5047

5148
# Update our Dockerfile.
5249
- package-ecosystem: "docker"

.github/fly-wsproxies/paris-coder.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ primary_region = "cdg"
1313
CODER_HTTP_ADDRESS = "0.0.0.0:3000"
1414
CODER_PRIMARY_ACCESS_URL = "https://dev.coder.com"
1515
CODER_WILDCARD_ACCESS_URL = "*--apps.paris.fly.dev.coder.com"
16+
CODER_VERBOSE = "true"
1617

1718
[http_service]
1819
internal_port = 3000

.github/fly-wsproxies/sao-paulo-coder.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ primary_region = "gru"
1313
CODER_HTTP_ADDRESS = "0.0.0.0:3000"
1414
CODER_PRIMARY_ACCESS_URL = "https://dev.coder.com"
1515
CODER_WILDCARD_ACCESS_URL = "*--apps.sao-paulo.fly.dev.coder.com"
16+
CODER_VERBOSE = "true"
1617

1718
[http_service]
1819
internal_port = 3000

.github/fly-wsproxies/sydney-coder.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ primary_region = "syd"
1313
CODER_HTTP_ADDRESS = "0.0.0.0:3000"
1414
CODER_PRIMARY_ACCESS_URL = "https://dev.coder.com"
1515
CODER_WILDCARD_ACCESS_URL = "*--apps.sydney.fly.dev.coder.com"
16+
CODER_VERBOSE = "true"
1617

1718
[http_service]
1819
internal_port = 3000

.github/workflows/ci.yaml

Lines changed: 52 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,7 @@ jobs:
6060
- "examples/lima/**"
6161
db:
6262
- "**.sql"
63-
- "coderd/database/queries/**"
64-
- "coderd/database/migrations"
65-
- "coderd/database/sqlc.yaml"
66-
- "coderd/database/dump.sql"
63+
- "coderd/database/**"
6764
go:
6865
- "**.sql"
6966
- "**.go"
@@ -144,7 +141,7 @@ jobs:
144141
145142
# Check for any typos
146143
- name: Check for typos
147-
uses: crate-ci/typos@v1.16.25
144+
uses: crate-ci/typos@v1.17.2
148145
with:
149146
config: .github/workflows/typos.toml
150147

@@ -191,7 +188,7 @@ jobs:
191188
go install storj.io/drpc/cmd/protoc-gen-go-drpc@v0.0.33
192189
go install golang.org/x/tools/cmd/goimports@latest
193190
go install github.com/mikefarah/yq/v4@v4.30.6
194-
go install github.com/golang/mock/mockgen@v1.6.0
191+
go install go.uber.org/mock/mockgen@v0.4.0
195192
196193
- name: Install Protoc
197194
run: |
@@ -224,7 +221,7 @@ jobs:
224221
uses: ./.github/actions/setup-node
225222

226223
- name: Setup Go
227-
uses: buildjet/setup-go@v4
224+
uses: buildjet/setup-go@v5
228225
with:
229226
# This doesn't need caching. It's super fast anyways!
230227
cache: false
@@ -322,7 +319,8 @@ jobs:
322319

323320
test-go-pg:
324321
runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }}
325-
needs: changes
322+
needs:
323+
- changes
326324
if: needs.changes.outputs.go == 'true' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main'
327325
# This timeout must be greater than the timeout set by `go test` in
328326
# `make test-postgres` to ensure we receive a trace of running
@@ -452,7 +450,7 @@ jobs:
452450
go install storj.io/drpc/cmd/protoc-gen-go-drpc@v0.0.33
453451
go install golang.org/x/tools/cmd/goimports@latest
454452
go install github.com/mikefarah/yq/v4@v4.30.6
455-
go install github.com/golang/mock/mockgen@v1.6.0
453+
go install go.uber.org/mock/mockgen@v0.4.0
456454
457455
- name: Install Protoc
458456
run: |
@@ -594,7 +592,7 @@ jobs:
594592
go install storj.io/drpc/cmd/protoc-gen-go-drpc@v0.0.33
595593
go install golang.org/x/tools/cmd/goimports@latest
596594
go install github.com/mikefarah/yq/v4@v4.30.6
597-
go install github.com/golang/mock/mockgen@v1.6.0
595+
go install go.uber.org/mock/mockgen@v0.4.0
598596
599597
- name: Setup sqlc
600598
uses: ./.github/actions/setup-sqlc
@@ -657,7 +655,7 @@ jobs:
657655
# to main branch. We are only building this for amd64 platform. (>95% pulls
658656
# are for amd64)
659657
needs: changes
660-
if: github.ref == 'refs/heads/main' && needs.changes.outputs.docs-only == 'false'
658+
if: needs.changes.outputs.docs-only == 'false' && !github.event.pull_request.head.repo.fork
661659
runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }}
662660
env:
663661
DOCKER_CLI_EXPERIMENTAL: "enabled"
@@ -683,7 +681,7 @@ jobs:
683681
uses: ./.github/actions/setup-go
684682

685683
- name: Install nfpm
686-
run: go install github.com/goreleaser/nfpm/v2/cmd/nfpm@v2.16.0
684+
run: go install github.com/goreleaser/nfpm/v2/cmd/nfpm@v2.35.1
687685

688686
- name: Install zstd
689687
run: sudo apt-get install -y zstd
@@ -694,46 +692,70 @@ jobs:
694692
go mod download
695693
696694
version="$(./scripts/version.sh)"
695+
tag="main-$(echo "$version" | sed 's/+/-/g')"
696+
echo "tag=$tag" >> $GITHUB_OUTPUT
697+
697698
make gen/mark-fresh
698699
make -j \
699-
build/coder_linux_amd64 \
700+
build/coder_linux_{amd64,arm64,armv7} \
700701
build/coder_"$version"_windows_amd64.zip \
701702
build/coder_"$version"_linux_amd64.{tar.gz,deb}
702703
703-
- name: Build and Push Linux amd64 Docker Image
704+
- name: Build Linux Docker images
704705
id: build-docker
706+
env:
707+
CODER_IMAGE_BASE: ghcr.io/coder/coder-preview
708+
CODER_IMAGE_TAG_PREFIX: main
709+
DOCKER_CLI_EXPERIMENTAL: "enabled"
705710
run: |
706711
set -euxo pipefail
712+
713+
# build Docker images for each architecture
707714
version="$(./scripts/version.sh)"
708715
tag="main-$(echo "$version" | sed 's/+/-/g')"
709-
710-
export CODER_IMAGE_BUILD_BASE_TAG="$(CODER_IMAGE_BASE=coder-base ./scripts/image_tag.sh --version "$version")"
711-
./scripts/build_docker.sh \
712-
--arch amd64 \
713-
--target "ghcr.io/coder/coder-preview:$tag" \
714-
--version $version \
715-
--push \
716-
build/coder_linux_amd64
717-
718-
# Tag as main
719-
docker tag "ghcr.io/coder/coder-preview:$tag" ghcr.io/coder/coder-preview:main
720-
docker push ghcr.io/coder/coder-preview:main
721-
722-
# Store the tag in an output variable so we can use it in other jobs
723716
echo "tag=$tag" >> $GITHUB_OUTPUT
724717
718+
# build images for each architecture
719+
make -j build/coder_"$version"_linux_{amd64,arm64,armv7}.tag
720+
721+
# only push if we are on main branch
722+
if [ "${{ github.ref }}" == "refs/heads/main" ]; then
723+
# build and push multi-arch manifest, this depends on the other images
724+
# being pushed so will automatically push them
725+
make -j push/build/coder_"$version"_linux_{amd64,arm64,armv7}.tag
726+
727+
# Define specific tags
728+
tags=("$tag" "main" "latest")
729+
730+
# Create and push a multi-arch manifest for each tag
731+
# we are adding `latest` tag and keeping `main` for backward
732+
# compatibality
733+
for t in "${tags[@]}"; do
734+
./scripts/build_docker_multiarch.sh \
735+
--push \
736+
--target "ghcr.io/coder/coder-preview:$t" \
737+
--version $version \
738+
$(cat build/coder_"$version"_linux_{amd64,arm64,armv7}.tag)
739+
done
740+
fi
741+
725742
- name: Prune old images
743+
if: github.ref == 'refs/heads/main'
726744
uses: vlaurin/action-ghcr-prune@v0.5.0
727745
with:
728746
token: ${{ secrets.GITHUB_TOKEN }}
729747
organization: coder
730748
container: coder-preview
731749
keep-younger-than: 7 # days
750+
keep-tags: latest
732751
keep-tags-regexes: ^pr
733-
prune-tags-regexes: ^main-
752+
prune-tags-regexes: |
753+
^main-
754+
^v
734755
prune-untagged: true
735756

736757
- name: Upload build artifacts
758+
if: github.ref == 'refs/heads/main'
737759
uses: actions/upload-artifact@v4
738760
with:
739761
name: coder
@@ -896,7 +918,7 @@ jobs:
896918
sqlc-vet:
897919
runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }}
898920
needs: changes
899-
if: needs.changes.outputs.db == 'true' || github.ref == 'refs/heads/main'
921+
if: needs.changes.outputs.db == 'true' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main'
900922
steps:
901923
- name: Checkout
902924
uses: actions/checkout@v4

.github/workflows/dogfood.yaml

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,15 @@ on:
77
paths:
88
- "dogfood/**"
99
- ".github/workflows/dogfood.yaml"
10-
# Uncomment these lines when testing with CI.
11-
# pull_request:
12-
# paths:
13-
# - "dogfood/**"
14-
# - ".github/workflows/dogfood.yaml"
10+
pull_request:
11+
paths:
12+
- "dogfood/**"
13+
- ".github/workflows/dogfood.yaml"
1514
workflow_dispatch:
1615

1716
jobs:
18-
deploy_image:
19-
runs-on: buildjet-4vcpu-ubuntu-2204
17+
build_image:
18+
runs-on: ubuntu-latest
2019
steps:
2120
- name: Checkout
2221
uses: actions/checkout@v4
@@ -33,27 +32,33 @@ jobs:
3332
tag=${tag//\//--}
3433
echo "tag=${tag}" >> $GITHUB_OUTPUT
3534
35+
- name: Set up Depot CLI
36+
uses: depot/setup-action@v1
37+
3638
- name: Set up Docker Buildx
3739
uses: docker/setup-buildx-action@v3
3840

3941
- name: Login to DockerHub
42+
if: github.ref == 'refs/heads/main'
4043
uses: docker/login-action@v3
4144
with:
4245
username: ${{ secrets.DOCKERHUB_USERNAME }}
4346
password: ${{ secrets.DOCKERHUB_PASSWORD }}
4447

4548
- name: Build and push
46-
uses: docker/build-push-action@v5
49+
uses: depot/build-push-action@v1
4750
with:
51+
project: b4q6ltmpzh
52+
token: ${{ secrets.DEPOT_TOKEN }}
53+
buildx-fallback: true
4854
context: "{{defaultContext}}:dogfood"
4955
pull: true
50-
push: true
56+
push: ${{ github.ref == 'refs/heads/main' }}
5157
tags: "codercom/oss-dogfood:${{ steps.docker-tag-name.outputs.tag }},codercom/oss-dogfood:latest"
52-
cache-from: type=registry,ref=codercom/oss-dogfood:latest
53-
cache-to: type=inline
5458

5559
deploy_template:
56-
needs: deploy_image
60+
needs: build_image
61+
if: github.ref == 'refs/heads/main'
5762
runs-on: ubuntu-latest
5863
steps:
5964
- name: Checkout
@@ -74,7 +79,7 @@ jobs:
7479
7580
- name: "Push template"
7681
run: |
77-
./coder templates push $CODER_TEMPLATE_NAME --directory $CODER_TEMPLATE_DIR --yes --name=$CODER_TEMPLATE_VERSION --message="$CODER_TEMPLATE_MESSAGE"
82+
./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 }}
7883
env:
7984
# Consumed by Coder CLI
8085
CODER_URL: https://dev.coder.com

.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: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ on:
99
- main
1010
workflow_dispatch:
1111
inputs:
12-
pr_number:
13-
description: "PR number"
14-
type: number
15-
required: true
1612
experiments:
1713
description: "Experiments to enable"
1814
required: false
@@ -355,6 +351,7 @@ jobs:
355351
- name: Install/Upgrade Helm chart
356352
run: |
357353
set -euo pipefail
354+
helm dependency update --skip-refresh ./helm/coder
358355
helm upgrade --install "pr${{ env.PR_NUMBER }}" ./helm/coder \
359356
--namespace "pr${{ env.PR_NUMBER }}" \
360357
--values ./pr-deploy-values.yaml \
@@ -419,7 +416,7 @@ jobs:
419416
420417
# Create template
421418
cd ./.github/pr-deployments/template
422-
coder templates create -y --variable namespace=pr${{ env.PR_NUMBER }} kubernetes
419+
coder templates push -y --variable namespace=pr${{ env.PR_NUMBER }} kubernetes
423420
424421
# Create workspace
425422
coder create --template="kubernetes" kube --parameter cpu=2 --parameter memory=4 --parameter home_disk_size=2 -y

0 commit comments

Comments
 (0)