Skip to content

feat(table): Add table for ARC 104 onwards (#2835)#2845

Merged
KATO-Hiro merged 2 commits intostagingfrom
#2835
Nov 17, 2025
Merged

feat(table): Add table for ARC 104 onwards (#2835)#2845
KATO-Hiro merged 2 commits intostagingfrom
#2835

Conversation

@KATO-Hiro
Copy link
Collaborator

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

close #2835

Summary by CodeRabbit

  • New Features

    • Added "ARC 104 Onwards" contest group for filtering and viewing ARC contests from round 104 onward
    • Expanded contest task database with many new ARC entries (rounds 104–209)
  • Tests

    • Added comprehensive test suite covering ARC 104 onwards patterns, table generation, headers, and edge cases
    • Introduced consolidated test data for ARC 104+ scenarios
  • Documentation

    • Added a detailed testing plan outlining test cases, mock data, and verification steps

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 17, 2025

Walkthrough

Adds an ARC104Onwards contest table provider, registers it in provider groups, expands task entries for multiple ARC contests, introduces test data and tests for ARC104+ behavior, and adds a development plan document describing test design and implementation steps.

Changes

Cohort / File(s) Summary
Documentation & Planning
docs/dev-notes/2025-11-15/add_tests_for_contest_table_provider/plan.md
New planning document with test design, implementation checklist, target provider specs, mock-data design, test cases (12–14), and operational notes for ARC104OnwardsProvider testing.
Contest Task Data
prisma/tasks.ts
Adds many new task entries for ARC contests (e.g., arc209, arc208, arc204, arc120, arc105, arc104) including problem indices, ids, names, titles, and occasional grades.
Provider Implementation
src/lib/utils/contest_table_provider.ts
Introduces ARC104OnwardsProvider (extends ContestTableProviderBase), adds parsing validation for contest rounds (numeric check after prefix removal), custom getContestRoundLabel that strips ARC prefix, and registers a new provider group ARC104Onwards exposed via contestTableProviderGroups.
Test Suite
src/test/lib/utils/contest_table_provider.test.ts
Adds an "ARC 104 Onwards" test suite, exposes ARC104OnwardsProvider in imports, extends mocks to handle arc contests, and exercises filtering, metadata, header IDs, table structure, round handling, multi-patterns, and edge cases.
Test Data
src/test/lib/utils/test_cases/contest_table_provider.ts
Adds export const taskResultsForARC104OnwardsProvider: TaskResults aggregating task results for ARC104, ARC120, ARC204, ARC208 sequences for use in tests.

Sequence Diagram(s)

sequenceDiagram
    participant UI as UI Layer
    participant Provider as ARC104OnwardsProvider
    participant Parser as Round Parser
    participant Store as Task Data Store

    UI->>Provider: Request contest table (ARC104+)
    Provider->>Store: Fetch tasks with contest_id prefix "arc"
    Store-->>Provider: Return task list
    Provider->>Parser: parseContestRound(contest_id)
    Parser-->>Provider: numeric round or error
    Provider->>Provider: filter rounds >= 104, strip "arc" prefix for labels
    Provider-->>UI: Return filtered contests + metadata/table structure
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Pay attention to: provider inheritance and registration, round parsing validation, label-stripping correctness, and the new large data additions in prisma/tasks.ts.
  • Review tests for coverage of edge cases (4–7 problem patterns) and consistency with the new test data export.

Poem

🐰 I hopped through ARC one-o-four,
Collected tasks and tests galore.
I parse, I filter, labels neat—
From data rows to test repeat.
ARC onwards, hop! 🎉

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main feature addition: a new table for ARC contests from round 104 onwards.
Linked Issues check ✅ Passed The PR implements the requested feature to add a new table for ARC 104 onwards (#2835), with provider implementation, tests, and data.
Out of Scope Changes check ✅ Passed All changes are directly related to implementing the ARC 104 onwards table feature and supporting test infrastructure.
✨ 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 #2835

📜 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 fa58927 and 55ef552.

📒 Files selected for processing (1)
  • src/lib/utils/contest_table_provider.ts (3 hunks)
🔇 Additional comments (3)
src/lib/utils/contest_table_provider.ts (3)

739-746: LGTM!

The registration in prepareContestProviderPresets follows the established pattern for single-provider groups. The metadata labels are appropriate and consistent with similar ABC provider registrations.


807-807: LGTM!

The export registration correctly adds the ARC104Onwards provider group to the public API, following the established naming convention and pattern.


258-283: LGTM! Utilities verified to support ARC contests correctly.

Verification confirms all imported utilities properly handle ARC contests:

  • classifyContest: Regex /^arc\d{3}$/ correctly identifies ARC contests and returns ContestType.ARC
  • parseContestRound: Function accepts prefix parameter and correctly parses ARC contest rounds with the 'arc' prefix
  • getContestNameLabel: Regex /^(abc|arc|agc)(\d{3})/i includes ARC and correctly formats labels (e.g., 'arc104' → 'ARC 104')
  • ARC104OnwardsProvider: Implementation correctly filters contests 104-999 and properly strips 'ARC ' prefix in getContestRoundLabel

The implementation follows established patterns and is backed by comprehensive test coverage (10+ test cases for ARC104OnwardsProvider).


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
Contributor

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

4330-4583: ARC task entries look consistent; consider whether you want grades for these too

The new ARC104–ARC209 task entries follow the existing tasks shape (consistent id/contest_id/problem_index/name/title and unique IDs). If you have difficulty/grade data for these contests, you may want to populate the grade field for consistency with nearby ARC items, but functionally this is fine as-is.

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

740-748: ARC104Onwards preset and group key wiring look correct; consider adding a preset test

The new ARC104Onwards preset uses appropriate group name, button label, and aria label, and registers an ARC104OnwardsProvider(ContestType.ARC) under the exported arc104Onwards key. This matches the existing preset pattern.

You might also add a small unit test in prepareContestProviderPresets’s suite to assert this preset’s metadata and provider type, mirroring the ABC and Typical90 presets.

Also applies to: 808-808

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

382-447: ARC104+ test data patterns are well structured

The ARC104/120/204/208 fixtures correctly cover the intended 4-, 5-, 6-, and 7-problem patterns (including the F2 special case) and provide enough status variation for filtering/table tests. Note that the dev-notes snippets show slightly different statuses (e.g., arc104_f as AC), but since tests only assert indices and contest IDs, this discrepancy is harmless; align them only if you want the docs to mirror the concrete data.

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

384-529: ARC104Onwards test suite gives solid coverage; consider adding a small label/displayConfig check

The describe('ARC 104 Onwards', ...) block thoroughly validates:

  • Filtering by contest type and round range (104–999).
  • Metadata content.
  • Header ID extraction and sort order (including the F2 case).
  • Table structure across multiple contests.
  • 4/5/6/7‑problem patterns and mixed contest-type inputs.
  • Exclusion of rounds below ARC104.

Given the dev plan, you might optionally add a quick assertion that getDisplayConfig() and getContestRoundLabel('arc378') behave like the ABC providers, but functionally the current suite is already strong.

📜 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 01656e3 and fa58927.

📒 Files selected for processing (5)
  • docs/dev-notes/2025-11-15/add_tests_for_contest_table_provider/plan.md (1 hunks)
  • prisma/tasks.ts (3 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)
⏰ 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 (3)
src/lib/utils/contest_table_provider.ts (1)

259-284: ARC104OnwardsProvider implementation is consistent with existing ABC range providers

The ARC104OnwardsProvider correctly:

  • Filters by ContestType.ARC and rounds 104–999 via parseContestRound(contest_id, 'arc').
  • Reuses the default getDisplayConfig from the base class.
  • Formats round labels by stripping 'ARC ' from getContestNameLabel.

This aligns with ABC range providers’ behavior and should integrate cleanly with the existing table UI.

docs/dev-notes/2025-11-15/add_tests_for_contest_table_provider/plan.md (1)

1-699: Dev plan clearly matches the implemented ARC104Onwards work

This plan document thoroughly describes the ARC104OnwardsProvider test strategy (patterns, displayConfig, edge cases, and mock data layout) and matches the structure of the actual fixtures/tests. There are minor cosmetic differences in example statuses versus the current test data, but nothing that impacts correctness; update those only if you want the examples to be exact copies.

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

11-12: ARC-related imports and mocks are correctly extended

Importing ARC104OnwardsProvider and the new ARC104+ fixture, plus extending the classifyContest/getContestNameLabel mocks to recognize arc* IDs, is exactly what’s needed to exercise ARC providers alongside ABC/others. This keeps test behavior consistent with how real contest IDs are handled.

Also applies to: 27-30, 35-39, 58-63

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 335c2eb into staging Nov 17, 2025
3 checks passed
@KATO-Hiro KATO-Hiro deleted the #2835 branch November 17, 2025 12:31
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] テーブル「ARC104〜」を追加しましょう

1 participant