Skip to content

test(contest): add AOJ_UNIVERSITY test cases for new contest_id patterns#3631

Merged
KATO-Hiro merged 2 commits into
stagingfrom
#3630
Jun 10, 2026
Merged

test(contest): add AOJ_UNIVERSITY test cases for new contest_id patterns#3631
KATO-Hiro merged 2 commits into
stagingfrom
#3630

Conversation

@KATO-Hiro

@KATO-Hiro KATO-Hiro commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

close #3630

Summary by CodeRabbit

リリースノート

  • 新機能

    • 複数のAOJ大学プログラミングコンテストに対応しました。これにより、より多くのコンテスト問題にアクセスできるようになります。
  • テスト

    • コンテスト情報の処理とタスク表示に関する包括的なテストケースを追加しました。

KATO-Hiro and others added 2 commits June 10, 2026 06:35
Add test cases covering 4 previously untested AOJ_UNIVERSITY patterns:
OUPC (new university abbreviation), RUPC-in-RUPC (same university as parent),
HUPC-in-RUPC (new university pair), and UAPC-in-ACPC (edge case where both
sides map to ACPC). Also adds tasks.ts entries for the representative contests.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…omplete

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

AOJ オンラインジャッジの大学コンテスト系問題 12 個を課題マスタに追加し、対応するテストケース(コンテスト名、表示ラベル、型、URL)を複数のテストファイルで拡張。既存課題との並び順を保持しながら統合。

Changes

AOJ University 問題インポート機能

Layer / File(s) Summary
課題データ定義
prisma/tasks.ts
AOJ 系課題 12 個(UAPC/RUPC/HUPC/OUPC 由来の problem_index)を tasks 配列に段階追加。既存課題との相対位置を保持。
テストケース拡張
src/test/lib/utils/test_cases/contest_name_and_task_index.ts, contest_name_labels.ts, contest_type.ts, task_url.ts
OUPC2012、RUPC2018、HUPC2014、UAPC2015 の 4 コンテスト分の テストケース(contestId、taskTableIndex、表示ラベル、型、タスク URL)を追加し、aojUniversity テストスイートを拡張。

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • AtCoder-NoviSteps/AtCoderNoviSteps#1528: AOJ University コンテストラベル生成ロジック(getAtCoderUniversityContestLabel)の実装で、本 PR のテストケース期待値(日本語ラベル表記)に直結。
  • AtCoder-NoviSteps/AtCoderNoviSteps#3603: AOJ_UNIVERSITY コンテスト型・ラベル生成・ルーティング追加と、本 PR で拡張するテストデータが同領域の実装に統合。

Poem

AOJ の 12 の問題が
並び順 保ちて 加わり
四つのテストが 息そろえ
コンテスト名 ラベル URL と
大学の 道を 整えたり 📚✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR タイトルはテストケース追加という実際の変更内容を正確に反映しており、新しいコンテスト ID パターンのテストケースを追加することが明確。
Linked Issues check ✅ Passed PR は #3630 で指定された 12 個の AOJ 問題をすべて tasks.ts に追加し、対応するテストケースも四つのコンテスト ID パターンでカバー。目的を達成。
Out of Scope Changes check ✅ Passed すべての変更が AOJ 問題インポート機能とそのテストケース追加に関連し、スコープ内。無関係な変更はなし。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch #3630

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/test/lib/utils/test_cases/contest_type.ts (1)

669-677: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

根本原因は同一です:AOJ大学系の新規4パターンがテストfixture群へ一貫反映されていません。

contest_name_and_task_index.ts / contest_name_labels.ts では4件追加済みなのに、contest_type.tstask_url.ts は1件のみ追加のため、検証軸ごとにカバレッジが分断されています。
fixture を4ファイル同時に同期させると、この種の取りこぼしを防げます。

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/test/lib/utils/test_cases/contest_type.ts` around lines 669 - 677, The
AOJ university contest fixtures are out of sync: the aojUniversityContestData
array in contest_type.ts only contains one of the four new AOJ patterns added
elsewhere (contest_name_and_task_index.ts and contest_name_labels.ts), causing
inconsistent test coverage; update aojUniversityContestData to include all four
new AOJ entries (mirror the same contestId/name patterns added in
contest_name_and_task_index.ts and contest_name_labels.ts) and also ensure
task_url.ts contains the matching four fixtures so all four files
(contest_type.ts, contest_name_and_task_index.ts, contest_name_labels.ts,
task_url.ts) stay synchronized.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@prisma/tasks.ts`:
- Around line 11976-12080: The new AOJ task objects added in prisma/tasks.ts are
missing required ERD fields (grade, contest_type, task_table_index, task_id,
atcoder_problems_difficulty), which breaks task/contesttaskpair assumptions;
update each inserted object in the array to include contest_type (e.g., "AOJ"),
a unique task_id (use a deterministic scheme like
`${contest_id}:${problem_index}`), task_table_index (map from problem_index or
numeric ordering), grade (populate per AOJ difficulty or a default if unknown),
and atcoder_problems_difficulty (fill with a numeric or null-safe value), and
ensure these values match any code that creates ContestTaskPair records so
referential integrity between task and contesttaskpair is preserved.

---

Outside diff comments:
In `@src/test/lib/utils/test_cases/contest_type.ts`:
- Around line 669-677: The AOJ university contest fixtures are out of sync: the
aojUniversityContestData array in contest_type.ts only contains one of the four
new AOJ patterns added elsewhere (contest_name_and_task_index.ts and
contest_name_labels.ts), causing inconsistent test coverage; update
aojUniversityContestData to include all four new AOJ entries (mirror the same
contestId/name patterns added in contest_name_and_task_index.ts and
contest_name_labels.ts) and also ensure task_url.ts contains the matching four
fixtures so all four files (contest_type.ts, contest_name_and_task_index.ts,
contest_name_labels.ts, task_url.ts) stay synchronized.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 42bfbdff-b931-4f91-ad37-df9893a0196e

📥 Commits

Reviewing files that changed from the base of the PR and between 8f50a7c and 9989380.

📒 Files selected for processing (5)
  • prisma/tasks.ts
  • src/test/lib/utils/test_cases/contest_name_and_task_index.ts
  • src/test/lib/utils/test_cases/contest_name_labels.ts
  • src/test/lib/utils/test_cases/contest_type.ts
  • src/test/lib/utils/test_cases/task_url.ts

Comment thread prisma/tasks.ts

@KATO-Hiro KATO-Hiro left a comment

Copy link
Copy Markdown
Collaborator Author

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 03ef69e into staging Jun 10, 2026
3 checks passed
@KATO-Hiro KATO-Hiro deleted the #3630 branch June 10, 2026 06:55
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] AOJ の問題をインポートできるようにしましょう

1 participant