Skip to content

Commit 5da005f

Browse files
committed
Merge remote-tracking branch 'origin/main' into stevenmasley/use_template
2 parents 9b04ab6 + 3217cb8 commit 5da005f

File tree

162 files changed

+7297
-3206
lines changed

Some content is hidden

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

162 files changed

+7297
-3206
lines changed

.github/cherry-pick-bot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
enabled: true
2-
preservePullRequestTitle: false
2+
preservePullRequestTitle: true

.github/workflows/ci.yaml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,8 @@ jobs:
453453
DB=ci gotestsum --format standard-quiet -- -v -short -count=1 -parallel 4 -p 4 ./...
454454
else
455455
go run scripts/embedded-pg/main.go
456-
DB=ci gotestsum --format standard-quiet -- -v -short -count=1 ./...
456+
# Reduce test parallelism, like for Windows above.
457+
DB=ci gotestsum --format standard-quiet -- -v -short -count=1 -parallel 4 -p 4 ./...
457458
fi
458459
459460
- name: Upload test stats to Datadog
@@ -1252,8 +1253,10 @@ jobs:
12521253
make sqlc-vet
12531254
12541255
notify-slack-on-failure:
1256+
needs:
1257+
- required
12551258
runs-on: ubuntu-latest
1256-
if: always() && failure() && github.ref == 'refs/heads/main'
1259+
if: failure() && github.ref == 'refs/heads/main'
12571260

12581261
steps:
12591262
- name: Send Slack notification
@@ -1276,10 +1279,6 @@ jobs:
12761279
"type": "mrkdwn",
12771280
"text": "*Workflow:*\n${{ github.workflow }}"
12781281
},
1279-
{
1280-
"type": "mrkdwn",
1281-
"text": "*Failed Job:*\n${{ github.job }}"
1282-
},
12831282
{
12841283
"type": "mrkdwn",
12851284
"text": "*Committer:*\n${{ github.actor }}"

.github/workflows/nightly-gauntlet.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,6 @@ jobs:
101101
"type": "mrkdwn",
102102
"text": "*Workflow:*\n${{ github.workflow }}"
103103
},
104-
{
105-
"type": "mrkdwn",
106-
"text": "*Failed Job:*\n${{ github.job }}"
107-
},
108104
{
109105
"type": "mrkdwn",
110106
"text": "*Committer:*\n${{ github.actor }}"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ site/stats/
5454

5555
# direnv
5656
.envrc
57+
.direnv
5758
*.test
5859

5960
# Loadtesting

Makefile

Lines changed: 40 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,17 @@ site/node_modules/.installed: site/package.json
399399
cd site/
400400
../scripts/pnpm_install.sh
401401

402-
site/out/index.html: site/node_modules/.installed $(shell find ./site $(FIND_EXCLUSIONS) -type f \( -name '*.ts' -o -name '*.tsx' \))
402+
SITE_GEN_FILES := \
403+
site/src/api/typesGenerated.ts \
404+
site/src/api/rbacresourcesGenerated.ts \
405+
site/src/api/countriesGenerated.ts \
406+
site/src/theme/icons.json
407+
408+
site/out/index.html: \
409+
site/node_modules/.installed \
410+
site/static/install.sh \
411+
$(SITE_GEN_FILES) \
412+
$(shell find ./site $(FIND_EXCLUSIONS) -type f \( -name '*.ts' -o -name '*.tsx' \))
403413
cd site/
404414
# prevents this directory from getting to big, and causing "too much data" errors
405415
rm -rf out/assets/
@@ -541,22 +551,21 @@ GEN_FILES := \
541551
provisionersdk/proto/provisioner.pb.go \
542552
provisionerd/proto/provisionerd.pb.go \
543553
vpn/vpn.pb.go \
544-
site/src/api/typesGenerated.ts \
554+
$(DB_GEN_FILES) \
555+
$(SITE_GEN_FILES) \
545556
coderd/rbac/object_gen.go \
546557
codersdk/rbacresources_gen.go \
547-
site/src/api/rbacresourcesGenerated.ts \
548-
site/src/api/countriesGenerated.ts \
549558
docs/admin/integrations/prometheus.md \
550559
docs/reference/cli/index.md \
551560
docs/admin/security/audit-logs.md \
552561
coderd/apidoc/swagger.json \
553562
provisioner/terraform/testdata/version \
554563
site/e2e/provisionerGenerated.ts \
555-
site/src/theme/icons.json \
556564
examples/examples.gen.json \
557565
$(TAILNETTEST_MOCKS) \
558566
coderd/database/pubsub/psmock/psmock.go
559567

568+
560569
# all gen targets should be added here and to gen/mark-fresh
561570
gen: gen/db $(GEN_FILES)
562571
.PHONY: gen
@@ -855,6 +864,30 @@ test-migrations: test-postgres-docker
855864
# NOTE: we set --memory to the same size as a GitHub runner.
856865
test-postgres-docker:
857866
docker rm -f test-postgres-docker-${POSTGRES_VERSION} || true
867+
868+
# Try pulling up to three times to avoid CI flakes.
869+
docker pull gcr.io/coder-dev-1/postgres:${POSTGRES_VERSION} || {
870+
retries=2
871+
for try in $(seq 1 ${retries}); do
872+
echo "Failed to pull image, retrying (${try}/${retries})..."
873+
sleep 1
874+
if docker pull gcr.io/coder-dev-1/postgres:${POSTGRES_VERSION}; then
875+
break
876+
fi
877+
done
878+
}
879+
880+
# Make sure to not overallocate work_mem and max_connections as each
881+
# connection will be allowed to use this much memory. Try adjusting
882+
# shared_buffers instead, if needed.
883+
#
884+
# - work_mem=8MB * max_connections=1000 = 8GB
885+
# - shared_buffers=2GB + effective_cache_size=1GB = 3GB
886+
#
887+
# This leaves 5GB for the rest of the system _and_ storing the
888+
# database in memory (--tmpfs).
889+
#
890+
# https://www.postgresql.org/docs/current/runtime-config-resource.html#GUC-WORK-MEM
858891
docker run \
859892
--env POSTGRES_PASSWORD=postgres \
860893
--env POSTGRES_USER=postgres \
@@ -867,9 +900,9 @@ test-postgres-docker:
867900
--detach \
868901
--memory 16GB \
869902
gcr.io/coder-dev-1/postgres:${POSTGRES_VERSION} \
870-
-c shared_buffers=1GB \
871-
-c work_mem=1GB \
903+
-c shared_buffers=2GB \
872904
-c effective_cache_size=1GB \
905+
-c work_mem=8MB \
873906
-c max_connections=1000 \
874907
-c fsync=off \
875908
-c synchronous_commit=off \

0 commit comments

Comments
 (0)