fix(build): drop examples/personal-finance from root workspaces — unblock image builds#927
Conversation
…lock image builds PR #911 added `examples/personal-finance` to root `package.json`'s `workspaces` field but didn't update the Dockerfiles, which only COPY `packages/*/package.json` for the install layer. `bun install` inside the Docker build then errored: error: Workspace not found "examples/personal-finance" at /app/package.json:8:5 Every image build on `main` since #911 merged (13:25 UTC today) has been red: #911 → #913 (+revert) → #914 → #915 → #919 → #923 → #924 → #912 → #925 — all sitting on `main` un-deployable, including the `principal_kind` migration from #923 and my own loading-skeletons shipping artifacts. Two ways to fix it: 1. **Add stubs to all three Dockerfiles** for the example. Treats the symptom; couples prod build pipeline to whatever's under `examples/`, wrong direction. 2. **Take the example out of root workspaces.** Examples are documentation/demos for users to clone + run; they don't belong in the prod build graph. Cleaner separation. Going with (2). Side effects: - Example's dependency on `@lobu/promptfoo-provider` switched from `workspace:*` (workspace-protocol-only) to `file:../../packages/promptfoo-provider`. Resolves locally without requiring the example to be in a workspace; consumers run `cd examples/personal-finance && bun install` standalone (after building the provider once: `cd packages/promptfoo-provider && bun run build`). - `bun.lock` regenerated. Most of the diff is bun's "linked workspaces" table shrinking — no upstream version churn. Verified: simulated Docker build context (root files + stubbed packages/* manifests + provider stub, no examples/) runs `bun install` cleanly. No "Workspace not found" error.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe monorepo structure is updated to remove ChangesWorkspace and Dependency Restructuring
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Reproducer
Every `Build and Push Images` workflow run on `main` since #911 merged (13:25 UTC today) has failed at the `bun install` layer of all three Dockerfiles (embeddings-service, worker, app). Prod K8s is stuck on the pre-#911 image tag `20260519-123954`; 8 merged PRs are sitting on `main` un-deployable:
Root cause
PR #911 added `examples/personal-finance` to the root `package.json` workspaces array. The Dockerfiles' `bun install` layer explicitly COPYs every workspace's `package.json` (or stubs ones it doesn't need) — but the example was added to `workspaces` without a matching Dockerfile update. `packages/*` is a glob (forgiving when a path doesn't exist); `examples/personal-finance` is an explicit path (strict — must exist).
Fix
Two options, picked the cleaner one:
Side effects of (2)
Verification
Simulated the Docker build context (root files + stubbed `packages/*` manifests + `packages/promptfoo-provider` stub, no `examples/` directory at all) and ran `bun install` cleanly. No "Workspace not found" error.
`tsc --noEmit` clean (pre-commit hook).
Test plan
Summary by CodeRabbit