perf(builder): optimize build pipeline and gate types in CI - #945
Merged
Conversation
- Replace parallel routes (@channel/@integration slots) with dynamic segments + a shared RouteAccordionShell, cutting route permutations next.js has to compile for settings/channels and settings/integrations - Disable in-build type-checking (typescript.ignoreBuildErrors) since the duplicated tsc pass OOMs a default 4GB heap; add ci.yml and a release.yml gate so `turbo run check-types lint test` stays the one source of truth - Add BuildKit cache mounts (pnpm store, .next/cache) and optional Turbo remote cache secrets to the Docker build, restored via buildkit-cache-dance in release.yml - Guard module-scope Redis/Postgres/auth initialization during `next build`'s page-data collection phase (no services reachable then): lazyConnect on the worker-config Redis client, static trustedOrigins, parseEnvBool for logger flags that skip zod coercion under SKIP_ENV_CHECK=true - Bump next 16.3.0-canary.81 -> 16.3.0 (stable) and related lockfile updates
Floating v2 tag can move to a breaking release without warning; pin the exact version used in ci.yml and release.yml.
…timizing builds Broadens db-client mocks across builder/worker tests to include columns read eagerly at module scope by the contact-filter/variables import chain, so tests don't depend on unmocked initializers. Also fixes an encryption AAD precedence bug, an Instagram private-reply endpoint that addressed the Page node instead of the IG business account, and adds a Popover `portal` opt-out used by ComboboxField's allowClear support. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
realcodesiman
force-pushed
the
perf/builder-build-optimization
branch
from
August 13, 2026 10:41
660880b to
2ae3b4d
Compare
… timeouts Turbo's default of 10 concurrent tasks combined with one vitest worker per CPU multiplied into dozens of node processes fighting for the runner's 4 vCPUs, pushing cold module-graph imports past the 5s test timeout. Caps turbo at --concurrency=4, pins vitest to maxWorkers=1 on CI, and raises testTimeout/hookTimeout to 30s so a slow import doesn't poison the next test in the same file. Also fixes cross-cutting bugs surfaced while chasing the flakiness: a missing createRedisConnection mock, hoisting a heavy dynamic import out of a per-test timeout budget, and dropping now-redundant per-test 15s timeouts.
CI's i18n key-parity check requires every locale to carry the same key set as en.json. Keys added by earlier ads/permissions features (ctwa*, errors.superAdminRequired, etc.) were never backfilled into non-English locales, so this fills the gap.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@channel/@integrationslots) with dynamic segments + a sharedRouteAccordionShell, cutting the route permutations Next.js has to compile forsettings/channelsandsettings/integrationstypescript.ignoreBuildErrors) since the duplicatedtscpass OOMs a default 4GB heap; add.github/workflows/ci.ymland acheckgate inrelease.ymlsoturbo run check-types lint testis the one source of truth for types.next/cache) and optional Turbo remote-cache secrets to the Docker build, restored viabuildkit-cache-danceinrelease.ymlnext build's page-data collection phase (no services reachable then):lazyConnecton the worker-config Redis client, statictrustedOrigins,parseEnvBoolfor logger flags that skip zod coercion underSKIP_ENV_CHECK=truenext16.3.0-canary.81→16.3.0(stable) and related lockfile updatesturbo run check-types lint testat--concurrency=4, pin vitestmaxWorkers=1on CI, and raisetestTimeout/hookTimeoutto 30sChanges
apps/builder/src/app/space/[workspaceId]/(settings)/settings/{channels,integrations}/— parallel-route slots converted to<channel>/page.tsxdynamic routes; newchannels-accordion-shell.tsx,integrations-accordion-shell.tsx, sharedsrc/components/route-accordion-shell.tsx,src/lib/workspace/resolve-visible-channels.ts,src/lib/workspace/require-visible-channel.ts,src/features/integrations/settings-registry.ts.github/workflows/ci.yml(now with--concurrency=4);release.ymltype-check gate + BuildKit cache-mount restore/inject;apps/builder/docker/Dockerfilecache mounts;apps/builder/next.config.ts(ignoreBuildErrors,optimizePackageImports);turbo.jsonpassThroughEnv;.dockerignorebroadened.next/.turboignores;packages/vitest-config/src/node.ts(maxWorkers=1on CI, 30s test/hook timeouts)packages/auth/src/server.ts(statictrustedOriginsduring build),packages/database/src/client.ts+packages/utils/src/env.ts(parseEnvBool),packages/worker-config/src/lib/connection.ts+packages/redis/src/index.ts(lazyConnect/createRedisConnection)account-rail.test.tsx), added a missingcreateRedisConnectionmock (ads-conversion-rule.service.test.ts), dropped now-redundant per-test 15s timeouts in analytics testsen.json(errors.superAdminRequired,ctwa*, etc.)AGENTS.md,CLAUDE.md,docs/tenancy.md,.agents/skills/*,.devin/rules/chatbotx.md,.github/copilot-instructions.mdsynced to reflect the abovesettings-tab-active-state.test.ts,trusted-origins-build-phase.test.ts,connection-build-phase.test.ts,env.test.ts; updated channel-route-guard/visibility tests for the dynamic-route shapeTest plan
pnpm lintpnpm --filter builder check-typesci.yml) green on this PR, no timeouts