Skip to content

Commit 89bcf85

Browse files
committed
Merge remote-tracking branch 'origin/main' into pr4644
2 parents 7655a5c + 56f8756 commit 89bcf85

928 files changed

Lines changed: 22894 additions & 17259 deletions

File tree

Some content is hidden

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

.changeset/fair-queue-concurrency-slot-leak.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/lucky-pillows-invite.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/prebuilt-base-images.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/smooth-schedule-windows.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

.env.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ NODE_ENV=development
2323
CLICKHOUSE_URL=http://default:password@localhost:8123
2424
RUN_REPLICATION_CLICKHOUSE_URL=http://default:password@localhost:8123
2525
RUN_REPLICATION_ENABLED=1
26+
# LOGS_SEARCH_PROJECTOR_ENABLED=1
27+
# LOGS_SEARCH_PROJECTOR_PREVIEW_ENABLED=1
2628
# Store task run spans/traces in ClickHouse so the dashboard trace view is
2729
# populated in local dev. The local stack is ClickHouse-backed (see above), so
2830
# leaving this unset falls back to the "postgres" store and dev run traces show

.github/workflows/code-quality.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,6 @@ jobs:
3636

3737
- name: 🔎 Lint
3838
run: pnpm exec oxlint .
39+
40+
- name: ✂️ Check unused code and dependencies
41+
run: pnpm run knip

.github/workflows/dashboard-agent-deploy.yml

Lines changed: 51 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,19 @@ name: "🤖 Deploy dashboard agent"
33
# Deploys the @internal/dashboard-agent chat.agent to its Trigger.dev project
44
# with --skip-promotion, so a deploy never becomes "current" on its own. The
55
# consuming app cuts over by pinning DASHBOARD_AGENT_VERSION to the new version.
6-
# Runs a leg per environment (staging + prod), each gated by its own environment;
7-
# a push to main that touches the agent or its store triggers both. Version
8-
# numbers are per-environment, so pin each environment to its own leg's version.
6+
# Runs a leg per environment (staging + prod); a push to main that touches the
7+
# agent or its store deploys both. Version numbers are per-environment, so pin
8+
# each environment to its own leg's version.
9+
#
10+
# The deploy lands dormant, so it doesn't need a reviewer gate: nothing goes live
11+
# until DASHBOARD_AGENT_VERSION is flipped. The `environment:` below is kept only
12+
# to scope the deploy token per environment; its required-reviewers rule is
13+
# removed in repo settings so pushes deploy unattended. workflow_dispatch takes an
14+
# optional ref (SHA, branch, or tag) to deploy a specific commit instead of head.
15+
#
16+
# The deployed ref must be an ancestor of main, so only reviewed, merged code ever
17+
# runs with the deploy token (the checked-out build + trigger.config.ts execute
18+
# with it). A push is always on main; a dispatched ref is checked before deploy.
919

1020
on:
1121
push:
@@ -14,6 +24,11 @@ on:
1424
- "internal-packages/dashboard-agent/**"
1525
- "internal-packages/dashboard-agent-db/**"
1626
workflow_dispatch:
27+
inputs:
28+
ref:
29+
description: "Commit SHA, branch, or tag to deploy. Defaults to the ref the workflow runs from."
30+
required: false
31+
type: string
1732

1833
permissions: {}
1934

@@ -27,9 +42,15 @@ jobs:
2742
max-parallel: 1
2843
matrix:
2944
environment: [staging, prod]
30-
# Per-environment reviewer gate + source of the scoped deploy PAT.
45+
# Kept to scope the deploy token per environment. The required-reviewers rule
46+
# on these environments is removed in repo settings, so this no longer gates.
3147
environment: dashboard-agent-${{ matrix.environment }}
3248
concurrency:
49+
# Queue a superseding deploy behind an in-flight one; do NOT cancel it.
50+
# Cancelling the runner wouldn't stop the remote build (it finishes
51+
# server-side), and a second concurrent deploy of the same project would
52+
# race the indexer. Deploys are short now the gate is gone, so a brief queue
53+
# is fine and can't pile up.
3354
group: dashboard-agent-deploy-${{ matrix.environment }}
3455
cancel-in-progress: false
3556
permissions:
@@ -41,8 +62,34 @@ jobs:
4162
- name: Checkout
4263
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
4364
with:
65+
# push: the pushed commit. workflow_dispatch: the input ref if given,
66+
# otherwise the head of the ref the run was launched from.
67+
ref: ${{ github.event.inputs.ref || github.sha }}
68+
# Full history so the ancestor-of-main check below can find a merge base.
69+
fetch-depth: 0
4470
persist-credentials: false
4571

72+
- name: Require the ref to be an ancestor of main
73+
# The deploy token runs the checked-out code, so refuse anything that
74+
# hasn't landed on main. A push is main's tip (ancestor of itself); this
75+
# only ever rejects a dispatched, unmerged ref.
76+
#
77+
# NOTE: this in-file check only constrains WHICH commit is deployed. It
78+
# can't protect the token on its own, because workflow_dispatch runs the
79+
# workflow file from the selected ref. The real guard is the deployment
80+
# branch policy on the dashboard-agent-* environments (main only), set in
81+
# repo settings, which GitHub enforces server-side against GITHUB_REF.
82+
run: |
83+
set -euo pipefail
84+
# An explicit `ref:` checkout doesn't create remote-tracking branches,
85+
# so fetch main before comparing against it.
86+
git fetch --no-tags --quiet origin +refs/heads/main:refs/remotes/origin/main
87+
if ! git merge-base --is-ancestor HEAD origin/main; then
88+
echo "::error::Refusing to deploy $(git rev-parse HEAD): not an ancestor of origin/main. Only merged code can be deployed."
89+
exit 1
90+
fi
91+
echo "$(git rev-parse --short HEAD) is an ancestor of origin/main"
92+
4693
- name: Setup pnpm
4794
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0
4895
with:

.github/workflows/e2e-webapp-auth-full.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,10 @@ jobs:
9999
run: echo "DockerHub login skipped because secrets are not available."
100100

101101
- name: 🐳 Pre-pull testcontainer images
102-
if: ${{ env.DOCKERHUB_USERNAME }}
103102
run: |
104103
docker pull postgres:14
105104
docker pull redis:7.2
106-
docker pull testcontainers/ryuk:0.11.0
105+
docker pull testcontainers/ryuk:0.14.0
107106
108107
- name: 📥 Download deps
109108
run: pnpm install --frozen-lockfile

.github/workflows/e2e-webapp.yml

Lines changed: 53 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,15 @@ jobs:
1616
name: "🧪 E2E Tests: Webapp"
1717
runs-on: warp-ubuntu-latest-x64-16x
1818
timeout-minutes: 30
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
shardIndex: [1, 2]
23+
shardTotal: [2]
1924
env:
2025
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
26+
SHARD_INDEX: ${{ matrix.shardIndex }}
27+
SHARD_TOTAL: ${{ matrix.shardTotal }}
2128
steps:
2229
- name: 🔧 Disable IPv6
2330
run: |
@@ -57,7 +64,7 @@ jobs:
5764
version: 10.33.2
5865

5966
- name: ⎔ Setup node
60-
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
67+
uses: WarpBuilds/setup-node@bc639b444d583175926b588962199c247d23e8d3 # v6
6168
with:
6269
node-version: 24.18.0
6370
cache: "pnpm"
@@ -73,19 +80,52 @@ jobs:
7380
if: ${{ !env.DOCKERHUB_USERNAME }}
7481
run: echo "DockerHub login skipped because secrets are not available."
7582

76-
- name: 🐳 Pre-pull testcontainer images
77-
if: ${{ env.DOCKERHUB_USERNAME }}
83+
- name: 📥 Prepare deps and testcontainer images
7884
run: |
79-
echo "Pre-pulling Docker images with authenticated session..."
80-
docker pull postgres:14
81-
docker pull redis:7.2
82-
docker pull testcontainers/ryuk:0.11.0
83-
docker pull ghcr.io/s2-streamstore/s2:0.40.0@sha256:b26249e2ede0949755f5af8028185dc2bcfc3aa2db21eb9610543d144eb6ee9d
84-
docker pull minio/minio:latest
85-
echo "Image pre-pull complete"
85+
# Pull images concurrently with dependency installation. Retry each pull because
86+
# registry timeouts are a recurring transient CI flake.
87+
pull() {
88+
for attempt in 1 2 3; do
89+
docker pull "$1" && return 0
90+
echo "::warning::docker pull $1 failed (attempt ${attempt}/3); retrying in 10s"
91+
sleep 10
92+
done
93+
echo "::error::docker pull $1 failed after 3 attempts"
94+
return 1
95+
}
96+
97+
pull_images() {
98+
local pids=()
99+
local failed=0
100+
for image in \
101+
postgres:14 \
102+
redis:7.2 \
103+
testcontainers/ryuk:0.14.0 \
104+
ghcr.io/s2-streamstore/s2:0.40.0@sha256:b26249e2ede0949755f5af8028185dc2bcfc3aa2db21eb9610543d144eb6ee9d \
105+
minio/minio:latest
106+
do
107+
pull "$image" &
108+
pids+=("$!")
109+
done
110+
for pid in "${pids[@]}"; do
111+
if ! wait "$pid"; then
112+
failed=1
113+
fi
114+
done
115+
return "$failed"
116+
}
86117
87-
- name: 📥 Download deps
88-
run: pnpm install --frozen-lockfile
118+
echo "Installing dependencies and pre-pulling Docker images..."
119+
pull_images &
120+
pull_pid=$!
121+
install_status=0
122+
pnpm install --frozen-lockfile || install_status=$?
123+
pull_status=0
124+
wait "$pull_pid" || pull_status=$?
125+
if (( install_status != 0 || pull_status != 0 )); then
126+
exit 1
127+
fi
128+
echo "Dependency install and image pre-pull complete"
89129
90130
- name: 📀 Generate Prisma Client
91131
run: pnpm run generate
@@ -97,6 +137,6 @@ jobs:
97137
run: cd apps/webapp && pnpm exec playwright install chromium
98138

99139
- name: 🧪 Run Webapp E2E Tests
100-
run: cd apps/webapp && pnpm exec vitest run --config vitest.e2e.config.ts --reporter=default
140+
run: cd apps/webapp && pnpm exec vitest run --config vitest.e2e.config.ts --reporter=default --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
101141
env:
102142
WEBAPP_TEST_VERBOSE: "1"

.github/workflows/unit-tests-internal.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ jobs:
7878
run: echo "DockerHub login skipped because secrets are not available."
7979

8080
- name: 🐳 Pre-pull testcontainer images
81-
if: ${{ env.DOCKERHUB_USERNAME }}
8281
run: |
8382
# Retry each pull - DockerHub registry timeouts are a recurring transient CI flake.
8483
pull() {
@@ -96,7 +95,6 @@ jobs:
9695
pull clickhouse/clickhouse-server:26.2.19.43-alpine@sha256:c6ad6a7eb2fb5999df3adfb8b69a0c7222c68fa9b8f6b04a088564ebbc959251
9796
pull redis:7.2
9897
pull testcontainers/ryuk:0.14.0
99-
pull electricsql/electric:1.2.4
10098
echo "Image pre-pull complete"
10199
102100
- name: 📥 Download deps

0 commit comments

Comments
 (0)