Skip to content

Conversation

@KATO-Hiro
Copy link
Collaborator

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

close #2838

Summary by CodeRabbit

  • New Features

    • Added support for filtering and managing older AtCoder contests (ABC 001–041 and ARC 001–057) with dedicated provider groups.
    • Expanded contest task dataset with additional problem entries.
  • Tests

    • Added comprehensive test coverage for new contest providers, including filtering, metadata retrieval, and table generation.
  • Documentation

    • Added planning documentation for test expansion and coverage guidelines.

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

@coderabbitai
Copy link

coderabbitai bot commented Dec 10, 2025

Walkthrough

Two 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

Cohort / File(s) Change Summary
Provider Implementation
src/lib/utils/contest_table_provider.ts
Added ABC001ToABC041Provider and ARC001ToARC057Provider classes extending ContestTableProviderBase. Each implements filtering logic for their respective contest ranges, metadata retrieval, display configuration, and contest round label formatting. Registered new provider groups (fromAbc001ToAbc041, fromArc001ToArc057) and presets in prepareContestProviderPresets().
Test Suite
src/test/lib/utils/contest_table_provider.test.ts
Exported new provider classes and added comprehensive test suites covering filtering behavior, metadata/display config retrieval, contest round label formatting, table generation for numeric and alphabet ID formats, contest/header ID extraction, and empty input handling.
Test Data
src/test/lib/utils/test_cases/contest_table_provider.ts
Introduced createContestsRange() helper function and expanded test task definitions across ABC001–ABC041 and ARC001–ARC057 ranges with multiple status variants. Added new constants and task results to populate test dataset.
Task Data
prisma/tasks.ts
Added new task entries for ABC and ARC series contests, expanding the dataset with problem definitions including id, contest_id, problem_index, name, title, and grade fields.
Documentation
docs/dev-notes/2025-12-10/add_tests_for_contest_table_provider/plan.md
Added comprehensive test design plan specifying target providers, test coverage scope, test case categories, mock data requirements, and implementation guidance for provider testing patterns.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • src/lib/utils/contest_table_provider.ts: Verify that filtering logic for ABC 001–041 and ARC 001–057 ranges is correct and follows established ContestTableProviderBase patterns.
  • src/test/lib/utils/contest_table_provider.test.ts: Review extensive test cases for edge cases, boundary conditions (e.g., ABC 041/042 boundary, ARC 057/058 boundary), and proper isolation between contest types.
  • src/test/lib/utils/test_cases/contest_table_provider.ts: Ensure test data consistency, verify that createContestsRange() generates correct alternating statuses, and confirm task definitions align with provider filtering expectations.
  • prisma/tasks.ts: Spot-check a sample of new task entries for data integrity and consistency.

Poem

🐰 Of old contests we now do speak,
ABC and ARC that reach their peak,
From 001 to limits set,
Our table filters—no contest yet!
With tests to guard each filtering rule,
The past contests shine bright as jewel.

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 PR title accurately describes the main change: adding tables for ABC 001-041 and ARC 001-057 contests, which aligns with the file changes and linked issue objective.
Linked Issues check ✅ Passed The PR implements the objective from issue #2838 by adding table providers (ABC001ToABC041Provider, ARC001ToARC057Provider), supporting data in tasks.ts, comprehensive test coverage, and test data.
Out of Scope Changes check ✅ Passed All changes are focused on implementing contest tables for ABC 001-041 and ARC 001-057, including providers, data, tests, and documentation without unrelated modifications.
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 #2838

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: 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 behaviors

The 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

📥 Commits

Reviewing files that changed from the base of the PR and between e437f55 and f8d98db.

📒 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 providers

The 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 of ABC001ToABC041Provider and ARC001ToARC057Provider, 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

ABC001ToABC041Provider and ARC001ToARC057Provider both (1) restrict by contest type via classifyContest, (2) bound rounds via parseContestRound with 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 via getContestNameLabel and 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 consistently

The new presets ABC001ToABC041 and ARC001ToARC057 use clear group names, localized button labels (旧 ABC / 旧 ARC), and aria labels that accurately describe the filtered ranges, and they instantiate the correct providers with ContestType.ABC / ContestType.ARC. The public contestTableProviderGroups entries (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 suite

Adding ABC001ToABC041Provider and ARC001ToARC057Provider to 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 behavior

This 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 TaskResult objects 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 solid

The 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.

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 43757b6 into staging Dec 10, 2025
3 checks passed
@KATO-Hiro KATO-Hiro deleted the #2838 branch December 10, 2025 08:46
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] テーブル「旧 ABC(ABC 001〜042)」「旧 ARC(ARC 001〜057)」を追加しましょう

2 participants