Conversation
WalkthroughAdds an ARC104Onwards contest table provider, registers it in provider groups, expands task entries for multiple ARC contests, introduces test data and tests for ARC104+ behavior, and adds a development plan document describing test design and implementation steps. Changes
Sequence Diagram(s)sequenceDiagram
participant UI as UI Layer
participant Provider as ARC104OnwardsProvider
participant Parser as Round Parser
participant Store as Task Data Store
UI->>Provider: Request contest table (ARC104+)
Provider->>Store: Fetch tasks with contest_id prefix "arc"
Store-->>Provider: Return task list
Provider->>Parser: parseContestRound(contest_id)
Parser-->>Provider: numeric round or error
Provider->>Provider: filter rounds >= 104, strip "arc" prefix for labels
Provider-->>UI: Return filtered contests + metadata/table structure
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro Cache: Disabled due to data retention organization setting Knowledge base: Disabled due to data retention organization setting 📒 Files selected for processing (1)
🔇 Additional comments (3)
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (4)
prisma/tasks.ts (1)
4330-4583: ARC task entries look consistent; consider whether you want grades for these tooThe new ARC104–ARC209 task entries follow the existing
tasksshape (consistentid/contest_id/problem_index/name/titleand unique IDs). If you have difficulty/grade data for these contests, you may want to populate thegradefield for consistency with nearby ARC items, but functionally this is fine as-is.src/lib/utils/contest_table_provider.ts (1)
740-748: ARC104Onwards preset and group key wiring look correct; consider adding a preset testThe new
ARC104Onwardspreset uses appropriate group name, button label, and aria label, and registers anARC104OnwardsProvider(ContestType.ARC)under the exportedarc104Onwardskey. This matches the existing preset pattern.You might also add a small unit test in
prepareContestProviderPresets’s suite to assert this preset’s metadata and provider type, mirroring the ABC and Typical90 presets.Also applies to: 808-808
src/test/lib/utils/test_cases/contest_table_provider.ts (1)
382-447: ARC104+ test data patterns are well structuredThe ARC104/120/204/208 fixtures correctly cover the intended 4-, 5-, 6-, and 7-problem patterns (including the
F2special case) and provide enough status variation for filtering/table tests. Note that the dev-notes snippets show slightly different statuses (e.g.,arc104_fas AC), but since tests only assert indices and contest IDs, this discrepancy is harmless; align them only if you want the docs to mirror the concrete data.src/test/lib/utils/contest_table_provider.test.ts (1)
384-529: ARC104Onwards test suite gives solid coverage; consider adding a small label/displayConfig checkThe
describe('ARC 104 Onwards', ...)block thoroughly validates:
- Filtering by contest type and round range (104–999).
- Metadata content.
- Header ID extraction and sort order (including the
F2case).- Table structure across multiple contests.
- 4/5/6/7‑problem patterns and mixed contest-type inputs.
- Exclusion of rounds below ARC104.
Given the dev plan, you might optionally add a quick assertion that
getDisplayConfig()andgetContestRoundLabel('arc378')behave like the ABC providers, but functionally the current suite is already strong.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge base: Disabled due to data retention organization setting
📒 Files selected for processing (5)
docs/dev-notes/2025-11-15/add_tests_for_contest_table_provider/plan.md(1 hunks)prisma/tasks.ts(3 hunks)src/lib/utils/contest_table_provider.ts(4 hunks)src/test/lib/utils/contest_table_provider.test.ts(4 hunks)src/test/lib/utils/test_cases/contest_table_provider.ts(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: preview
🔇 Additional comments (3)
src/lib/utils/contest_table_provider.ts (1)
259-284: ARC104OnwardsProvider implementation is consistent with existing ABC range providersThe ARC104OnwardsProvider correctly:
- Filters by
ContestType.ARCand rounds104–999viaparseContestRound(contest_id, 'arc').- Reuses the default
getDisplayConfigfrom the base class.- Formats round labels by stripping
'ARC 'fromgetContestNameLabel.This aligns with ABC range providers’ behavior and should integrate cleanly with the existing table UI.
docs/dev-notes/2025-11-15/add_tests_for_contest_table_provider/plan.md (1)
1-699: Dev plan clearly matches the implemented ARC104Onwards workThis plan document thoroughly describes the ARC104OnwardsProvider test strategy (patterns, displayConfig, edge cases, and mock data layout) and matches the structure of the actual fixtures/tests. There are minor cosmetic differences in example statuses versus the current test data, but nothing that impacts correctness; update those only if you want the examples to be exact copies.
src/test/lib/utils/contest_table_provider.test.ts (1)
11-12: ARC-related imports and mocks are correctly extendedImporting
ARC104OnwardsProviderand the new ARC104+ fixture, plus extending theclassifyContest/getContestNameLabelmocks to recognizearc*IDs, is exactly what’s needed to exercise ARC providers alongside ABC/others. This keeps test behavior consistent with how real contest IDs are handled.Also applies to: 27-30, 35-39, 58-63
close #2835
Summary by CodeRabbit
New Features
Tests
Documentation