CopilotKit / CopilotKit/outpost

Make scripts/ a workspace package so CI runs its tests

Open
#267 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area: infrastructure roadmap: now
Dominant language
TypeScript
Stars
7
Forks
3
Avg merge
7d 16h
Merged PRs (30d)
15

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with pnpm-workspace.yaml, the root package.json, scripts/tsconfig.json, root vitest.config.ts, and .github/workflows/ci.yml. Compare the scripts dependencies and commands with another workspace package, then verify that turbo runs the scripts tests and typecheck and that the documented tsx invocation resolves its dependencies. Remove the root workaround only after the scripts package works through the workspace.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
build-system, ci-cd, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
74/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.