Skip to content

Conversation

@KATO-Hiro
Copy link
Collaborator

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

close #2919

Summary by CodeRabbit

  • New Features

    • Added support for "AtCoder Beginners Selection" (ABS) in contest table presets with tailored metadata, filtering and display configuration.
  • Tests

    • Added comprehensive ABS test suite covering filtering, metadata, display config, table generation, header/round IDs and empty-input cases; included ABS-specific test data.
  • Chores

    • Expanded task dataset and contest-task mappings to include ABS problems.
  • Documentation

    • Added a developer plan outlining unit test design and verification steps for ABS.

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

@coderabbitai
Copy link

coderabbitai bot commented Dec 10, 2025

Walkthrough

Adds a new ABSProvider for "AtCoder Beginners Selection", registers it in provider presets/groups, expands test fixtures and Prisma data for ABS tasks, and introduces a comprehensive ABS-focused test suite and test plan documenting expected behaviors and verification steps.

Changes

Cohort / File(s) Summary
Documentation Plan
docs/dev-notes/2025-12-11/add_tests_for_contest_table_provider/plan.md
New implementation and test plan for ABSProvider unit tests, including test matrix, data helpers, verification checklist and post-implementation notes.
Prisma data additions
prisma/contest_task_pairs.ts, prisma/tasks.ts
Added contest-task mappings and task entries for ABS-related problems (10 new mappings in contest_task_pairs.ts and multiple new task records in tasks.ts) to populate test/fixture data.
Test fixtures
src/test/lib/utils/test_cases/contest_table_provider.ts
Added 11 ABS task fixtures (abs_aabs_k) with varied statuses and exported taskResultsForABS for use in tests.
Provider implementation
src/lib/utils/contest_table_provider.ts
Added exported ABSProvider class (extends ContestTableProviderBase) with filter, metadata, display config, and round-label overrides; registered ABS preset in prepareContestProviderPresets and exposed abs in contestTableProviderGroups.
Provider tests
src/test/lib/utils/contest_table_provider.test.ts
Added ABSProvider test suite covering filtering, metadata/display config, label handling, table generation for 11 problems, header/round IDs, empty-input handling, and updated mocks to recognize ABS contest classification.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Review ABSProvider methods for correct filter logic and consistency with other providers in contest_table_provider.ts.
  • Verify provider registration wiring in prepareContestProviderPresets and contestTableProviderGroups.
  • Validate correctness and consistency of new Prisma entries and that task IDs/indexes match test fixtures.
  • Check test assertions, mocks (contest classification), and fixture ordering (taskResultsForABS) for intended coverage.

Poem

🐰 I hopped in code to add a view,
ABS arrived — eleven true,
Tests arranged in tidy rows,
Providers hum where data flows,
A ribbon of green carrots for you! 🥕

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 table for ABS' clearly summarizes the main change—adding a new ABS (AtCoder Beginners Selection) table feature to the codebase.
Linked Issues check ✅ Passed The PR implements all required coding objectives for issue #2919: creates ABSProvider class with filtering, metadata, and display config; registers ABS provider; adds test coverage and test data.
Out of Scope Changes check ✅ Passed All changes are directly related to implementing the ABS table feature: provider implementation, test data, test cases, and contest/task mappings. No unrelated modifications detected.
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 #2919

📜 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 c858033 and 775b826.

📒 Files selected for processing (1)
  • docs/dev-notes/2025-12-11/add_tests_for_contest_table_provider/plan.md (1 hunks)
⏰ 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 (2)
docs/dev-notes/2025-12-11/add_tests_for_contest_table_provider/plan.md (2)

17-17: Verify relative link paths—they appear to have incorrect depth.

The relative links to source files use five .. segments (../../../../../), but based on the file location (docs/dev-notes/2025-12-11/add_tests_for_contest_table_provider/plan.md), reaching src/ and prisma/ directories should require only four segments (../../../../). Please verify these paths resolve correctly in your environment or adjust them to use the correct depth.

Affected lines:

  • Line 17: [../../../../../src/lib/utils/contest_table_provider.ts]
  • Line 19: [../../../../../src/test/lib/utils/contest_table_provider.test.ts]
  • Line 20: [../../../../../src/test/lib/utils/test_cases/contest_table_provider.ts]
  • Line 25: [../../../../../prisma/tasks.ts]
  • Line 26: [../../../../../prisma/contest_task_pairs.ts]

By contrast, line 24 correctly uses ../../ for the sibling 2025-12-03 directory.

Also applies to: 19-19, 20-20, 25-25, 26-26


395-400: Language identifier for code block is now present.

The previous markdownlint MD040 issue has been resolved—the final fenced code block now correctly specifies text as the language identifier, satisfying the linting requirement. ✅


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

🧹 Nitpick comments (1)
src/lib/utils/contest_table_provider.ts (1)

136-163: LGTM! ABSProvider follows established patterns.

The implementation is consistent with similar single-contest providers like Typical90Provider. The filter condition correctly uses classifyContest to match ContestType.ABS, and the display configuration appropriately hides headers and round labels since ABS is a single collection of problems.

One minor style suggestion: consider prefixing the unused contestId parameter with an underscore to indicate it's intentionally unused.

-  getContestRoundLabel(contestId: string): string {
+  getContestRoundLabel(_contestId: string): string {
     return '';
   }
📜 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 742a9c6 and c858033.

📒 Files selected for processing (6)
  • docs/dev-notes/2025-12-11/add_tests_for_contest_table_provider/plan.md (1 hunks)
  • prisma/contest_task_pairs.ts (1 hunks)
  • prisma/tasks.ts (2 hunks)
  • src/lib/utils/contest_table_provider.ts (3 hunks)
  • src/test/lib/utils/contest_table_provider.test.ts (3 hunks)
  • src/test/lib/utils/test_cases/contest_table_provider.ts (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
src/test/lib/utils/test_cases/contest_table_provider.ts (1)
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)
🪛 markdownlint-cli2 (0.18.1)
docs/dev-notes/2025-12-11/add_tests_for_contest_table_provider/plan.md

395-395: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

⏰ 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 (8)
prisma/tasks.ts (1)

4512-4574: ABS source problem entries look consistent and correct

The added task records for the ABS component problems (abc088_b, abc087_b, arc089_a, abc086_a, abc085_c, abc085_b, abc083_b, abc081_b, abc081_a, arc065_a) use the expected id, original contest_id, problem_index, and titles, and fit the existing schema without introducing new fields. No issues from a data- or type-consistency perspective.

Also applies to: 4610-4616

prisma/contest_task_pairs.ts (1)

2-51: ABS contest-task mappings are coherent with the ABS problem list

The new contest_task_pairs entries for contest_id: 'abs' correctly remap the underlying problems (practice_1 excluded because it is already native to abs) to indices B–K in the documented ABS order. This is consistent with the task IDs added in prisma/tasks.ts and with how other virtual contests are modeled.

src/test/lib/utils/test_cases/contest_table_provider.ts (1)

419-449: ABS test data block is well-structured and consistent

The ABS test dataset (abs_a–abs_k) cleanly mirrors the real ABS problem set: correct taskId/taskTableIndex mapping, ordered A–K, and a deliberate mix of statuses (AC/AC_WITH_EDITORIAL/TRYING/PENDING) useful for exercising provider behavior. It follows the existing createContestTasks pattern and integrates cleanly via the taskResultsForABS export.

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

919-926: LGTM! Preset registration is correct.

The ABS preset follows the same pattern as other single-provider groups (e.g., Typical90, MathAndAlgorithm). The button label is appropriately concise, and the aria label provides accessibility context.


1073-1073: LGTM! ABS group exported correctly.

The abs key is appropriately registered and follows the naming convention used by other groups.

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

7-7: LGTM! Imports updated correctly.

The ABSProvider and taskResultsForABS imports are properly added to support the new test suite.

Also applies to: 35-35


43-45: LGTM! Mock updated correctly.

The mock correctly handles the 'abs' contest ID before checking startsWith('abc'), which ensures proper classification since 'abs' starts with 'ab' but should not match the ABC pattern.


205-325: LGTM! Comprehensive ABS test suite.

The test suite provides excellent coverage:

  • Filtering logic validated with both pure ABS and mixed contest data
  • All metadata and display configuration values verified
  • Table structure confirmed to have all 11 problems (A-K)
  • Multi-source verification at lines 289-310 is a thoughtful domain-specific test that confirms ABS problems originate from various AtCoder contests
  • Empty input edge case properly handled

The tests follow the established patterns used by other provider tests in this file.

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 34ee1e1 into staging Dec 10, 2025
3 checks passed
@KATO-Hiro KATO-Hiro deleted the #2919 branch December 10, 2025 13:17
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] テーブル「ABS」を追加しましょう

2 participants