Skip to content

ci: add test-shared job + honest shared coverage gate - #1293

Merged
LucasSantana-Dev merged 1 commit into
mainfrom
ci/1277-shared-test-job
Jun 10, 2026
Merged

LucasSantana-Dev merged 1 commit into
mainfrom
ci/1277-shared-test-job

Conversation

@LucasSantana-Dev

@LucasSantana-Dev LucasSantana-Dev commented Jun 10, 2026 •

Copy link
Copy Markdown
Owner

What

Adds the missing test-shared CI job and makes the shared coverage gate honest. Closes #1277.

Why

packages/shared tests ran nowhere in CI: ci.yml tests only backend/bot/frontend, and the reusable Quality Gates workflow runs SAST/lint/knip — no jest. Cost of the gap is documented history: three "passes CI, breaks prod" incidents were shared-package issues, and #1262's failing tests sat invisible until this session's test sweep.

Changes

  • ci.yml: new test-shared job mirroring test-backend (needs build-shared, downloads the shared-build artifact for the generated Prisma client, dummy DATABASE_URL for import-time Prisma init per the harden verify-shared-exports.mjs to cover all @lucky/shared subpaths (not just services/*) #1249 precedent). Wired into quality-gate needs + assertion so it blocks merge like the other suites.
  • packages/shared/jest.config.cjs: coverageThreshold 89/89/90/89 → 46/41/38/46. The old gate was enforced by nothing and actual coverage is 47.08/41.83/38.82/46.76 (generated code + barrels already excluded) — wiring the job against 89 would be permanently red. This follows the honest-gate pattern from test(shared): raise coverage threshold to match actual floor #1076: threshold just below measured, ratchet up as coverage improves. Raising real shared coverage is separate work.

Verification

  • Local npm run test --workspace=packages/shared -- --ci --coverage → exit 0, 733/733 pass, gate satisfied
  • actionlint clean on the workflow
  • This PR's own CI run exercises the new job live

Sequencing

Built on top of #1292 (env-test isolation fix) — without it the new job would fail on the first run.


Summary by cubic

Adds a test-shared CI job and makes the shared coverage gate enforceable so packages/shared tests run in CI and block merges when failing. Closes #1277.

  • New Features

    • Added test-shared job that mirrors backend tests, downloads the shared-build artifact, sets DATABASE_URL for Prisma init, and is included in Quality Gates.
  • Bug Fixes

    • Set an honest coverage gate for packages/shared at 46/41/38/46 to match current coverage and prevent perma-red, with room to ratchet up over time.

Written for commit 1ad8696. Summary will update on new commits.

Review in cubic

packages/shared tests ran nowhere in CI: ci.yml tested only
backend/bot/frontend, and the reusable Quality Gates workflow runs no
jest. The 89/89/90/89 coverageThreshold was enforced by nothing — and
actual coverage is 47.08/41.83/38.82/46.76 (generated code and barrels
already excluded), so wiring the job with the old gate would be
permanently red.

- ci.yml: add test-shared job (mirrors test-backend; downloads the
  shared-build artifact for the generated Prisma client; dummy
  DATABASE_URL for import-time Prisma init, per #1249 precedent) and
  wire it into the quality-gate needs + assertion.
- jest.config.cjs: honest gate at 46/41/38/46, just below measured,
  per the #1076 pattern; ratchet upward as coverage improves.

Verified locally: jest --ci --coverage exits 0 (733/733 pass, gate
satisfied); actionlint clean.

Closes #1277
@vercel

vercel Bot commented Jun 10, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
lucky Ready Ready Preview, Comment Jun 10, 2026 12:20am

Request Review

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@LucasSantana-Dev, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 53 minutes and 39 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, 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 include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7fc238a9-e9cd-4303-8e78-2b9420336425

📥 Commits

Reviewing files that changed from the base of the PR and between 588037c and 1ad8696.

📒 Files selected for processing (2)
  • .github/workflows/ci.yml
  • packages/shared/jest.config.cjs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/1277-shared-test-job

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.

@github-actions

Copy link
Copy Markdown

Failed to generate code suggestions for PR

@sonarqubecloud

Copy link
Copy Markdown

@LucasSantana-Dev
LucasSantana-Dev merged commit 7eca113 into main Jun 10, 2026
41 checks passed
@LucasSantana-Dev
LucasSantana-Dev deleted the ci/1277-shared-test-job branch June 10, 2026 00:26

This branch was successfully deployed

1 active deployment
Preview — 1ad8696c Deployed Jun 10, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci: add packages/shared test job — 89% coverage gate currently unenforced

1 participant