-
-
Notifications
You must be signed in to change notification settings - Fork 10
Create JOI second qual and semi-final round table #2999
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughAdded 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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this 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
regexForJoiQualRoundandregexForJoiSemiFinalRound.
📜 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
📒 Files selected for processing (3)
src/lib/types/contest_table_provider.tssrc/lib/utils/contest_table_provider.tssrc/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_SECTIONSand are correctly typed withas 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 whilefrom2006To2019is 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 forJOISecondQualRound2020OnwardsProvideris thorough.Tests correctly verify:
- Filtering includes only
joi{YYYY}yo2contests- Exclusion of other JOI formats (yo1, yo, ho)
- Metadata and display configuration
- Round label extraction
2288-2356: Test coverage forJOIQualRoundFrom2006To2019Provideris well-designed.Tests correctly verify that
yo1andyo2variants are excluded while the baseyoformat (older qualifying rounds) is included.
2358-2427: Test coverage forJOISemiFinalRoundProvideris 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 ofJOISecondQualRound2020OnwardsProviderfollows established patterns.The class correctly extends
ContestTableProviderBase, uses the appropriate section identifier, and implements all required methods consistently withJOIFirstQualRoundProvider.
881-917: Implementation ofJOIQualRoundFrom2006To2019Provideris correct.The class correctly filters for the older
joi{YYYY}yoformat (without the1/2suffix).Note: The section is stored under
JOI_SECOND_QUAL_ROUND_SECTIONS.from2006To2019which 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 ofJOISemiFinalRoundProvideris correct.The class correctly filters for
joi{YYYY}hoformat and implements all required methods.
1260-1260: New provider group correctly registered incontestTableProviderGroups.
1229-1229: > Likely an incorrect or invalid review comment.
There was a problem hiding this 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: TheariaLabeldoes not fully describe the group contents.The group contains three round types (二次予選 2020+, 予選 2006-2019, 本選), but the
ariaLabelonly 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
📒 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
JOISecondQualRound2020OnwardsProviderimplementation 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
joiSecondQualAndSemiFinalRoundcorrectly 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
tableBodyCellsWidthforJOIQualRoundFrom2006To2019Providerincludeslg:w-1/6, which is not present inJOISecondQualRound2020OnwardsProviderorJOISemiFinalRoundProvider. Both other JOI round providers stop atmd: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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
プルリクエストを作成していただき、ありがとうございます
スーパークラスを使わない方がシンプルですね
また、既存のテストデータの不整合にもご対応いただき、ありがとうございます
LGTMです
マージします
close #(Issue番号) (close #2992)ようにすると、マージしたタイミングで Issue を自動的に解決済みにできます
ご参考までに
@KATO-Hiro
JOIの二次予選・旧予選・本選の表を作成しました。
hiroさんにdiscordに送っていただいた実装方針から変更した点は以下の通りです。
①
JOISecondQualAndSemiFinalRoundProviderクラスの削除表の実装の際、
getMetadata(): titleとabbreviationNameは空文字を返すようにするとエラーが発生したため、一次予選の表を参考に文字を返すよう調整しました。それにより、3つの難易度表の共通部分がなくなったため、新たにスーパークラスを作る必要性はないと判断しました。
代わりに、3つのテーブルそれぞれが既存の
ContestTableProviderBaseを継承する形に変更しました。②表の
getContestRoundLabel()が空文字ではなく年度を返すようにした表の行名がないのは不便だと感じたため、
getContestRoundLabel()は年度を返すようにしました。③mockの更新
②の変更に伴って、
contest_table_provider.test.ts内のmockを二次予選・本選の形式にも対応できるよう変更しました。また、一次予選の単体テストに二次予選・本選の問題を用いているものがあり、エラーが発生していたため削除いたしました。
不明点や改善点などありましたらご指摘よろしくお願いいたします。
Summary by CodeRabbit
New Features
Tests
✏️ Tip: You can customize this high-level summary in your review settings.