Skip to content

fix(build): drop examples/personal-finance from root workspaces — unblock image builds#927

Merged
buremba merged 1 commit into
mainfrom
chore/example-personal-finance-out-of-workspaces
May 19, 2026
Merged

fix(build): drop examples/personal-finance from root workspaces — unblock image builds#927
buremba merged 1 commit into
mainfrom
chore/example-personal-finance-out-of-workspaces

Conversation

@buremba
Copy link
Copy Markdown
Member

@buremba buremba commented May 19, 2026

Reproducer

0.105 error: Workspace not found \"examples/personal-finance\"
0.105     at /app/package.json:8:5
ERROR: failed to build: ... bun install ... exit code: 1

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:

  1. Stub the example in all three Dockerfiles. Treats the symptom; couples prod build pipeline to whatever exists under `examples/`. Wrong direction.
  2. Take the example out of root workspaces entirely. ← Chosen. Examples are docs/demos; they don't belong in the prod build graph.

Side effects of (2)

  • Example's dependency on `@lobu/promptfoo-provider` switched from `workspace:*` (workspace-protocol-only) to `file:../../packages/promptfoo-provider`. Resolves locally without requiring workspace membership.
  • Consumers running the example now do: `cd packages/promptfoo-provider && bun run build && cd ../../examples/personal-finance && bun install` once. Worth a docs note in the example's README as follow-up.
  • `bun.lock` regenerated. Most of the -1,109 LOC diff is bun's "linked workspaces" table shrinking — no upstream version churn.

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

  • Image build on this PR's branch passes (the actual production reproducer).
  • Once merged + image rolls, prod app pods come up on the new tag and the `principal_kind` migration applies automatically via the gateway's boot-time `assertSchemaUpToDate` → `dbmate up` path.

Summary by CodeRabbit

  • Chores
    • Reorganized monorepo workspace configuration and updated how project dependencies are referenced across the development environment.

Review Change Stack

…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.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 19, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d9f7d216-4e57-47da-a37f-afbac3ad866f

📥 Commits

Reviewing files that changed from the base of the PR and between 5369c5b and 7b75140.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (2)
  • examples/personal-finance/package.json
  • package.json

📝 Walkthrough

Walkthrough

The monorepo structure is updated to remove examples/personal-finance from the root workspaces configuration and change the example's dependency resolution from workspace protocol to a direct file path to the provider package.

Changes

Workspace and Dependency Restructuring

Layer / File(s) Summary
Workspace and dependency configuration update
package.json, examples/personal-finance/package.json
Root package.json removes examples/personal-finance from the workspaces array. The example's @lobu/promptfoo-provider dependency switches from workspace:* to file:../../packages/promptfoo-provider.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A workspace takes its leave,
File paths now deceive,
No more shared the way,
The rabbit hops away.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically summarizes the main change: removing examples/personal-finance from root workspaces to fix Docker image build failures.
Description check ✅ Passed The description is comprehensive and well-structured, covering reproducer, root cause, fix rationale, side effects, and verification. However, the Test plan section uses unchecked checkboxes without evidence of completion.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/example-personal-finance-out-of-workspaces

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov-commenter
Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@buremba buremba merged commit 8932729 into main May 19, 2026
25 of 27 checks passed
@buremba buremba deleted the chore/example-personal-finance-out-of-workspaces branch May 19, 2026 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants