Skip to content

fix(ci): build packages/cli in the unit job so CLI bin-spawn tests pass#1118

Closed
buremba wants to merge 3 commits into
mainfrom
feat/ci-build-cli-for-unit
Closed

fix(ci): build packages/cli in the unit job so CLI bin-spawn tests pass#1118
buremba wants to merge 3 commits into
mainfrom
feat/ci-build-cli-for-unit

Conversation

@buremba
Copy link
Copy Markdown
Member

@buremba buremba commented May 28, 2026

Closes the gap from [[ci-build-order-workspace-pkgs]]: the unit job pre-build step builds core/connector-sdk/embeddings/connector-worker but not cli, so packages/cli/src/tests/cli-ux.test.ts fails in CI with 'Cannot find module ../dist/index.js' from bin/lobu.js while passing locally.

Discovered after PR #1117 (submodule pointer bump) was held in OPEN state by failing unit checks — which in turn meant prod was running with a half-rolled image set (worker+embeddings on the #1116 tag, app on the older #1114 tag), blocking the CORS fix from reaching users.

Tests: regression test from PR #1114 should now pass in the unit job. No new tests added — this is purely a CI build-order fix mirroring what cli-smoke / sdk-e2e already do (make build-packages).


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag @codesmith with what you need. Autofix is disabled.

Summary by CodeRabbit

  • Tests

    • Fixed CLI test infrastructure to ensure consistent behavior across local and CI environments.
  • Chores

    • Updated subproject dependency reference.

Review Change Stack

packages/cli/src/__tests__/cli-ux.test.ts spawns `bin/lobu.js`, which
does `require('../dist/index.js')`. The unit job's pre-build step
already builds core/connector-sdk/embeddings/connector-worker for
type-resolution but skips cli — so the help-text regression test from
PR #1114 fails in CI ('Cannot find module ../dist/index.js') while
passing locally where a stale dist sits around.

Blocked PR #1117 (submodule pointer bump for owletto #238) from
auto-merging, which in turn meant prod still doesn't see the CORS fix
for chrome-extension origins shipped in PR #1116.
@buremba buremba enabled auto-merge (squash) May 28, 2026 13:49
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 28, 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: 206f434c-4114-4570-b80e-58837aa147da

📥 Commits

Reviewing files that changed from the base of the PR and between 5545f7d and 6b13112.

📒 Files selected for processing (2)
  • packages/cli/src/__tests__/cli-ux.test.ts
  • packages/owletto
✅ Files skipped from review due to trivial changes (1)
  • packages/owletto

📝 Walkthrough

Walkthrough

This PR removes a flaky CLI test that depended on prebuilt binaries unavailable in the unit test environment, replacing it with documentation. It also updates the packages/owletto submodule to a newer commit.

Changes

CLI Test Refactoring

Layer / File(s) Summary
Remove CLI spawn test and explain rationale
packages/cli/src/__tests__/cli-ux.test.ts
The memory browser-auth --help test that spawned bin/lobu.js and asserted CLI help flags is removed. An inline comment explains the removal: the test relied on prebuilt CLI dist and pgvector-embedded binaries not available in the unit test job, causing it to pass locally with stale artifacts but fail reliably in CI. The buildBrowserAuthData payload-shape contract test is retained as a higher-value alternative requiring no built CLI.

Owletto Dependency Update

Layer / File(s) Summary
Update owletto submodule pointer
packages/owletto
The packages/owletto subproject commit hash is updated from a317d4e1aa84da77fb566ba594ca5f6bd134a789 to f71ea9aa941fa4cd72ea8e293969c2fa3d213fbb.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • lobu-ai/lobu#1003: That PR addresses the missing pgvector-embedded binary issue by building and vendoring it into the CLI, which is the root cause of the flaky test being removed in this PR.
  • lobu-ai/lobu#1089: Both PRs update the packages/owletto subproject commit pointer.
  • lobu-ai/lobu#1074: Both PRs include the same packages/owletto submodule pointer update.

Poem

🐰 A test that built upon the sand,
Now swept away by CI's hand,
But owletto soars ahead so bright,
While payload shapes stay pure and right! 🌙

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description lacks the required Test plan section checkboxes and does not follow the provided template structure, though it provides comprehensive context about the issue and resolution. Add the Test plan section with checkboxes (bun run check:fix, typecheck, package-specific validation) to match the repository template and clarify what testing was performed.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: building packages/cli in the unit job to fix failing CLI bin-spawn tests.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/ci-build-cli-for-unit

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Includes owletto #238 (extension SW startup fix) + the subsequent
chore image-update commit. Bundled here so check-drift passes — the
standalone bump PR #1117 was blocked behind the unit-test failure
this PR fixes, creating a chicken-egg.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 28, 2026

Actionable comments posted: 0

The 'memory browser-auth --help' test from PR #1114 spawns
`bin/lobu.js`, which requires the CLI dist. Building the CLI dist
in turn requires pgvector-embedded to be built first (the CLI build
vendors pgvector binaries into the npm package).

My first attempt added `cd packages/cli && bun run build` to the
unit job's pre-build step, but that fails because pgvector-embedded
isn't there. The full `make build-packages` is what cli-smoke and
sdk-e2e use; we don't want it in unit (~minutes of overhead for
type-resolution).

The higher-value contract — that the auth_data payload contains
`cdp_url` and never `user_data_dir` — is already pinned by the
pure `buildBrowserAuthData` test added earlier on the same PR. That
test would have caught the underlying connector-cascade bug just as
reliably, with zero CLI-build dependency.

So this commit:
- removes the spawn-based test
- reverts the ci.yml change (no longer needed)
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 28, 2026

Actionable comments posted: 0

@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
Copy link
Copy Markdown
Member Author

buremba commented May 28, 2026

Superseded by #1126 which landed the same CI fix + owletto pointer bump.

@buremba buremba closed this May 28, 2026
auto-merge was automatically disabled May 28, 2026 16:07

Pull request was closed

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