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.
Update (2026-02-11): Cloudflare Docs Deploy Failure
Section titled “Update (2026-02-11): Cloudflare Docs Deploy Failure”The Deploy Docs to Cloudflare Pages workflow failed on main with:
/home/runner/setup-pnpm/.../pnpmexit code1
Root Cause
Section titled “Root Cause”Deploy workflow used an older pnpm setup action path than CI and lacked deterministic lockfile install settings, causing setup drift in GitHub Actions.
Resolution
Section titled “Resolution”- Updated
.github/workflows/deploy.yamlfrompnpm/action-setup@v3topnpm/action-setup@v4. - Pinned pnpm to
10.28.0. - Added
cache-dependency-path: pnpm-lock.yamlto Node setup. - Switched dependency install to
pnpm install --frozen-lockfile.
Verification
Section titled “Verification”- Local reproduction passed:
pnpm install --frozen-lockfilepnpm --filter docs build
- Workflow then deployed successfully from updated branch state.
Changes
Section titled “Changes”1. Fix pnpm Version Mismatch
Section titled “1. Fix pnpm Version Mismatch”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.
2. Initialize System Tests
Section titled “2. Initialize System Tests”The system-test job failed because the app lacked the test/system directory.
Resolution:
- Created
test/application_system_test_case.rbconfigured for headless Chrome. - Created
test/system/sanity_test.rbwith a basic home page check.
3. Fix Lint Errors
Section titled “3. Fix Lint Errors”The lint job failed due to trailing whitespace in the new test file.
Resolution: Removed trailing whitespace from test/system/sanity_test.rb.
4. Fix IPv6 Database Connection Error
Section titled “4. Fix IPv6 Database Connection Error”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.
5. Fix Invalid Fixtures
Section titled “5. Fix Invalid Fixtures”System tests crashed due to database constraint violations in the auto-generated fixtures.
users.yml: Missingaccount_idandemail(NOT NULL constraints).admin_users.yml: Duplicate empty emails (Unique constraint).accounts.yml: Invalid Array syntax (MyTextinstead of[]).
Resolution: Updated all fixtures with valid, constraint-compliant data.
Verification Results
Section titled “Verification Results”CI Status
Section titled “CI Status”All jobs passed successfully in the final run:
test: ✅ Successlint: ✅ Successsystem-test: ✅ Successscan_ruby: ✅ Success