Skip to content

fix: repair CI failures (version check + E2E setup)#7

Merged
NiveditJain merged 1 commit into
mainfrom
ef-7
Apr 6, 2026
Merged

fix: repair CI failures (version check + E2E setup)#7
NiveditJain merged 1 commit into
mainfrom
ef-7

Conversation

@NiveditJain

@NiveditJain NiveditJain commented Apr 6, 2026

Copy link
Copy Markdown
Member

Summary

  • Version consistency check was failing with jq exit code 2 because packages/*/package.json doesn't exist in this single-package repo. Added a [ -f "$pkg" ] || continue guard so the loop is a no-op when no subpackages are present.
  • E2E setup was failing because bun run test:npx referenced a script that didn't exist. The test:npx approach (npm pack → install into .test-npx/ → run against @failproofai/<platform> native binary) has been removed since we're not shipping platform binaries. Replaced with a direct bun build of the public API entry point (src/index.ts → dist/index.js), and E2E tests now invoke the binary from the repo source via bun.

Test plan

  • CI quality job passes (version check no longer fails on missing packages/)
  • CI test-e2e job passes (Build E2E fixtures step + E2E Hook Tests both succeed)
  • bun build src/index.ts --outdir dist --target node --format cjs && bun run test:e2e passes locally

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added a new public API entry point for accessing hook and policy utilities.
  • Documentation

    • Updated E2E testing setup instructions with a simplified build-and-run workflow.
  • Chores

    • Optimized CI pipeline and test infrastructure for improved efficiency.

- ci.yml: add file guard to version check loop so it no-ops on a
  single-package repo (was failing with jq exit 2 on missing packages/)
- ci.yml: replace npm-pack E2E setup step with a direct bun build of
  the public API (src/index.ts -> dist/index.js CJS)
- hook-runner.ts: run binary from repo source via bun instead of the
  planned native binary distribution; point dist path at repo root
- src/index.ts: add public API entry point used by the bun build step

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Apr 6, 2026

Copy link
Copy Markdown
ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Free

Run ID: 598c722b-aec9-4261-a393-2d88c921a566

📥 Commits

Reviewing files that changed from the base of the PR and between 14dbcc5 and a376c9d.

📒 Files selected for processing (5)
  • .github/workflows/ci.yml
  • __tests__/e2e/helpers/hook-runner.ts
  • __tests__/e2e/hooks/builtin-policies.e2e.test.ts
  • docs/testing.md
  • src/index.ts

📝 Walkthrough

Walkthrough

The pull request refactors the E2E testing infrastructure from a packaging-and-installation model using bun run test:npx to a direct binary execution model. This includes updating CI workflows, test helpers, documentation, and introducing a new public API entry point that re-exports key utilities.

Changes

Cohort / File(s) Summary
CI and E2E Test Infrastructure
.github/workflows/ci.yml, __tests__/e2e/helpers/hook-runner.ts
Updated CI workflow to skip non-existent package.json files and suppress jq errors. Modified hook runner to execute fixed binary bin/failproofai.mjs via bun invocation instead of platform-specific npm-installed binaries, and simplified error messaging.
E2E Test Configuration
__tests__/e2e/hooks/builtin-policies.e2e.test.ts
Updated test setup instructions to build CommonJS distribution directly via bun build instead of running bun run test:npx.
Documentation
docs/testing.md
Revised E2E test setup documentation to reflect new model: pre-building dist/ directory and running tests directly, removing persistent .test-npx/ directory approach.
Public API Entry Point
src/index.ts
Added new module that re-exports hook utilities (customPolicies, getCustomHooks, clearCustomHooks), policy helpers (allow, deny, instruct), and policy-related types from internal modules.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 The binary hops with grace so fleet,
No packaging maze to complete!
Direct invocation, dist so neat,
A cleaner path makes testing sweet,
Public APIs now polished bright. ✨


Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

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

@NiveditJain NiveditJain merged commit 2b78c30 into main Apr 6, 2026
8 checks passed
@NiveditJain NiveditJain deleted the ef-7 branch April 6, 2026 19:51
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.

1 participant