Skip to content

Conversation

@KATO-Hiro
Copy link
Collaborator

@KATO-Hiro KATO-Hiro commented Dec 17, 2025

close #2920

Summary by CodeRabbit

  • New Features

    • Added support for filtering AtCoder Library (ACL) Practice contests as a selectable contest provider.
  • Tests

    • Added comprehensive tests for the ACL Practice provider covering filtering behavior, metadata, display settings, labeling, and edge cases.
  • Documentation

    • Added a test-plan document describing test data, test cases, and stepwise integration for ACL Practice provider tests.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Dec 17, 2025

Walkthrough

Adds 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

Cohort / File(s) Change Summary
Test Planning Documentation
docs/dev-notes/2025-12-17/add_tests_for_contest_table_provider/plan.md
New test plan describing target files, test data construction, test cases (filtering, metadata, display config, labeling, integration) and stepwise implementation.
Provider Implementation
src/lib/utils/contest_table_provider.ts
Added ACLPracticeProvider class (filter for ACL_PRACTICE, metadata, display config, empty round label). Introduced shared regexForJoiFirstQualRound and refactored JOIFirstQualRoundProvider to use it. Registered ACL Practice provider in prepareContestProviderPresets and exposed in contestTableProviderGroups.
Test Suite
src/test/lib/utils/contest_table_provider.test.ts
Added tests for ACLPracticeProvider: filtering behavior, metadata, display config, round label, data fusion, ordering, and empty-input handling; adapted mocks/classification to include practice2 as ACL_PRACTICE.
Test Data
src/test/lib/utils/test_cases/contest_table_provider.ts
Added 12 ACL practice task records (practice2_apractice2_l) created via createContestTasks('practice2', ...) and exported taskResultsForACLPracticeProvider aggregating them.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Files requiring focused review:
    • src/lib/utils/contest_table_provider.ts — verify ACLPracticeProvider filtering, metadata values, and correct registration in presets/groups.
    • regexForJoiFirstQualRound and its use in JOIFirstQualRoundProvider — ensure regex accuracy and no unintended matches.
    • src/test/lib/utils/contest_table_provider.test.ts and src/test/lib/utils/test_cases/contest_table_provider.ts — confirm test data ordering, status variations, and mock contest-type classification consistency.

Poem

🐰 A practice contest hops in bright,
Twelve little tasks lined up just right.
Filters nibble, labels stay light,
Regex hums through day and night,
Code and tests rejoice—what a sight! 🥕✨

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: adding a table for ACL Practice contests with clear reference to the related issue.
Linked Issues check ✅ Passed The PR implements ACLPracticeProvider with filtering, metadata, display config, and comprehensive tests covering filtering, metadata validation, display config, contest labels, and data integrity.
Out of Scope Changes check ✅ Passed All changes are scoped to implementing ACL Practice table support: provider class, test data, test cases, and documentation. A minor refactor extracting regexForJoiFirstQualRound is a reasonable supporting change.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch #2920

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a 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

📥 Commits

Reviewing files that changed from the base of the PR and between 56b4690 and dde7b93.

📒 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 practice2 contest with a realistic mix of submission statuses. The implementation reuses the existing createContestTasks helper, 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 ACLPracticeProvider and taskResultsForACLPracticeProvider align with the new provider and test data.

Also applies to: 39-39


67-68: Mock update correctly handles practice2 classification.

Adding the practice2ContestType.ACL_PRACTICE mapping 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 classifyContest for filtering (matching similar providers like MathAndAlgorithmProvider)
  • 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 AclPractice preset is correctly structured with appropriate group name, button label, and aria label.


1127-1127: LGTM! Provider group registration is correct.

The aclPractice entry properly references the AclPractice preset.

Copy link

@coderabbitai coderabbitai bot left a 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

📥 Commits

Reviewing files that changed from the base of the PR and between dde7b93 and fb44cfb.

📒 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 ACLPracticeProvider instead of MathAndAlgorithmProvider.

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 in getContestRoundLabel is 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.

Copy link
Collaborator Author

@KATO-Hiro KATO-Hiro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@KATO-Hiro KATO-Hiro merged commit fd4ed17 into staging Dec 17, 2025
3 checks passed
@KATO-Hiro KATO-Hiro deleted the #2920 branch December 17, 2025 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feat] テーブル「ACL Practice」を追加しましょう

2 participants