Skip to content

Conversation

@river0525
Copy link
Collaborator

@river0525 river0525 commented Dec 26, 2025

@KATO-Hiro
JOIの二次予選・旧予選・本選の表を作成しました。
hiroさんにdiscordに送っていただいた実装方針から変更した点は以下の通りです。

JOISecondQualAndSemiFinalRoundProviderクラスの削除
表の実装の際、getMetadata(): titleabbreviationNameは空文字を返すようにするとエラーが発生したため、一次予選の表を参考に文字を返すよう調整しました。
それにより、3つの難易度表の共通部分がなくなったため、新たにスーパークラスを作る必要性はないと判断しました。
代わりに、3つのテーブルそれぞれが既存のContestTableProviderBaseを継承する形に変更しました。

②表のgetContestRoundLabel()が空文字ではなく年度を返すようにした
表の行名がないのは不便だと感じたため、getContestRoundLabel()は年度を返すようにしました。

③mockの更新
②の変更に伴って、contest_table_provider.test.ts内のmockを二次予選・本選の形式にも対応できるよう変更しました。
また、一次予選の単体テストに二次予選・本選の問題を用いているものがあり、エラーが発生していたため削除いたしました。

不明点や改善点などありましたらご指摘よろしくお願いいたします。

Summary by CodeRabbit

  • New Features

    • Improved support for JOI contests: added handling for second qualifying (2020+), qualifying (2006–2019), and semi-final rounds, plus a new JOI provider group for easier contest classification.
  • Tests

    • Expanded test coverage for JOI providers and contest round label formatting, including multiple JOI ID formats and filtering behaviors.

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

@coderabbitai
Copy link

coderabbitai bot commented Dec 26, 2025

Walkthrough

Added JOI-specific type constants, three new contest table provider classes with regex filters for JOI rounds (second qual 2020+, qual 2006–2019, semi-final), registered a new provider group, and extended tests to cover the new providers and JOI label formats.

Changes

Cohort / File(s) Summary
Type Definitions
src/lib/types/contest_table_provider.ts
Added exported constant collections: JOI_SECOND_QUAL_ROUND_SECTIONS with keys '2020Onwards' and 'from2006To2019', and JOI_FINAL_ROUND_SECTIONS with key 'semiFinal'.
Provider Implementations
src/lib/utils/contest_table_provider.ts
Added three provider classes: JOISecondQualRound2020OnwardsProvider, JOIQualRoundFrom2006To2019Provider, JOISemiFinalRoundProvider. Introduced regex constants regexForJoiSecondQualRound (^joi\d{4}yo2$), regexForJoiQualRound (^joi\d{4}yo$), regexForJoiSemiFinalRound (^joi\d{4}ho$). Registered new provider group JOISecondQualAndSemiFinalRound and exported it via contestTableProviderGroups (joiSecondQualAndSemiFinalRound).
Tests
src/test/lib/utils/contest_table_provider.test.ts
Expanded JOI label/mock handling to support joiYYYYyo1[a-c], joiYYYYyo2, joiYYYYyo, joiYYYYho. Added tests for the three new providers (filtering, metadata/display config, label extraction) and removed an assertion treating joi2024yo2 as a first-qual invalid case.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 I hopped through regex fields and file stacks,
I planted sections, classes, and some tracks.
Second, old, and semi — neatly chained,
A tidy hop where JOI rounds are named.

Pre-merge checks and finishing touches

✅ 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 clearly summarizes the main change: introducing new JOI contest table providers for second qualifying and semi-final rounds.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ 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 create_joi_table

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: 1

🧹 Nitpick comments (1)
src/lib/utils/contest_table_provider.ts (1)

839-840: Consider simplifying regex patterns by removing unused capture groups.

The capturing parentheses create groups that are never extracted. Since only .test() is called, non-capturing patterns would be cleaner:

🔎 Simplified regex patterns
-const regexForJoiSecondQualRound = /^(joi)(\d{4})(yo2)$/i;
+const regexForJoiSecondQualRound = /^joi\d{4}yo2$/i;

Apply the same simplification to regexForJoiQualRound and regexForJoiSemiFinalRound.

📜 Review details

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 7e128ea and c16818c.

📒 Files selected for processing (3)
  • src/lib/types/contest_table_provider.ts
  • src/lib/utils/contest_table_provider.ts
  • src/test/lib/utils/contest_table_provider.test.ts
🧰 Additional context used
🧬 Code graph analysis (2)
src/lib/utils/contest_table_provider.ts (3)
src/lib/types/contest_table_provider.ts (2)
  • JOI_SECOND_QUAL_ROUND_SECTIONS (87-90)
  • JOI_FINAL_ROUND_SECTIONS (92-94)
src/lib/types/task.ts (1)
  • TaskResult (64-72)
src/lib/utils/contest.ts (2)
  • classifyContest (5-97)
  • getContestNameLabel (327-398)
src/test/lib/utils/contest_table_provider.test.ts (1)
src/lib/utils/contest_table_provider.ts (3)
  • JOISecondQualRound2020OnwardsProvider (841-877)
  • JOIQualRoundFrom2006To2019Provider (881-917)
  • JOISemiFinalRoundProvider (921-957)
🪛 GitHub Actions: CI
src/lib/utils/contest_table_provider.ts

[error] 1-1: Prettier formatting check failed. Run 'prettier --write' to fix code style issues.

🔇 Additional comments (12)
src/lib/types/contest_table_provider.ts (1)

87-94: LGTM! New JOI section constants are well-structured.

The constants follow the established pattern from TESSOKU_SECTIONS and are correctly typed with as const.

Minor optional note: Consider using consistent key syntax (either all string literals or all identifiers) for the keys in JOI_SECOND_QUAL_ROUND_SECTIONS'2020Onwards' uses a string literal while from2006To2019 is an identifier.

src/test/lib/utils/contest_table_provider.test.ts (5)

23-25: LGTM! New provider imports added correctly.


87-116: Mock implementation for JOI contest labels is comprehensive.

The mock correctly handles all four JOI contest ID patterns, enabling proper test coverage for the new providers.


2217-2286: Test coverage for JOISecondQualRound2020OnwardsProvider is thorough.

Tests correctly verify:

  • Filtering includes only joi{YYYY}yo2 contests
  • Exclusion of other JOI formats (yo1, yo, ho)
  • Metadata and display configuration
  • Round label extraction

2288-2356: Test coverage for JOIQualRoundFrom2006To2019Provider is well-designed.

Tests correctly verify that yo1 and yo2 variants are excluded while the base yo format (older qualifying rounds) is included.


2358-2427: Test coverage for JOISemiFinalRoundProvider is complete.

All expected behaviors are verified including filtering, metadata, display configuration, and round label extraction.

src/lib/utils/contest_table_provider.ts (6)

9-10: LGTM! Imports correctly added for new JOI section constants.


841-877: Implementation of JOISecondQualRound2020OnwardsProvider follows established patterns.

The class correctly extends ContestTableProviderBase, uses the appropriate section identifier, and implements all required methods consistently with JOIFirstQualRoundProvider.


881-917: Implementation of JOIQualRoundFrom2006To2019Provider is correct.

The class correctly filters for the older joi{YYYY}yo format (without the 1/2 suffix).

Note: The section is stored under JOI_SECOND_QUAL_ROUND_SECTIONS.from2006To2019 which groups it with the second qualifier, even though this represents the old unified qualifying round format. This is acceptable given how the provider group is structured.


921-957: Implementation of JOISemiFinalRoundProvider is correct.

The class correctly filters for joi{YYYY}ho format and implements all required methods.


1260-1260: New provider group correctly registered in contestTableProviderGroups.


1229-1229: > Likely an incorrect or invalid review comment.

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: 1

♻️ Duplicate comments (1)
src/lib/utils/contest_table_provider.ts (1)

1230-1238: The ariaLabel does not fully describe the group contents.

The group contains three round types (二次予選 2020+, 予選 2006-2019, 本選), but the ariaLabel only mentions "Second Qual Round" (Line 1233). This could be misleading for screen reader users. Consider updating it to describe all three rounds, e.g., "Filter JOI Second Qual, Qual, and Final Rounds".

Based on past review feedback that identified the same issue.

📜 Review details

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 c16818c and 541317c.

📒 Files selected for processing (1)
  • src/lib/utils/contest_table_provider.ts
⏰ 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 (4)
src/lib/utils/contest_table_provider.ts (4)

9-10: LGTM!

The new imports for JOI section constants are correctly added and used by the three new provider classes below.


839-877: LGTM!

The JOISecondQualRound2020OnwardsProvider implementation correctly:

  • Filters contest IDs matching the "yo2" suffix pattern for 2020+ second qualifiers
  • Extracts metadata and display configuration
  • Returns year labels by removing the "JOI 二次予選 " prefix

1260-1260: LGTM!

The export of joiSecondQualAndSemiFinalRound correctly follows the established pattern for provider group registration.


879-917: Clarify the intent behind the lg:w-1/6 breakpoint in the display configuration.

The tableBodyCellsWidth for JOIQualRoundFrom2006To2019Provider includes lg:w-1/6, which is not present in JOISecondQualRound2020OnwardsProvider or JOISemiFinalRoundProvider. Both other JOI round providers stop at md:w-1/5. Confirm whether the 2006-2019 qualifying rounds actually have more tasks per contest that justify this additional breakpoint, or align the configuration with the other JOI providers for consistency.

Copy link
Collaborator

@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.

@river0525

プルリクエストを作成していただき、ありがとうございます
スーパークラスを使わない方がシンプルですね

また、既存のテストデータの不整合にもご対応いただき、ありがとうございます

LGTMです
マージします

close #(Issue番号) (close #2992)ようにすると、マージしたタイミングで Issue を自動的に解決済みにできます
ご参考までに

@KATO-Hiro KATO-Hiro merged commit 04ebb77 into staging Dec 27, 2025
3 checks passed
@KATO-Hiro KATO-Hiro deleted the create_joi_table branch December 27, 2025 05:24
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.

3 participants