Skip to content

Conversation

@KATO-Hiro
Copy link
Collaborator

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

close #2837

Summary by CodeRabbit

  • New Features

    • Added support for viewing AGC (AtCoder Grand Contest) from AGC 001 onwards and integrated it into contest provider groups and UI controls.
  • Bug Fixes

    • Strengthened contest-round parsing to reject invalid non-numeric inputs.
  • Tests

    • Added comprehensive AGC test fixtures and coverage for filtering, metadata, display, labeling, sorting, and multi-pattern behaviors.
  • Data

    • Bulk-added AGC problem entries so recent AGC contests and tasks are available.

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

@coderabbitai
Copy link

coderabbitai bot commented Nov 24, 2025

Walkthrough

Adds AGC001OnwardsProvider to filter/display AGC contests (prefix agc, rounds 1–999), tightens parseContestRound numeric validation, registers the provider in presets and global groups, adds AGC test fixtures and comprehensive tests covering multiple contests and problem-patterns (including F2).

Changes

Cohort / File(s) Summary
Planning & Design
docs/dev-notes/2025-11-19/add_tests_for_contest_table_provider/plan.md
New test plan describing test design, mock data, implementation steps, and verification for AGC001OnwardsProvider covering AGC001/002/009/028/073/074 and multiple problem patterns (including F2).
Provider Implementation
src/lib/utils/contest_table_provider.ts
Adds AGC001OnwardsProvider (extends ContestTableProviderBase) with filter for contest_id prefix agc and rounds 1–999; implements metadata and round-label formatting; registers AGC001Onwards preset and agc001Onwards group; strengthens parseContestRound numeric validation.
Test Fixtures
src/test/lib/utils/test_cases/contest_table_provider.ts
Adds AGC fixtures (agc001, agc002, agc009, agc028, agc073, agc074 variants) and exports taskResultsForAGC001OnwardsProvider aggregating them, covering multiple statuses and patterns.
Test Suite
src/test/lib/utils/contest_table_provider.test.ts
Adds tests for AGC001OnwardsProvider validating filtering, metadata, displayConfig, contest round labels, table generation, header IDs, pattern-specific behavior, sorting stability, mixed-result handling, and empty/out-of-range cases.
Data
prisma/tasks.ts
Appends many new task entries for AGC contests (agc001..agc074 variants) to the exported tasks array.

Sequence Diagram(s)

sequenceDiagram
    participant TestRunner
    participant AGCProvider as AGC001OnwardsProvider
    participant FilterFn as setFilterCondition
    participant TaskStore as TaskResultSet

    TestRunner->>AGCProvider: instantiate provider
    TestRunner->>AGCProvider: request metadata & table data
    AGCProvider->>FilterFn: build filter (prefix 'agc', parse numeric round)
    activate FilterFn
    FilterFn->>TaskStore: evaluate each TaskResult
    TaskStore-->>FilterFn: include if round ∈ [1,999] and prefix valid
    FilterFn-->>AGCProvider: return filtered tasks
    deactivate FilterFn
    AGCProvider->>TestRunner: return metadata, labels, table structure
    Note right of TestRunner: Assertions on counts, labels, patterns, headers
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Inspect parseContestRound numeric validation and handling of non-numeric suffixes and leading zeros.
  • Verify filter logic includes correct AGC ranges and excludes non-AGC/out-of-range entries.
  • Review new test fixtures for correct indices/statuses and F2 pattern coverage.
  • Confirm preset/group registration follows existing conventions and no naming collisions.

Poem

A rabbit hops through rows and rows, so neat,
AGC rounds aligned from 001 to greet,
Fixtures sprout like carrots — patterns bright and sweet,
Tests nibble at bugs until the table's complete,
Hooray — the provider hums with each new beat. 🐇✨

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 accurately summarizes the main change: adding a table for AGC 001 onwards contests, which is the primary objective of the changeset.
Linked Issues check ✅ Passed The pull request implements the main requirement from #2837 by adding the AGC001 Onwards table with provider, filtering, test coverage, and test data.
Out of Scope Changes check ✅ Passed All changes are scoped to implementing the AGC001 Onwards table feature; no unrelated modifications detected.
✨ 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 #2837

📜 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 1d94eae and d5af02d.

📒 Files selected for processing (1)
  • prisma/tasks.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 (1)
prisma/tasks.ts (1)

4599-4829: AGC task metadata looks consistent; confirm intended contest coverage

The new AGC records (001, 002, 009, 028, 073, 074) have correct id/contest_id/problem_index combinations and match official task names/titles, including the F2 variant and newer rounds (e.g., AGC073/074). Placement after the ARC block and omission of grade are both consistent with existing conventions in this file.

One thing to double-check: if AGC001OnwardsProvider is meant to surface all AGC rounds from 001 upward, tasks.ts still only contains a subset of rounds. If the current subset is intentional (e.g., curated list), this is fine; otherwise you may want a follow-up pass to add the remaining AGC contests for completeness.

Tip

📝 Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


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-11-19/add_tests_for_contest_table_provider/plan.md (1)

80-115: Add language specifiers to code blocks for better readability.

The markdown linter flags several code blocks that are missing language specifiers. Adding these would improve syntax highlighting and readability.

Apply this pattern to the code blocks at lines 80, 90, 100, and 110:

-```
+```text
 task_table_index: A, B, C, D

</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**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**

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 89ae04deb6fd7394727ceecc7cb5e2ebe9a0ba5b and be2a875ddf9a3224e9dca079f5ac3cd60357f22c.

</details>

<details>
<summary>📒 Files selected for processing (4)</summary>

* `docs/dev-notes/2025-11-19/add_tests_for_contest_table_provider/plan.md` (1 hunks)
* `src/lib/utils/contest_table_provider.ts` (3 hunks)
* `src/test/lib/utils/contest_table_provider.test.ts` (5 hunks)
* `src/test/lib/utils/test_cases/contest_table_provider.ts` (1 hunks)

</details>

<details>
<summary>🧰 Additional context used</summary>

<details>
<summary>🧬 Code graph analysis (1)</summary>

<details>
<summary>src/lib/utils/contest_table_provider.ts (3)</summary><blockquote>

<details>
<summary>src/lib/types/task.ts (1)</summary>

* `TaskResult` (64-72)

</details>
<details>
<summary>src/lib/utils/contest.ts (2)</summary>

* `classifyContest` (5-97)
* `getContestNameLabel` (327-398)

</details>
<details>
<summary>src/lib/types/contest_table_provider.ts (1)</summary>

* `ContestTableMetaData` (122-125)

</details>

</blockquote></details>

</details><details>
<summary>🪛 markdownlint-cli2 (0.18.1)</summary>

<details>
<summary>docs/dev-notes/2025-11-19/add_tests_for_contest_table_provider/plan.md</summary>

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

(MD040, fenced-code-language)

---

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

(MD040, fenced-code-language)

---

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

(MD040, fenced-code-language)

---

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

(MD040, fenced-code-language)

</details>

</details>

</details>

<details>
<summary>⏰ 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)</summary>

* GitHub Check: preview

</details>

<details>
<summary>🔇 Additional comments (5)</summary><blockquote>

<details>
<summary>src/lib/utils/contest_table_provider.ts (2)</summary><blockquote>

`285-310`: **LGTM! Well-structured AGC provider implementation.**

The AGC001OnwardsProvider follows the established pattern from ARC104OnwardsProvider and correctly:
- Filters AGC contests from round 1 to 999
- Returns appropriate metadata with title and abbreviation name
- Formats contest round labels consistently
- Leverages the enhanced parseContestRound validation

---

`775-782`: **Proper registration in presets and global groups.**

The AGC001Onwards provider is correctly registered in both:
- `prepareContestProviderPresets()` as a factory function
- `contestTableProviderGroups` for global access

This follows the established registration pattern for other providers.




Also applies to: 844-844

</blockquote></details>
<details>
<summary>src/test/lib/utils/contest_table_provider.test.ts (2)</summary><blockquote>

`12-12`: **Proper test setup with AGC support.**

The test file correctly:
- Imports the AGC001OnwardsProvider and its test fixtures
- Extends the mock for `classifyContest` to recognize AGC contests
- Extends the mock for `getContestNameLabel` to format AGC labels

This ensures AGC contests are properly classified and labeled during tests.




Also applies to: 31-31, 41-42, 67-68

---

`537-712`: **Comprehensive test coverage for AGC001Onwards provider.**

The test suite thoroughly validates all aspects of the AGC001OnwardsProvider:
- Filtering logic (rounds 1-999, AGC type only)
- Metadata and display configuration
- Contest round and header ID generation
- All problem patterns (4/5/6/7 problems)
- Sort order stability
- Edge cases (mixed types, below AGC001, empty results)

The tests follow established patterns from ARC104Onwards and cover all requirements from the plan document.

</blockquote></details>
<details>
<summary>src/test/lib/utils/test_cases/contest_table_provider.ts (1)</summary><blockquote>

`449-544`: **Excellent test fixture design covering all AGC problem patterns.**

The AGC fixtures comprehensively cover all documented problem patterns:
- **AGC001, AGC002**: 6-problem standard pattern (A-F)
- **AGC009, AGC074**: 5-problem pattern (A-E)
- **AGC028**: 7-problem pattern with F2 (unique case)
- **AGC073**: 4-problem pattern (unique case)

Each fixture includes varied status combinations (AC, AC_WITH_EDITORIAL, TRYING, PENDING) for thorough testing. The export aggregates all 33 tasks correctly.

</blockquote></details>

</blockquote></details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->

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 f1484b2 into staging Nov 25, 2025
3 checks passed
@KATO-Hiro KATO-Hiro deleted the #2837 branch November 25, 2025 12:52
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] テーブル「AGC001〜」を追加しましょう

2 participants