Skip to content

feat: add AOJ_ICPC contest type for ICPC Prelim/Regional import#3563

Merged
KATO-Hiro merged 4 commits into
stagingfrom
#3562
May 20, 2026
Merged

feat: add AOJ_ICPC contest type for ICPC Prelim/Regional import#3563
KATO-Hiro merged 4 commits into
stagingfrom
#3562

Conversation

@KATO-Hiro

@KATO-Hiro KATO-Hiro commented May 20, 2026

Copy link
Copy Markdown
Collaborator

close #3562

Summary by CodeRabbit

  • 新機能

    • Aizu Online Judge(AOJ)のICPC(国内予選・地区予選)を正式にサポートし、該当コンテストとタスクをインポート可能にしました。
    • インポートソースにICPC向け(Prelim/Regional)エントリを追加しました。
    • コンテスト名ラベルとタスクURLのICPC表記対応を追加しました。
  • テスト

    • ICPC対応に関する包括的なテストケース群を追加しました。

KATO-Hiro and others added 3 commits May 20, 2026 08:32
Add support for importing ICPC (International Collegiate Programming Contest)
problems from Aizu Online Judge via the existing AojChallengesApiClient,
covering both ICPC National Domestic Prelim and Asia Regional rounds.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Fix contestId format in plan.md examples (ICPCPrelim/ICPCRegional prefix)
- Add CodeRabbit Findings section with two rounds of review notes
- Add ICPC REGIONAL test case in clients.test.ts
- Add comment clarifying ICPC round constraints in record_requests.ts

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

coderabbitai Bot commented May 20, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: fac806c6-ceae-4677-bf5f-bf4a297d1f06

📥 Commits

Reviewing files that changed from the base of the PR and between a527e80 and 9e5272a.

📒 Files selected for processing (2)
  • src/lib/clients/aizu_online_judge/clients.ts
  • src/lib/clients/aizu_online_judge/types.ts

📝 Walkthrough

Walkthrough

AOJ の ICPC(Prelim/Regional)を import 対象に追加するため、DB enum、型、クライアント、import ソース、分類・表示ロジック、タスク生成、および対応テストを追加しました。

Changes

AOJ ICPC Contest Support

Layer / File(s) Summary
Database schema & ContestType
prisma/migrations/..., prisma/schema.prisma, src/lib/types/contest.ts
ContestTypeAOJ_ICPC を追加。
AOJ client types & cache key
src/lib/clients/aizu_online_judge/types.ts, src/lib/clients/aizu_online_judge/clients.ts
ChallengeParamsICPC/IcpcRound を追加。AojChallengesApiClient の getCacheKey を ChallengeParams 受けに統一。
Import sources & fixtures
src/lib/clients/index.ts, src/lib/clients/fixtures/record_requests.ts
ContestTaskImportSourceaoj_icpc_prelim/aoj_icpc_regional を追加し、importSources・challengeConfigs・saveAojChallenge を更新。
Contest classification & display
src/lib/utils/contest.ts
classifyContest/isAojContest/getContestNameLabel に ICPC 判定を追加、ICPC_TRANSLATIONS を導入、contestTypePriorities を更新。
Task URL generation
src/lib/utils/task.ts
AojGenerator.canHandlecontestId.startsWith('ICPC') を追加。
Tests & test cases
src/lib/clients/aizu_online_judge/clients.test.ts, src/test/lib/utils/*
AOJ ICPC 用のクライアントテスト、ユニットテストの describe ブロック、及び各種テストケースデータ(contest_type/labels/task_url/name_and_task_index)を追加。

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

ICPC の風が来た、Prelim と Regional、
スキーマに刻み、クライアントが追いつき、
分類も URL もテストで歌う、
小さな変更で世界が広がる。 🎉

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 28.57% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed プルリクエストのタイトルは、AOJ_ICPC コンテストタイプの追加と ICPC Prelim/Regional インポート対応という主要な変更を明確かつ簡潔に要約しています。
Linked Issues check ✅ Passed リンク済みの Issue #3562 で求められた ICPC Regional および ICPC Prelim の両ラウンドのインポート対応が実装されており、コード変更が要件を満たしています。
Out of Scope Changes check ✅ Passed すべての変更が AOJ_ICPC コンテストタイプ追加およびそれに関連する型・テスト・ユーティリティの更新に限定されており、スコープ外の変更は認められません。

✏️ 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 #3562

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

🤖 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 `@src/lib/clients/aizu_online_judge/types.ts`:
- Around line 36-40: 現在の ChallengeRoundMap と ChallengeContestType の定義は
contestType と round の相関を強制しておらず、例えば { contestType: 'ICPC', round: 'FINAL' }
のような不正な組合せが通ってしまいます。ChallengeRoundMap と関連型(PckRound, JagRound,
IcpcRound)をそのまま使うのではなく、contestType を識別子にした判別共用体(例: { contestType: 'PCK'; round:
PckRound } | { contestType: 'JAG'; round: JagRound } | { contestType: 'ICPC';
round: IcpcRound })に置き換え、既存の参照(ChallengeRoundMap や ChallengeContestType
を用いる箇所)をこの新しい判別共用体型に差し替えて相関を強制してください。
🪄 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: 89d508aa-e6c3-4bc3-86e1-7cf3705a9184

📥 Commits

Reviewing files that changed from the base of the PR and between 40e2926 and a527e80.

📒 Files selected for processing (17)
  • prisma/migrations/20260520080410_add_aoj_icpc_to_contest_type/migration.sql
  • prisma/schema.prisma
  • src/lib/clients/aizu_online_judge/clients.test.ts
  • src/lib/clients/aizu_online_judge/types.ts
  • src/lib/clients/fixtures/aizu_online_judge/challenges/icpc_prelim/contests.json
  • src/lib/clients/fixtures/aizu_online_judge/challenges/icpc_regional/contests.json
  • src/lib/clients/fixtures/record_requests.ts
  • src/lib/clients/index.ts
  • src/lib/types/contest.ts
  • src/lib/utils/contest.ts
  • src/lib/utils/task.ts
  • src/test/lib/utils/contest.test.ts
  • src/test/lib/utils/task.test.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 src/lib/clients/aizu_online_judge/types.ts Outdated
…ChallengeContestType/ChallengeRoundMap

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

@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 5d44272 into staging May 20, 2026
3 checks passed
@KATO-Hiro KATO-Hiro deleted the #3562 branch May 20, 2026 09: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] AOJ・ICPCの問題をインポートできるようにしましょう

1 participant