Repository navigation
feat: Mosaic preagg in an ephemeral database - #585
Conversation
Signed-off-by: Ilya Boyandin <[email protected]>
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the 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 configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR adds pre-aggregation configuration support to Mosaic by introducing a new ChangesPre-Aggregation Configuration
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Review rate limit: 0/1 reviews remaining, refill in 31 minutes and 20 seconds.Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/mosaic/__tests__/MosaicSlice.test.ts (1)
9-20: 💤 Low valueConsider adding test cases for partial configuration.
The current test covers both options together. Additional tests for edge cases (only
schema, onlyenabled, orundefinedpreagg) would improve confidence, though the implementation's guards are straightforward.💡 Example additional test cases
it('applies only schema when enabled is omitted', async () => { const coordinator = new Coordinator(); const store = createStore<BaseRoomStoreState & MosaicSliceState>()((...args) => ({ ...createBaseRoomSlice()(...args), ...createMosaicSlice({ coordinator, preagg: { schema: 'custom.schema' }, })(...args), })); await store.getState().mosaic.initialize(); expect(coordinator.preaggregator.schema).toBe('custom.schema'); // enabled should remain at Mosaic's default }); it('preserves defaults when preagg is omitted', async () => { const coordinator = new Coordinator(); const defaultSchema = coordinator.preaggregator.schema; const store = createStore<BaseRoomStoreState & MosaicSliceState>()((...args) => ({ ...createBaseRoomSlice()(...args), ...createMosaicSlice({ coordinator })(...args), })); await store.getState().mosaic.initialize(); expect(coordinator.preaggregator.schema).toBe(defaultSchema); });🤖 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 `@packages/mosaic/__tests__/MosaicSlice.test.ts` around lines 9 - 20, Add focused tests that exercise partial preagg configs: create variants of createTestStore using createMosaicSlice with preagg containing only schema, only enabled, and with preagg omitted; for each, call store.getState().mosaic.initialize() (or mosaic.initialize) and assert Coordinator.preaggregator.schema and enabled reflect only the provided fields (e.g., schema set when given, enabled left as default when omitted, and defaults preserved when preagg is undefined). Use Coordinator and createBaseRoomSlice references from the existing helper to build the store and keep assertions minimal and targeted to the preagg behavior.
🤖 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 `@packages/mosaic/__tests__/MosaicSlice.test.ts`:
- Around line 9-20: Add focused tests that exercise partial preagg configs:
create variants of createTestStore using createMosaicSlice with preagg
containing only schema, only enabled, and with preagg omitted; for each, call
store.getState().mosaic.initialize() (or mosaic.initialize) and assert
Coordinator.preaggregator.schema and enabled reflect only the provided fields
(e.g., schema set when given, enabled left as default when omitted, and defaults
preserved when preagg is undefined). Use Coordinator and createBaseRoomSlice
references from the existing helper to build the store and keep assertions
minimal and targeted to the preagg behavior.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 66f835f7-e537-400c-a8d8-c04c103804e4
📒 Files selected for processing (5)
apps/sqlrooms-cli-ui/src/store.tspackages/mosaic/README.mdpackages/mosaic/__tests__/MosaicSlice.test.tspackages/mosaic/src/MosaicSlice.tspackages/mosaic/src/index.ts
Summary by CodeRabbit
Release Notes
New Features
Documentation
Tests