Skip to content

feat(tasks): Add FPS24 (#2796)#2801

Merged
KATO-Hiro merged 2 commits intostagingfrom
#2796
Nov 6, 2025
Merged

feat(tasks): Add FPS24 (#2796)#2801
KATO-Hiro merged 2 commits intostagingfrom
#2796

Conversation

@KATO-Hiro
Copy link
Collaborator

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

close #2796

Summary by CodeRabbit

  • New Features

    • Added support for FPS-24 contests — import, classification, priority ordering, and display label ("FPS 24 題").
  • Tests

    • Added unit tests covering FPS-24 classification, priority, and name-label behavior.
  • Documentation

    • Added implementation plan and updated ERD to include FPS-24.
  • Chores

    • Database enum and migration updated; seeded tasks for FPS-24 added.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 5, 2025

Walkthrough

Adds FPS_24 as a new contest type across schema, code, tests, and documentation: Prisma enum and migration, TypeScript types, contest utilities (classification, label, priority), new tasks data, and unit tests to validate FPS-24 behavior.

Changes

Cohort / File(s) Summary
Database Schema & Migrations
prisma/schema.prisma, prisma/migrations/20251105221407_add_fps_24_to_contest_type/migration.sql, prisma/migrations/migration_lock.toml, prisma/ERD.md
Added FPS_24 member to ContestType enum in Prisma schema and ERD; created SQL migration to add enum value; minor comment wording change in migration_lock.
Type Definitions
src/lib/types/contest.ts
Exported ContestType extended to include FPS_24.
Contest Utility Functions
src/lib/utils/contest.ts
classifyContest() recognizes contest_id === 'fps-24'ContestType.FPS_24; getContestNameLabel() maps 'fps-24''FPS 24 題'; contestTypePriorities updated to insert FPS_24 at priority 17 and shift subsequent priorities.
Test Case Definitions
src/test/lib/utils/test_cases/contest_type.ts, src/test/lib/utils/test_cases/contest_name_labels.ts
Added fps24 test cases for classification and name-label expectations; added mathAndAlgorithm name-label test case. (Note: fps24 appears duplicated in contest_type.ts.)
Test Implementation
src/test/lib/utils/contest.test.ts
Integrated fps24 tests into classifyContest, priority, and name-label test suites.
Tasks Data
prisma/tasks.ts
Appended 24 new task records for FPS-24 problems (fps_24_xfps_24_a).
Documentation / Plan
docs/dev-notes/2025-11-05/import_contest_for_fps_24/plan.md
Added implementation plan, test expectations, and verification steps for FPS-24 integration.

Sequence Diagram(s)

sequenceDiagram
  participant Importer as Importer/Importer script
  participant Utils as src/lib/utils/contest.ts
  participant DB as Prisma/DB
  Note over Utils: New branch for 'fps-24' classification and label

  Importer->>Utils: classifyContest('fps-24')
  alt contest_id == 'fps-24'
    Utils-->>Importer: ContestType.FPS_24
  else other paths
    Utils-->>Importer: existing ContestType
  end

  Importer->>Utils: getContestNameLabel('fps-24')
  Utils-->>Importer: "FPS 24 題"

  Importer->>DB: create tasks for fps_24_x ... fps_24_a
  DB-->>Importer: persisted
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Verify priority reordering effects where contestTypePriorities is used (sorting/display logic).
  • Inspect src/test/lib/utils/test_cases/contest_type.ts for duplicate fps24 export and remove if accidental.
  • Confirm contest_id === 'fps-24' string is consistent with external import sources and tasks contest_id values.

Poem

🐰 I hopped through schema, code, and test,
FPS-24 now joins the nest.
Labels set and priorities pranced,
Twenty-four problems ready to dance.
Hooray — a new contest to digest! 🎉

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The PR contains a minor out-of-scope change: a comment rewording in migration_lock.toml from '(e.g., Git)' to '(i.e. Git)' unrelated to FPS24 implementation. Remove the comment rewording in migration_lock.toml to keep changes focused on FPS24 implementation only.
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 (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat(tasks): Add FPS24 (#2796)' accurately describes the main change of adding FPS24 contest type support, though it could be more specific about the broader scope.
Linked Issues check ✅ Passed The PR successfully implements FPS24 contest type support across Prisma schema, type definitions, utility functions, test cases, and task data as required by the linked issue #2796.
✨ 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 #2796

📜 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 611d238 and d95a61c.

📒 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)

5606-5773: LGTM! FPS-24 contest data properly added.

The 24 new task entries for the fps_24 contest are correctly structured and consistent with existing patterns in the codebase:

  • All required fields (id, contest_id, problem_index, name, title) are present
  • Problem indices follow the proper descending order (X through A)
  • Data structure and formatting match existing entries
  • The absence of the optional grade field is consistent with other contest entries

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
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 27c7069 into staging Nov 6, 2025
3 checks passed
@KATO-Hiro KATO-Hiro deleted the #2796 branch November 6, 2025 12:21
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] FPS24をインポートできるようにしましょう

1 participant