-
-
Notifications
You must be signed in to change notification settings - Fork 10
feat: Add tables for ABC 001-041 and ARC 001-057 (#2838) #2934
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughTwo new contest table providers are added to filter old ABC (001–041) and ARC (001–057) contest problems. Provider classes, tests, and task data are introduced to support filtering by these contest ranges with appropriate metadata and display configurations. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ 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. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
docs/dev-notes/2025-12-10/add_tests_for_contest_table_provider/plan.md (1)
1-477: Test plan matches implementation and covers key behaviorsThe plan thoroughly mirrors the actual providers and tests (filtering ranges, metadata, display config, round labels, table generation, ID/header extraction, empty-input handling) and correctly notes that ABC001–041/ARC001–057 have no shared problems. Only minor nit: the explicit source line numbers for providers can drift as files change, but that’s purely a documentation maintenance concern.
📜 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-12-10/add_tests_for_contest_table_provider/plan.md(1 hunks)prisma/tasks.ts(2 hunks)src/lib/utils/contest_table_provider.ts(5 hunks)src/test/lib/utils/contest_table_provider.test.ts(3 hunks)src/test/lib/utils/test_cases/contest_table_provider.ts(2 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
src/test/lib/utils/contest_table_provider.test.ts (1)
src/lib/utils/contest_table_provider.ts (2)
ABC001ToABC041Provider(303-336)ARC001ToARC057Provider(410-443)
src/lib/utils/contest_table_provider.ts (3)
src/lib/types/task.ts (1)
TaskResult(64-72)src/lib/utils/contest.ts (2)
classifyContest(5-97)getContestNameLabel(327-398)src/lib/types/contest_table_provider.ts (2)
ContestTableMetaData(122-125)ContestTableDisplayConfig(149-155)
⏰ 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 (9)
prisma/tasks.ts (1)
4603-4777: Legacy ABC/ARC task additions look consistent and aligned with new providersThe newly added ABC001–041 and ARC001–057 task entries use correct
contest_id(abcNNN/arcNNN), problem indices (A–D or numeric suffixes), and Japanese titles that match the original contests. They line up with the filter ranges ofABC001ToABC041ProviderandARC001ToARC057Provider, so the new providers will see complete data for these rounds. I don’t see correctness or structural issues here.Also applies to: 5144-5311
src/lib/utils/contest_table_provider.ts (2)
299-336: New legacy ABC/ARC providers correctly encapsulate pre-rating ranges
ABC001ToABC041ProviderandARC001ToARC057Providerboth (1) restrict by contest type viaclassifyContest, (2) bound rounds viaparseContestRoundwith inclusive ranges[1, 41]and[1, 57], and (3) use metadata/display config consistent with adjacent ABC042–125 / ARC058–103 providers. Round labels are derived viagetContestNameLabeland simple prefix stripping, matching existing patterns. No logic gaps or boundary off‑by‑one issues spotted.Also applies to: 406-443
935-943: Presets and exported groups for legacy ranges are wired up consistentlyThe new presets
ABC001ToABC041andARC001ToARC057use clear group names, localized button labels (旧 ABC/旧 ARC), and aria labels that accurately describe the filtered ranges, and they instantiate the correct providers withContestType.ABC/ContestType.ARC. The publiccontestTableProviderGroupsentries (fromAbc001ToAbc041,fromArc001ToArc057) follow the existing naming convention and expose these groups uniformly.Also applies to: 962-969, 1043-1044
src/test/lib/utils/contest_table_provider.test.ts (3)
6-30: New provider imports are correctly wired into the test suiteAdding
ABC001ToABC041ProviderandARC001ToARC057Providerto the existing import list keeps all provider tests consolidated in one place and ensures the new implementations participate in the shared base/provider-group tests alongside the existing ABC/ARC providers.
552-688: ABC001ToABC041Provider tests comprehensively validate legacy ABC behaviorThis block exercises the provider across all important facets: range filtering (including both numeric and alphabetic ID suffix formats), exclusion of ARC contests, metadata/display config values, round label formatting, table generation for 4-problem contests, round ID/header ID extraction, and empty-input handling. The mock
TaskResultobjects supply only the fields actually used by the provider, which keeps the tests focused and maintainable.
998-1134: ARC001ToARC057Provider tests mirror ABC coverage and look solidThe ARC tests symmetrically cover range filtering (001–057, numeric/alphabetic suffixes), separation from ABC contests, metadata and display config, round label formatting, table generation for 4-problem contests, contest round IDs, header IDs, and empty-input behavior. This symmetry with the ABC001–041 tests makes future maintenance straightforward and gives strong confidence in the new legacy ARC provider’s behavior.
src/test/lib/utils/test_cases/contest_table_provider.ts (3)
123-149: LGTM! ABC test data structure is well-organized.The test data correctly represents both ID formats:
- Numeric format for ABC001-019 (e.g.,
abc001_1)- Alphabet format for ABC020-041 (e.g.,
abc020_a)Using boundary samples (001, 019, 020, 041) rather than all contests is an appropriate testing strategy.
151-177: LGTM! ARC test data mirrors ABC structure consistently.The test data correctly represents both ID formats for ARC contests:
- Numeric format for ARC001-034 (e.g.,
arc001_1)- Alphabet format for ARC035-057 (e.g.,
arc035_a)The structure is consistent with the ABC test data approach.
310-341: Verify the ABC upper boundary.There's a discrepancy between the linked issue and the PR:
- Linked issue #2838 mentions "旧 ABC(ABC 001〜042)" (includes 042)
- PR title states "ABC 001-041" (excludes 042)
- Test data goes up to ABC041
Please confirm whether ABC042 should be included or excluded from the legacy ABC table.
KATO-Hiro
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
close #2838
Summary by CodeRabbit
New Features
Tests
Documentation
✏️ Tip: You can customize this high-level summary in your review settings.