Skip to content

CI Failure Investigation and Fix Walkthrough

CI Failure Investigation and Fix Walkthrough

Section titled “CI Failure Investigation and Fix Walkthrough”

We successfully resolved a series of CI failures to get the build green.

The initial error “packages field missing or empty” was caused by a mismatch between the local pnpm version (v10) and the CI version (v9). Attempting to use a v10 lockfile with v9 caused the failure.

Resolution: Updated .github/workflows/ci.yml to use pnpm v10.

The system-test job failed because the app lacked the test/system directory.

Resolution:

  • Created test/application_system_test_case.rb configured for headless Chrome.
  • Created test/system/sanity_test.rb with a basic home page check.

The lint job failed due to trailing whitespace in the new test file.

Resolution: Removed trailing whitespace from test/system/sanity_test.rb.

System tests failed on CI with ActiveRecord::ConnectionNotEstablished trying to connect to ::1.

Resolution: Explicitly set PGHOST and DATABASE_URL to 127.0.0.1 in .github/workflows/ci.yml.

System tests crashed due to database constraint violations in the auto-generated fixtures.

  • users.yml: Missing account_id and email (NOT NULL constraints).
  • admin_users.yml: Duplicate empty emails (Unique constraint).
  • accounts.yml: Invalid Array syntax (MyText instead of []).

Resolution: Updated all fixtures with valid, constraint-compliant data.

All jobs passed successfully in the final run:

  • test: ✅ Success
  • lint: ✅ Success
  • system-test: ✅ Success
  • scan_ruby: ✅ Success

Success