Skip to content

Make scripts/ a workspace package so CI runs its tests #267

Description

@NathanTarbert

scripts/ holds the cutover and rollback tooling and its own test suite at scripts/__tests__/cutover.test.ts, but it is not a workspace package: pnpm-workspace.yaml lists only apps/* and packages/*. Three consequences follow, and all of them are invisible.

Nothing in CI runs those tests. pnpm test is turbo run test, which runs per-package tasks only. The root vitest.config.ts is the sole config whose include covers scripts/__tests__/**, and it is wired to no turbo task. .github/workflows/ci.yml runs pnpm test. So that suite is green-by-absence and breaks only for someone who happens to run vitest at the repo root.

That is not hypothetical — it already happened. Routing execute-cutover.ts through isShadowMode() in #233 made all 15 tests in that file fail to collect, and CI stayed green throughout. It was found by running the root config by hand.

Nothing typechecks them either. scripts/tsconfig.json is detached from pnpm typecheck the same way.

Resolution needs a workaround. Because pnpm does not hoist and scripts/ has no manifest of its own, there is no node_modules/@copilotkit for it to resolve through. #233 works around it by adding @copilotkit/outpost to the ROOT manifest and aliasing the specifier to source in the root vitest.config.ts. That is a workaround for the missing package boundary rather than a fix.

Worth knowing: npx tsx scripts/cutover/execute-cutover.ts — the invocation documented at the top of that file — already fails on @prisma/client for the same reason, so the script's runtime path is broken independently of its tests.

Shape of a fix

Give scripts/ a package.json with its own test and typecheck scripts, add it to pnpm-workspace.yaml, and declare its real dependencies (@copilotkit/outpost, @prisma/client) there instead of on the root. turbo run test then picks the suite up like any other package, the root-manifest dependency and the vitest alias added in #233 can both come back out, and the documented tsx invocation starts working.

The cutover scripts are the tooling that turns shadow mode off in production, so they are a poor choice for the one corner of the repo CI does not look at. Related: #261 covers those scripts reporting success while the flag is still engaged — the missing coverage here is why that went unnoticed.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: infrastructureWorker, queue, CI, deploy, containers, observabilityroadmap: nowRoadmap horizon: V1 launch critical path / safety

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions