Skip to content

Commit 674559e

Browse files
committed
Merge branch 'main' into samejr/appearance-theme-toggle
Conflicts and how they were resolved: - Switch.tsx: kept both sides. Main narrowed the tracks and added the press squish; this branch's even-padding fix now sits on top of main's geometry, so the medium thumb is 12px travelling 14px (a 12x26 content box) rather than 16px, and the squish keeps the leading edge pinned. Main's transition-[translate,width,background-color] and unconditional useShortcutKeys are kept; so are our accent-fill track and white thumb. - root.tsx: took main's fragment-wrapper removal with this branch's theme attributes. Main's dashboardAgentBaseUrl loader field is retained. - SideMenu.tsx: this branch extracted SideMenuPopoverSubMenu to its own file, so main's inline copy is dropped and its oxlint-disable comment ported into the extracted component. - SettingsLayout.tsx: both sides changed the row title gap to space-y-0.5; kept the constant. - account._index/route.tsx: kept this branch's appearance section and removed main's now-orphaned renderTheme helper, which referenced a themeLabel this branch had already deleted. - regions, concurrency, select-plan: took main's side and re-applied our themed-link swaps, plus main's type="button" on the reset button. Silent auto-merges that needed fixing: - CopyButton.tsx: both sides added asChild/tabbable, producing duplicate JSX attributes. Main's restructure supersedes ours - the button variant now uses Button's own tooltip prop, and the icon variant became a real <button> - so its unconditional version stands. - storybook.usage: bucketStartMs became a required prop on UsageSparkline; the examples now pass a fixed timestamp, matching the convention main established in storybook.charts. Main's newly-enabled React Compiler and exhaustive-deps rules flagged this branch's code. Fixed rather than suppressed where practical: the duplicated theme option label is hoisted to module scope, and the marketing-emails debounce keeps fetcher.submit in a ref so it needn't depend on an object useFetcher rebuilds every render. The remaining disables are the fetcher-settle effects, which synchronise with the network and are already guarded against re-entry.
2 parents 9cfaf36 + 4953128 commit 674559e

394 files changed

Lines changed: 17566 additions & 6939 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/external-trace-id-per-run.md

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

.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/node-24-project-default.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.

.github/VOUCHED.td

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,5 @@ Leafgard
2929
Rohan170603
3030
NERLOE
3131
Jakub-Vacek
32-
gtremper
32+
gtremper
33+
wuweiweiwu

.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.yml

Lines changed: 53 additions & 12 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,18 +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
83+
- name: 📥 Prepare deps and testcontainer images
7784
run: |
78-
echo "Pre-pulling Docker images with authenticated session..."
79-
docker pull postgres:14
80-
docker pull redis:7.2
81-
docker pull testcontainers/ryuk:0.14.0
82-
docker pull ghcr.io/s2-streamstore/s2:0.40.0@sha256:b26249e2ede0949755f5af8028185dc2bcfc3aa2db21eb9610543d144eb6ee9d
83-
docker pull minio/minio:latest
84-
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+
}
8596
86-
- name: 📥 Download deps
87-
run: pnpm install --frozen-lockfile
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+
}
117+
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"
88129
89130
- name: 📀 Generate Prisma Client
90131
run: pnpm run generate
@@ -96,6 +137,6 @@ jobs:
96137
run: cd apps/webapp && pnpm exec playwright install chromium
97138

98139
- name: 🧪 Run Webapp E2E Tests
99-
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 }}
100141
env:
101142
WEBAPP_TEST_VERBOSE: "1"

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

Lines changed: 46 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,18 @@ on:
1414
jobs:
1515
unitTests:
1616
name: "🧪 Unit Tests: Webapp"
17-
# 10 shards on 16x machines: webapp test throughput is limited per-machine (one
18-
# docker daemon + disk absorbing all the per-file Postgres/ClickHouse container
19-
# spin-up), so many machines beats few big ones - fewer/bigger (3x32) measured
20-
# SLOWER than 10x8. The 16x (vs 8x) gives the fork pool the CPU headroom the 8x
21-
# runners lacked. Setup overhead per machine is ~1 min on warm runners.
17+
# Webapp test throughput is limited per-machine (one docker daemon + disk absorbing
18+
# all the per-file Postgres/ClickHouse container spin-up), so many machines beats
19+
# few big ones - fewer/bigger (3x32) measured slower than 10x8. The 16x (vs 8x)
20+
# gives the fork pool the CPU headroom the 8x runners lacked.
2221
runs-on: warp-ubuntu-latest-x64-16x
2322
strategy:
2423
# one flaky shard shouldn't cancel its siblings - lets us re-run only the failed shard
2524
fail-fast: false
2625
matrix:
27-
shardIndex: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
28-
shardTotal: [12]
26+
shardIndex:
27+
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24]
28+
shardTotal: [24]
2929
env:
3030
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
3131
SHARD_INDEX: ${{ matrix.shardIndex }}
@@ -69,7 +69,7 @@ jobs:
6969
version: 10.33.2
7070

7171
- name: ⎔ Setup node
72-
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
72+
uses: WarpBuilds/setup-node@bc639b444d583175926b588962199c247d23e8d3 # v6
7373
with:
7474
node-version: 24.18.0
7575
cache: "pnpm"
@@ -85,9 +85,10 @@ jobs:
8585
if: ${{ !env.DOCKERHUB_USERNAME }}
8686
run: echo "DockerHub login skipped because secrets are not available."
8787

88-
- name: 🐳 Pre-pull testcontainer images
88+
- name: 📥 Prepare deps and testcontainer images
8989
run: |
90-
# Retry each pull - DockerHub registry timeouts are a recurring transient CI flake.
90+
# Pull images concurrently with dependency installation. Retry each pull because
91+
# DockerHub registry timeouts are a recurring transient CI flake.
9192
pull() {
9293
for attempt in 1 2 3; do
9394
docker pull "$1" && return 0
@@ -97,18 +98,41 @@ jobs:
9798
echo "::error::docker pull $1 failed after 3 attempts"
9899
return 1
99100
}
100-
echo "Pre-pulling Docker images with authenticated session..."
101-
pull postgres:14
102-
pull postgres:17
103-
pull clickhouse/clickhouse-server:26.2.19.43-alpine@sha256:c6ad6a7eb2fb5999df3adfb8b69a0c7222c68fa9b8f6b04a088564ebbc959251
104-
pull redis:7.2
105-
pull testcontainers/ryuk:0.14.0
106-
pull electricsql/electric:1.2.4@sha256:20da3d0b0e74926c5623392db67fd56698b9e374c4aeb6cb5cadeb8fea171c36
107-
pull minio/minio:latest
108-
echo "Image pre-pull complete"
109-
110-
- name: 📥 Download deps
111-
run: pnpm install --frozen-lockfile
101+
102+
pull_images() {
103+
local pids=()
104+
local failed=0
105+
for image in \
106+
postgres:14 \
107+
postgres:17 \
108+
clickhouse/clickhouse-server:26.2.19.43-alpine@sha256:c6ad6a7eb2fb5999df3adfb8b69a0c7222c68fa9b8f6b04a088564ebbc959251 \
109+
redis:7.2 \
110+
testcontainers/ryuk:0.14.0 \
111+
electricsql/electric:1.2.4@sha256:20da3d0b0e74926c5623392db67fd56698b9e374c4aeb6cb5cadeb8fea171c36 \
112+
minio/minio:latest
113+
do
114+
pull "$image" &
115+
pids+=("$!")
116+
done
117+
for pid in "${pids[@]}"; do
118+
if ! wait "$pid"; then
119+
failed=1
120+
fi
121+
done
122+
return "$failed"
123+
}
124+
125+
echo "Installing dependencies and pre-pulling Docker images..."
126+
pull_images &
127+
pull_pid=$!
128+
install_status=0
129+
pnpm install --frozen-lockfile || install_status=$?
130+
pull_status=0
131+
wait "$pull_pid" || pull_status=$?
132+
if (( install_status != 0 || pull_status != 0 )); then
133+
exit 1
134+
fi
135+
echo "Dependency install and image pre-pull complete"
112136
113137
- name: 📀 Generate Prisma Client
114138
run: pnpm run generate

0 commit comments

Comments
 (0)