Skip to content

chore(ci): run on develop PRs and fail on lint/test failures#36

Merged
kaladinlight merged 6 commits into
developfrom
chore/ci-fix
May 6, 2026
Merged

chore(ci): run on develop PRs and fail on lint/test failures#36
kaladinlight merged 6 commits into
developfrom
chore/ci-fix

Conversation

@kaladinlight
Copy link
Copy Markdown
Member

@kaladinlight kaladinlight commented May 6, 2026

Description

CI was gated to PRs targeting main and won't run for the typical feature → develop flow used in this repo. Even when CI did run, both steps had continue-on-error: true so failures didn't block merges. Tests on develop have been broken since 601db2e (April 30) without anyone noticing.

  • Switch pull_request branches from main to develop
  • Drop continue-on-error from lint and test steps

Also wires up two pieces needed for yarn test to actually run:

  • Root yarn test now runs turbo run test (was bare jest, which failed because there's no root jest config — turbo dispatches to each workspace's own test script and rebuilds shared-types beforehand via dependsOn ^build).
  • Adds a missing jest mock for utils/pricing in the verifier test setup. utils/pricing transitively pulls p-queue (ESM), the same reason @shapeshiftoss/swapper is already mocked.

Drops the unused coverage outputs key from the turbo test task to silence its missing-output warning.

Testing

  • yarn test from repo root passes (4 turbo tasks, 22 jest tests)
  • yarn lint from repo root passes
  • CI run on this PR completes both steps without continue-on-error

Summary by CodeRabbit

  • Chores
    • Updated continuous integration workflow to enforce stricter test failure handling, preventing unsuccessful builds from progressing.
    • Enhanced test infrastructure with improved mock implementation setup for better test isolation and reliability.
    • Streamlined build configuration and test script organization for improved developer workflow efficiency.

CI was gated to PRs targeting main and won't run for the typical
feature -> develop flow used in this repo. Even when CI did run, both
steps had continue-on-error: true so failures didn't block merges.
Tests on develop have been broken since 601db2e (April 30) without
anyone noticing.

  - Switch pull_request branches from main to develop
  - Drop continue-on-error from lint and test steps

Also wires up two pieces needed for yarn test to actually run:

  - Root yarn test now runs turbo run test (was bare jest, which
    failed because there's no root jest config — turbo dispatches to
    each workspace's own test script and rebuilds shared-types
    beforehand via dependsOn ^build).
  - Adds a missing jest mock for utils/pricing in the verifier test
    setup. utils/pricing transitively pulls p-queue (ESM), the same
    reason @shapeshiftoss/swapper is already mocked.

Drops the unused coverage outputs key from the turbo test task to
silence its missing-output warning.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 6, 2026

Warning

Rate limit exceeded

@kaladinlight has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 27 minutes and 1 second before requesting another review.

To continue reviewing without waiting, purchase usage credits in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 74b6a607-74ab-465f-a8f6-637116f17095

📥 Commits

Reviewing files that changed from the base of the PR and between 3890bdd and 2aaa869.

📒 Files selected for processing (6)
  • .github/actions/setup-node-and-deps/action.yml
  • .gitignore
  • apps/swap-service/src/verification/__tests__/fixtures/near/response.json
  • apps/swap-service/src/verification/__tests__/fixtures/relay/response.json
  • package.json
  • turbo.json
📝 Walkthrough

Walkthrough

The PR modernizes test infrastructure by migrating to Turbo-based test execution, enforces stricter test failure handling in CI, and updates the CI workflow to trigger on develop branch instead of main. Test setup mocking is added to support verification tests.

Changes

Test Infrastructure Modernization

Layer / File(s) Summary
Build Orchestration
package.json, turbo.json
Test script migrated from direct jest invocation to turbo run test; turbo test task no longer outputs coverage artifacts.
Test Setup
apps/swap-service/src/verification/__tests__/setup.ts
Mock for pricing utility module added with getAssetPriceUsd as a jest function placeholder.
CI Configuration
.github/workflows/ci.yml
PR trigger updated from main to develop branch; continue-on-error: true removed from test step so failures now halt the workflow.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 Our tests now run through Turbo's gate,
No more ignoring failures—they seal fate.
With mocks in place and CI aligned,
Develop branch tests keep quality refined.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly matches the main changes: updating CI to run on develop PRs and making lint/test failures fail the workflow instead of continuing on error.
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/ci-fix

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.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
package.json (1)

21-21: ⚡ Quick win

Document turbo test task requirement for workspace consistency

The root "test": "turbo run test" will only execute packages that define a test script. Currently all workspaces with test files (only swap-service) have the script defined, so there's no gap. However, to prevent future issues if tests are added to notifications-service, user-service, shared-types, or shared-utils, document this requirement clearly—either in a contribution guide or add a workspace script template/lint rule ensuring any new tests include a corresponding test script.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@package.json` at line 21, Add documentation or automation to ensure every
workspace that contains tests defines a "test" script so the root "test": "turbo
run test" runs them all; specifically, update the contribution guide (e.g.,
CONTRIBUTING.md) to state that any workspace (notifications-service,
user-service, shared-types, shared-utils, swap-service) with tests must include
a "test" script in its package.json, or add a workspace package.json template or
linter/CI rule that enforces presence of the "test" script when test files are
present.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@package.json`:
- Line 21: Add documentation or automation to ensure every workspace that
contains tests defines a "test" script so the root "test": "turbo run test" runs
them all; specifically, update the contribution guide (e.g., CONTRIBUTING.md) to
state that any workspace (notifications-service, user-service, shared-types,
shared-utils, swap-service) with tests must include a "test" script in its
package.json, or add a workspace package.json template or linter/CI rule that
enforces presence of the "test" script when test files are present.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ad4b7d44-f105-4546-bd64-9a63172fa1e5

📥 Commits

Reviewing files that changed from the base of the PR and between 1cc25b5 and 3890bdd.

📒 Files selected for processing (4)
  • .github/workflows/ci.yml
  • apps/swap-service/src/verification/__tests__/setup.ts
  • package.json
  • turbo.json

kaladinlight and others added 5 commits May 6, 2026 14:15
…r tests

Use actions/setup-node's built-in yarn cache, generate the prisma client in
the shared setup step so lint sees @prisma/client types, and drop the ^build
dependency on test (ts-jest transpiles source directly).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
ESLint runs prettier on ts/js via eslint-plugin-prettier, so the format
script only needs to cover the file types eslint doesn't lint.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Remove entries for tools and artifacts this repo doesn't produce (Pulumi,
nyc, lerna, Eclipse, etc.) and ignore Claude Code's local-only files
(settings.local.json, worktrees/) while leaving room to track shared
settings, commands, and agents.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
shared-utils and shared-types declare main/types at ./dist/, so without a
build their consumers' types fall back to error and trigger no-unsafe-* in
typed lint. Filter the build to packages/* (cheap, turbo-cached) and rely
on the build task's existing dep on db:generate to also produce the prisma
client.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@kaladinlight kaladinlight merged commit f5ad085 into develop May 6, 2026
2 checks passed
@kaladinlight kaladinlight deleted the chore/ci-fix branch May 6, 2026 21:58
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