Skip to content

feat: Add DSL, CGL and NTL to AOJ courses (#3223)#3224

Merged
KATO-Hiro merged 7 commits into
stagingfrom
#3223
Mar 1, 2026
Merged

feat: Add DSL, CGL and NTL to AOJ courses (#3223)#3224
KATO-Hiro merged 7 commits into
stagingfrom
#3223

Conversation

@KATO-Hiro
Copy link
Copy Markdown
Collaborator

@KATO-Hiro KATO-Hiro commented Mar 1, 2026

close #3223

Summary by CodeRabbit

  • New Features

    • Added support for three new AOJ course contests: DSL (Data Structures), CGL (Computational Geometry), and NTL (Number Theory).
  • Tests

    • Expanded test coverage with new data entries for the newly supported AOJ courses.
  • Documentation

    • Added development notes documenting the addition of new AOJ courses.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 1, 2026

Warning

Rate limit exceeded

@KATO-Hiro has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 15 minutes and 15 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 1ca4006 and 30475a2.

📒 Files selected for processing (2)
  • src/test/lib/utils/test_cases/contest_name_and_task_index.ts
  • src/test/lib/utils/test_cases/task_url.ts

Walkthrough

Added three new AOJ course contests (DSL with 18 tasks, CGL with 25 tasks, NTL with 11 tasks) to the AOJ_COURSES configuration, along with corresponding test data entries. No functional or control flow changes made.

Changes

Cohort / File(s) Summary
Configuration & Planning
docs/dev-notes/2026-03-01/add-aoj-course-to-contests/plan.md, src/lib/utils/contest.ts
Added planning documentation and three new AOJ course prefixes (DSL, CGL, NTL) to the AOJ_COURSES static mapping with no logic modifications.
Test Data Expansion
src/test/lib/utils/test_cases/contest_name_and_task_index.ts, src/test/lib/utils/test_cases/contest_type.ts
Extended test data sets with three new AOJ course entries (DSL, CGL, NTL) containing contestIds and sample task lists for test coverage.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 Three courses hop into the contest array,
DSL, CGL, NTL brighten the day!
With data so neat, all structured and clean,
The finest AOJ courses we've seen! 📚✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ 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%. 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 The PR title 'feat: Add DSL, CGL and NTL to AOJ courses' accurately and concisely summarizes the main change: adding three new AOJ course prefixes to the system.
Linked Issues check ✅ Passed All three coding requirements from issue #3223 are met: DSL, CGL, and NTL courses have been added to AOJ_COURSES with corresponding test data entries.
Out of Scope Changes check ✅ Passed All changes are directly scoped to adding the three AOJ courses; no unrelated modifications or refactoring were introduced.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch #3223

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
Copy Markdown
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.

🧹 Nitpick comments (2)
src/test/lib/utils/test_cases/contest_name_and_task_index.ts (1)

590-596: Outdated JSDoc comment for AOJ Courses test data.

The comment only lists ITP1, ALDS1, ITP2, and DPL, but GRL is already present in the data structure, and now DSL, CGL, and NTL are being added. Consider updating the comment to reflect all AOJ courses.

📝 Suggested update to the comment
 /**
  * Test cases for AOJ Courses
  * - ITP1: Introduction to Programming I
  * - ALDS1: Algorithms and Data Structures I
  * - ITP2: Introduction to Programming II
  * - DPL: Discrete Optimization Problems
+ * - GRL: Graph Algorithms
+ * - DSL: Data Structures Library
+ * - CGL: Computational Geometry Library
+ * - NTL: Number Theory Library
  */
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/test/lib/utils/test_cases/contest_name_and_task_index.ts` around lines
590 - 596, Update the outdated JSDoc block that documents "Test cases for AOJ
Courses" (the comment above the AOJ course test data in
contest_name_and_task_index.ts) to list all courses present in the data
structure: include GRL and the newly added DSL, CGL, and NTL alongside ITP1,
ALDS1, ITP2, and DPL so the comment accurately reflects the test data.
docs/dev-notes/2026-03-01/add-aoj-course-to-contests/plan.md (1)

5-7: Consider creating a GitHub issue to track the id generation fix.

The documentation correctly identifies a known issue where sha256(contest_id + task.title) can cause unique constraint violations (P2002) when titles are duplicated. Since the root fix (using task.id from the API) is deferred, consider creating a tracking issue to ensure this tech debt is addressed in the future.

Would you like me to help draft a GitHub issue to track this improvement?

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/dev-notes/2026-03-01/add-aoj-course-to-contests/plan.md` around lines 5
- 7, Create a GitHub issue that tracks replacing the current id generation
(sha256(contest_id + task.title)) with the API-provided task.id; in the issue
include a clear title, the problem summary (AOJ `/problems?size=N` can return
non-existent problems and duplicate titles cause Task.id unique constraint
P2002), reproduction steps (example using duplicated task.title that triggers
P2002, reference CGL observation), the proposed root fix (use task.id as API
unique identifier), suggested interim mitigation (only import existing
problems), required acceptance criteria (migration plan, tests to prevent P2002,
backward-compat handling), labels (tech-debt, backend), and assignee/priority
suggestions so this work is tracked.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@docs/dev-notes/2026-03-01/add-aoj-course-to-contests/plan.md`:
- Around line 5-7: Create a GitHub issue that tracks replacing the current id
generation (sha256(contest_id + task.title)) with the API-provided task.id; in
the issue include a clear title, the problem summary (AOJ `/problems?size=N` can
return non-existent problems and duplicate titles cause Task.id unique
constraint P2002), reproduction steps (example using duplicated task.title that
triggers P2002, reference CGL observation), the proposed root fix (use task.id
as API unique identifier), suggested interim mitigation (only import existing
problems), required acceptance criteria (migration plan, tests to prevent P2002,
backward-compat handling), labels (tech-debt, backend), and assignee/priority
suggestions so this work is tracked.

In `@src/test/lib/utils/test_cases/contest_name_and_task_index.ts`:
- Around line 590-596: Update the outdated JSDoc block that documents "Test
cases for AOJ Courses" (the comment above the AOJ course test data in
contest_name_and_task_index.ts) to list all courses present in the data
structure: include GRL and the newly added DSL, CGL, and NTL alongside ITP1,
ALDS1, ITP2, and DPL so the comment accurately reflects the test data.

ℹ️ Review info

Configuration used: Organization 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 f235207 and 1ca4006.

📒 Files selected for processing (4)
  • docs/dev-notes/2026-03-01/add-aoj-course-to-contests/plan.md
  • src/lib/utils/contest.ts
  • src/test/lib/utils/test_cases/contest_name_and_task_index.ts
  • src/test/lib/utils/test_cases/contest_type.ts

Copy link
Copy Markdown
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 388e148 into staging Mar 1, 2026
3 checks passed
@KATO-Hiro KATO-Hiro deleted the #3223 branch March 1, 2026 14:03
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 Course の問題を追加

1 participant