-
-
Notifications
You must be signed in to change notification settings - Fork 10
feat: Add table for ACL Practice (#2920) #2964
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
WalkthroughAdds an ACLPracticeProvider implementation and registers it in provider presets, refactors JOI first-qual round detection into a shared regex, and introduces corresponding unit tests and 12 test task records for the ACL Practice contest. No exported API signatures were removed. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 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: 2
📜 Review details
Configuration used: Organization 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 (4)
docs/dev-notes/2025-12-17/add_tests_for_contest_table_provider/plan.md(1 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)
🧰 Additional context used
🧬 Code graph analysis (3)
src/test/lib/utils/test_cases/contest_table_provider.ts (1)
src/lib/types/task.ts (1)
TaskResults(74-74)
src/test/lib/utils/contest_table_provider.test.ts (2)
src/lib/utils/contest_table_provider.ts (2)
ACLPracticeProvider(773-800)MathAndAlgorithmProvider(645-672)src/lib/types/task.ts (1)
TaskResults(74-74)
src/lib/utils/contest_table_provider.ts (3)
src/lib/types/task.ts (1)
TaskResult(64-72)src/lib/utils/contest.ts (1)
classifyContest(5-97)src/lib/types/contest_table_provider.ts (2)
ContestTableMetaData(122-125)ContestTableDisplayConfig(149-155)
🔇 Additional comments (8)
src/test/lib/utils/test_cases/contest_table_provider.ts (1)
665-709: LGTM! Test data for ACL Practice follows established patterns.The test data correctly defines 12 tasks (A-L) for the
practice2contest with a realistic mix of submission statuses. The implementation reuses the existingcreateContestTaskshelper, maintaining consistency with other test data in the file.docs/dev-notes/2025-12-17/add_tests_for_contest_table_provider/plan.md (1)
1-315: Good internal documentation for the test implementation.The plan document provides clear context for the ACL Practice provider implementation and includes useful lessons learned. This will help future developers understand the design decisions and avoid common pitfalls like missing mock updates.
src/test/lib/utils/contest_table_provider.test.ts (3)
18-18: LGTM! Imports added correctly.The imports for
ACLPracticeProviderandtaskResultsForACLPracticeProvideralign with the new provider and test data.Also applies to: 39-39
67-68: Mock update correctly handles practice2 classification.Adding the
practice2→ContestType.ACL_PRACTICEmapping to the mock ensures the provider filtering tests work correctly.
1986-2066: Comprehensive test coverage for ACL Practice Provider.The tests cover filtering, metadata, display config, round label, data validation, and data fusion scenarios appropriately.
src/lib/utils/contest_table_provider.ts (3)
773-800: LGTM! ACLPracticeProvider implementation follows established patterns.The provider correctly:
- Uses
classifyContestfor filtering (matching similar providers likeMathAndAlgorithmProvider)- Returns appropriate metadata with title and abbreviation
- Uses the same display config as EDPC/TDPC/FPS24 providers
- Returns empty string for contest round label (consistent with single-contest providers)
1094-1101: Preset registration follows the established pattern.The
AclPracticepreset is correctly structured with appropriate group name, button label, and aria label.
1127-1127: LGTM! Provider group registration is correct.The
aclPracticeentry properly references theAclPracticepreset.
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)
src/test/lib/utils/contest_table_provider.test.ts (1)
2043-2053: Consider whether test data verification is necessary.This test validates the structure of the imported test data itself (12 tasks, all with contest_id 'practice2', indices A-L). While this provides good documentation and catches potential test data issues, it's more typical to assume test fixtures are correct and focus on testing provider behavior. This pattern isn't used consistently across other provider test suites.
If test data validation is valuable here, consider applying it consistently to other providers; otherwise, this test could be removed since the other tests will fail if the data is malformed.
📜 Review details
Configuration used: Organization 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 (2)
src/lib/utils/contest_table_provider.ts(3 hunks)src/test/lib/utils/contest_table_provider.test.ts(4 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/lib/utils/contest_table_provider.ts (3)
src/lib/types/task.ts (1)
TaskResult(64-72)src/lib/utils/contest.ts (1)
classifyContest(5-97)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 (7)
src/test/lib/utils/contest_table_provider.test.ts (3)
18-18: LGTM!The imports for ACLPracticeProvider and its test data are correctly added and follow the established pattern.
Also applies to: 39-39
67-68: LGTM!The mock classification for 'practice2' correctly maps to ACL_PRACTICE, enabling proper testing of the ACL Practice provider.
1986-2074: LGTM!The ACL Practice Provider test suite is comprehensive and follows the established testing patterns. All test cases properly verify filtering logic, metadata, display configuration, and edge cases. The previously reported issue at lines 2068-2073 has been correctly resolved—the test now uses
ACLPracticeProviderinstead ofMathAndAlgorithmProvider.src/lib/utils/contest_table_provider.ts (4)
772-799: LGTM!The ACLPracticeProvider implementation follows established patterns and is consistent with similar providers (EDPC, TDPC, FPS24). The filtering logic correctly uses
classifyContest, the display configuration appropriately disables headers and round labels while showing task indices, and the unused parameter ingetContestRoundLabelis properly prefixed with an underscore.
801-801: LGTM!Good refactoring to extract the JOI first qualifying round regex into a shared constant. This improves maintainability by having a single source of truth for the pattern and makes the code more readable. The module-level scope is appropriate since it's only used within this file.
Also applies to: 810-810
1093-1100: LGTM!The AclPractice preset follows the established pattern for single-contest provider groups. The metadata (group name, button label, aria label) is appropriately descriptive and accessible, and the implementation is consistent with similar presets like ABS, Typical90, and MathAndAlgorithm.
1126-1126: LGTM!The registration of aclPractice in contestTableProviderGroups follows the established pattern and uses a key name consistent with the provider's abbreviationName metadata.
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 #2920
Summary by CodeRabbit
New Features
Tests
Documentation
✏️ Tip: You can customize this high-level summary in your review settings.