Skip to content

Conversation

@KATO-Hiro
Copy link
Collaborator

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

close #2836

Summary by CodeRabbit

  • New Features

    • Added extensive contest/problem data covering ABC 042–125 and ARC 058–103.
    • Added new specialized table views and filters for ABC 042–125 and ARC 058–103 ranges with tailored display and round labeling.
  • Tests

    • Added comprehensive tests for the new providers: filtering, metadata/display config, round label formatting, table generation, mixed/edge-case scenarios, and empty inputs.
  • Documentation

    • Added a detailed test plan describing test design, implementation steps, environment notes, and coverage goals.

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

@coderabbitai
Copy link

coderabbitai bot commented Dec 3, 2025

Walkthrough

Adds two contest table providers (ABC042ToABC125Provider and ARC058ToARC103Provider), expands the tasks and contest-task-pair datasets, introduces tests for the new providers, and adds a developer test-plan document.

Changes

Cohort / File(s) Summary
Planning & Documentation
docs/dev-notes/2025-12-03/add_tests_for_contest_table_provider/plan.md
New test plan describing target files, reference materials, detailed test design for ABC042–125 and ARC058–103 providers, test placement, implementation steps, environment notes, and cautions.
Provider Implementations
src/lib/utils/contest_table_provider.ts
Added ABC042ToABC125Provider and ARC058ToARC103Provider classes (filtering by contest type and round ranges, metadata, display config, contest round label formatting). Registered new provider groups in prepareContestProviderPresets and exposed them in contestTableProviderGroups.
Provider Tests
src/test/lib/utils/contest_table_provider.test.ts
Added tests covering filtering boundaries and type restrictions, metadata/display config, round label formatting, table generation, header/round ID retrieval, empty inputs, and mixed/concurrent contest scenarios for both providers.
Data Expansion — Contest↔Task Mapping
prisma/contest_task_pairs.ts
Large bulk insertion of new contest_task_pairs entries mapping many ABC/ARC (and other) contests to problems across the targeted ranges.
Data Expansion — Tasks
prisma/tasks.ts
Large bulk insertion of new tasks entries (many problem records across ABC and ARC contests, with ids, contest_id, problem_index, name, title, optional grade).
Manifest / Test Config
package.json
Test manifest referenced/updated for test execution context (pnpm test noted in plan).

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

  • Review points:
    • prisma/tasks.ts and prisma/contest_task_pairs.ts: check for duplicates, correct contest/problem IDs, and boundary entries (ABC 042, ABC 125, ARC 058, ARC 103).
    • src/lib/utils/contest_table_provider.ts: verify filter predicates, correct inclusion/exclusion of contest types and round ranges, and registration in presets.
    • src/test/lib/utils/contest_table_provider.test.ts: ensure tests match intended provider behavior and cover edge cases (empty inputs, mixed contest types, shared problems).
    • Confirm plan.md accuracy and that test instructions align with project test runner/config.

Poem

🐰 I hopped through ranges, near and far,
ABC and ARC, each contest star,
Data planted, providers bloom,
Tests parade across the room,
A tiny rabbit cheers the new chart! 🎉

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 'feat: Add tables for ABC 042-125 and ARC 058-103' clearly and specifically describes the main change, directly corresponding to the PR objective of adding contest tables for these ranges.
Linked Issues check ✅ Passed The PR successfully implements the objective from issue #2836 by adding two new provider classes (ABC042ToABC125Provider and ARC058ToARC103Provider) with appropriate filtering, metadata, display configuration, and comprehensive tests, along with supporting data additions.
Out of Scope Changes check ✅ Passed All changes are directly scoped to the linked issue objective: data files and test files support the new providers, documentation outlines the test plan, and no unrelated modifications are present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch #2836

📜 Recent 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 72d991c and 5890b0c.

📒 Files selected for processing (1)
  • docs/dev-notes/2025-12-03/add_tests_for_contest_table_provider/plan.md (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/dev-notes/2025-12-03/add_tests_for_contest_table_provider/plan.md
⏰ 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

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

🧹 Nitpick comments (1)
docs/dev-notes/2025-12-03/add_tests_for_contest_table_provider/plan.md (1)

69-217: Align sample test snippets with the actual provider API

The plan is very detailed and accurately reflects the implemented providers/tests, but earlier sections still show example tests using non-existent methods like getRoundId() and getHeaderId(), while the actual implementation uses getContestRoundIds() and getHeaderIdsForTask(). The “教訓” section explains this, but the outdated snippets can still mislead someone copying them directly.

Consider updating those sample code blocks to use the real methods (getContestRoundIds, getHeaderIdsForTask) so the plan remains copy‑paste safe and fully aligned with the final implementation.

Also applies to: 268-472, 525-541

📜 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 70942d3 and 38f636b.

📒 Files selected for processing (5)
  • docs/dev-notes/2025-12-03/add_tests_for_contest_table_provider/plan.md (1 hunks)
  • prisma/contest_task_pairs.ts (1 hunks)
  • prisma/tasks.ts (4 hunks)
  • src/lib/utils/contest_table_provider.ts (5 hunks)
  • src/test/lib/utils/contest_table_provider.test.ts (3 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
src/test/lib/utils/contest_table_provider.test.ts (2)
src/lib/utils/contest_table_provider.ts (2)
  • ABC042ToABC125Provider (264-297)
  • ARC058ToARC103Provider (332-365)
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 (2)
  • classifyContest (5-97)
  • getContestNameLabel (327-398)
src/lib/types/contest_table_provider.ts (2)
  • ContestTableMetaData (122-125)
  • ContestTableDisplayConfig (149-155)
🔇 Additional comments (7)
prisma/tasks.ts (1)

4308-4602: New ABC042–125 / ARC058–103 task entries look internally consistent

The added task records for ABC125/124/113/112/111, ABC051/044/043/042, and ARC103/102/060/059/058 (including the ABC–ARC shared-problem IDs like arc103_a/arc103_b, arc102_a/arc102_b, arc060_a/arc060_b, arc059_*, arc058_*) are structurally consistent with the existing dataset:

  • id/contest_id/problem_index triples match the patterns used elsewhere (e.g., ARC-origin IDs reused under ABC contest_ids for shared problems).
  • Names/titles align with the canonical AtCoder problem naming conventions for this era.
  • The IDs referenced here are also present in the expanded contest_task_pairs mappings, so nothing appears orphaned.

Given this is static data and the relationships line up with the new providers and mappings, I don’t see functional issues in this block.

Also applies to: 4864-4976

prisma/contest_task_pairs.ts (1)

2-901: ARC058–103 / ABC042–125 mappings match the intended concurrent-era structure

The extended contest_task_pairs:

  • Correctly pair each ABC round in 042–125 with its corresponding ARC problems (C/D as shared where applicable) and vice versa for ARC058–103.
  • Reuse ARC-origin problem_ids (e.g., arc103_a/arc103_b, arc102_a/arc102_b, arc058_*, arc059_*, arc060_*) in both ABC and ARC contexts in a way that matches the data added in tasks.ts.
  • Maintain consistent problem_index letters (C/D) across ABC/ARC sides, which aligns with how these shared problems are shown in tables.
  • Add the extra tessoku-book and math-and-algorithm mappings only for problem IDs that exist in tasks.ts.

I don’t see duplicate or obviously mismatched (contest_id, problem_id, problem_index) entries in this new range; the structure looks sound for the new providers to consume.

Also applies to: 902-1101

src/test/lib/utils/contest_table_provider.test.ts (3)

11-28: New provider imports integrate cleanly with existing test harness

Adding ABC042ToABC125Provider and ARC058ToARC103Provider to the existing import set keeps all providers covered in one place and fits the current test organization; no structural or isolation issues here.


392-548: ABC042–ABC125 provider tests correctly cover range, type, metadata, and shared-problem behavior

The new "ABC 042 to ABC 125" describe block exercises:

  • Range filtering (in/out of 042–125) and ABC-only type filtering.
  • Metadata and display-config fields matching the provider implementation.
  • Round-label formatting using the mocked getContestNameLabel.
  • Table generation for both regular and shared-problem scenarios (ABC042 with arc058_*, and mixed solo/concurrent rounds).

The assertions align with ABC042ToABC125Provider’s actual logic and the mocks for classifyContest / getContestNameLabel, so these tests should reliably guard the new behavior.


697-856: ARC058–ARC103 provider tests robustly validate the concurrent ARC-side behavior

The "ARC 058 to ARC 103" tests validate:

  • Proper range filtering (058–103) and ARC-only type filtering.
  • Provider metadata / display-config consistency.
  • Round-label formatting via the mocked getContestNameLabel.
  • Table generation for ARC058 (including shared C/D vs exclusive E/F) and multi-round concurrent scenarios (e.g., ARC058 with ABC042, ARC060 with ABC044).

They also check getContestRoundIds and empty-input handling, matching ARC058ToARC103Provider’s implementation. The coverage is thorough and lines up well with the provider’s responsibilities.

src/lib/utils/contest_table_provider.ts (2)

258-297: LGTM! Well-structured provider implementation.

The ABC042ToABC125Provider follows the established pattern and correctly implements all required methods. The range filtering (42-125), metadata, display configuration for 4-task contests, and label formatting are all appropriate.


326-365: LGTM! Well-structured provider implementation.

The ARC058ToARC103Provider follows the established pattern and correctly implements all required methods. The range filtering (58-103), metadata, display configuration for 4-task contests, and label formatting are all appropriate.

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 f2be260 into staging Dec 3, 2025
3 checks passed
@KATO-Hiro KATO-Hiro deleted the #2836 branch December 3, 2025 12:39
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 042〜125 & ARC 058〜103(同時開催時代)」を追加しましょう

2 participants