ci: align coverage with Rocket.Chat house style (Codecov, no hard gate) - #3366
Conversation
|
Warning Review limit reached
More reviews will be available in 2 minutes and 38 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
WalkthroughThe PR integrates Codecov into the CI workflow by adding a ChangesCodecov Integration
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~4 minutes Suggested labels
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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. Comment |
71b221c to
777936f
Compare
Sets up component testing so the renderer layer can be covered. - Add devDeps: @testing-library/react 14.3.1, jest-dom 6.9.1, user-event 14.6.1, dom 9.3.4 (React 18 compatible) - Import @testing-library/jest-dom in src/.jest/setup.ts for DOM matchers - src/jest-dom.d.ts: register jest-dom matcher types for tsc (the dotted .jest dir is excluded from the TS program, so the augmentation lives in an included path) - src/ui/test-utils.tsx: renderWithStore() helper wrapping components in a redux Provider with preloaded state; re-exports RTL + userEvent; documents the react-i18next mock snippet for component specs - Example spec: ServersView/ErrorView.spec.tsx proves the pattern RTL works out-of-box under @kayahr/jest-electron-runner (real renderer DOM, no jsdom, no jest.config change). 807 tests pass, lint clean.
Adds RTL behavior tests for 14 renderer components — dialogs (Update, ScreenSharing, ClearCache, SupportedVersion, OutlookCredentials), containers (DownloadsManagerView, AddServerView, SideBar, Shell), leaf components (DownloadItem, ModalBackdrop, ServerButton) and the ui/utils helpers (createAnchor, ReparentingContainer). Also hardens 3 main-process specs (logging/index, ScreenSharingRequest- Tracker, desktopCapturerCache) with fake timers + afterEach cleanup — a real setInterval in logging/index.ts was leaking ref'd handles across isolateModules reloads and hanging the suite past --forceExit. Ratchets coverageThreshold to lines/statements 32, branches 28, functions 26. Coverage: lines 26.72% -> 33.29%, statements -> 33.65%, branches -> 29.33%, functions -> 27.31%. 912 tests pass, 2 skipped, 52 suites. Three component specs (ErrorView, ServerInfoContent, AboutDialog) are held back — they leak async/DOM teardown that the strict uncaught- exception handler in src/.jest/setup.ts turns into a process.exit(1); tracked in docs/KNOWN_ISSUES.md for a follow-up.
Match the main monorepo's coverage approach: - Drop the hard coverageThreshold gate from jest.config.js — the main Rocket.Chat repo tracks coverage informationally (codecov project threshold 1%, patch off), not as a build-time gate. - Add codecov.yml mirroring the monorepo: patch off, project target auto/threshold 1%, unit flag with carryforward, reach/diff/flags comment layout. - validate-pr.yml: upload coverage via codecov/codecov-action@v6.0.1 (same pinned action as the monorepo) with the unit flag and fail_ci_if_error:false so coverage never blocks merge. Artifact upload kept as a tokenless fallback. Requires a CODECOV_TOKEN repo secret (the monorepo uses org-level Codecov). Until it is added, the action no-ops gracefully and the artifact fallback still publishes coverage/. Not adopted: coverageProvider v8 (monorepo uses @swc/jest+jsdom; our ts-jest + @kayahr/jest-electron-runner stack needs separate validation) and @rocket.chat/mock-providers (monorepo-internal, not published to npm — our renderWithStore helper stays).
46ff5d4 to
4ae2223
Compare
What
Aligns this repo's coverage reporting with the main Rocket.Chat monorepo's conventions, after comparing the two setups. Stacked on the Phase 3 PR.
Why
The monorepo tracks coverage informationally via Codecov — it does not hard-gate builds. Our earlier PRs added a hard
coverageThresholdratchet, which is stricter than the parent project. This PR matches the house style.Changes
coverageThreshold(fail CI below floor)coverage/artifact uploadcodecov-action@v6.0.1, same pinned SHA as monorepo) + artifact fallbackcodecov.ymlmirroring monorepo:patch: off, projecttarget: auto / threshold: 1%,unitflag carryforward,reach,diff,flagscommentfail_ci_if_error: false— coverage never blocks mergeAction required
Add a
CODECOV_TOKENrepo secret (the monorepo uses org-level Codecov). Until then, the Codecov step no-ops gracefully and the artifact fallback still publishescoverage/.Comparison notes (what we did NOT adopt, with reasons)
coverageProvider: 'v8'— the monorepo uses@swc/jest+ jsdom; our stack ists-jest+@kayahr/jest-electron-runner(real renderer DOM). v8 under that combo needs separate validation before switching — deferred, not adopted blind.@rocket.chat/mock-providers(mockAppRoot()builder) — monorepo-internal, not published to npm (404). OurrenderWithStorehelper stays.Effect on the coverage initiative
Coverage still measured + reported on every PR (now via Codecov PR comments + trend, like the monorepo). The 33% → 50% climb continues through component-test waves; without a hard gate, adding waves has less CI friction — matching how the parent project operates.
Summary by CodeRabbit