Skip to content

Comments

✨ Add tasks (#2617)#2618

Merged
KATO-Hiro merged 2 commits intostagingfrom
#2617
Sep 24, 2025
Merged

✨ Add tasks (#2617)#2618
KATO-Hiro merged 2 commits intostagingfrom
#2617

Conversation

@KATO-Hiro
Copy link
Collaborator

@KATO-Hiro KATO-Hiro commented Sep 24, 2025

close #2617

Summary by CodeRabbit

  • New Features

    • Expanded recognition of ABC-like contests to include Tenka1 (2017–2019 Beginner), SoundHound 2018 Summer Qual, Aising 2019, Sumitrust 2019, M-SOLUTIONS 2020, and ZONe 2021 — improving automatic contest classification, filtering, and display.
  • Tests

    • Added test coverage for all newly supported contests to ensure accurate detection and stable behavior.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 24, 2025

Walkthrough

Expanded the ABC_LIKE contest prefix set in src/lib/utils/contest.ts with additional AtCoder contest IDs and added corresponding test cases in src/test/lib/utils/test_cases/contest_type.ts. No control-flow, API, or error-handling changes.

Changes

Cohort / File(s) Summary
ABC-like prefix expansion
src/lib/utils/contest.ts
Added new key–value pairs to the ABC_LIKE mapping for additional contest prefixes (e.g., tenka1-2017-beginner, soundhound2018-summer-qual, tenka1-2018-beginner, aising2019, sumitrust2019, tenka1-2019-beginner, m-solutions2020, zone2021). Lookup logic unchanged.
Test updates for ABC-like contests
src/test/lib/utils/test_cases/contest_type.ts
Extended the exported abcLike test array with entries covering the newly recognized contests; no changes to test structure or expectations beyond added cases.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I thump my paw—more contests bloom,
From Tenka’s dawn to ZONe’s high zoom.
I nibble tests with careful cheer,
New prefixes hop far and near.
In fields of code, I swiftly glide—
ABC-like paths now broad and wide. 🥕✨

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title Check ❓ Inconclusive The title "✨ Add tasks (#2617)" is overly generic and uses an emoji and an issue number rather than describing the primary code change; it does not make it clear that the PR adds ABC-like contests to the ABC_LIKE mapping and related tests. Because the title is vague, it is not sufficiently informative for reviewers scanning history. Please update the PR title to a concise descriptive sentence that highlights the main change, for example "Add ABC-like contests to ABC_LIKE mapping (zone2021, m-solutions2020, tenka1-2019-beginner, ...)" so the primary change is immediately clear.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues Check ✅ Passed The changes add entries for all contest IDs listed in issue #2617 to the ABC_LIKE mapping and extend unit tests to assert those contest IDs are detected as ABC_LIKE (zone2021, m-solutions2020, tenka1-2019-beginner, sumitrust2019, aising2019, soundhound2018-summer-qual, tenka1-2018-beginner, tenka1-2017-beginner), which satisfies the coding objectives of the linked issue. The modifications are limited to the mapping constant and related test cases and directly implement the requested imports support.
Out of Scope Changes Check ✅ Passed The diff only updates src/lib/utils/contest.ts to extend the ABC_LIKE mapping and adds corresponding entries in src/test/lib/utils/test_cases/contest_type.ts; there are no other file changes or unrelated modifications present in the provided summary. Therefore no out-of-scope changes were detected.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch #2617

📜 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 d82ad1b and 700d2a3.

📒 Files selected for processing (2)
  • src/lib/utils/contest.ts (1 hunks)
  • src/test/lib/utils/test_cases/contest_type.ts (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/test/lib/utils/test_cases/contest_type.ts
  • src/lib/utils/contest.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

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

Actionable comments posted: 0

🧹 Nitpick comments (3)
src/lib/utils/contest.ts (3)

98-98: Unify Tenka1 Beginner display names (include years for consistency)

Two entries omit the year while 2019 includes it. Suggest adding years for 2017/2018 to keep labels consistent.

Apply this diff:

-  'tenka1-2017-beginner': 'Tenka1 Programmer Beginner Contest',
+  'tenka1-2017-beginner': 'Tenka1 Programmer Beginner Contest 2017',
...
-  'tenka1-2018-beginner': 'Tenka1 Programmer Beginner Contest',
+  'tenka1-2018-beginner': 'Tenka1 Programmer Beginner Contest 2018',

Also applies to: 102-102, 105-105


322-389: Consider surfacing official labels for ABC_LIKE in getContestNameLabel

Currently ABC_LIKE contests fall back to contestId.toUpperCase(). Since you already maintain ABC_LIKE with official names, you can use it to improve UX.

Add a branch before the final fallback:

// Prefer official display names for ABC_LIKE contests
if (abcLikePrefixes.has(contestId)) {
  return (ABC_LIKE as Record<string, string>)[contestId] ?? contestId.toUpperCase();
}

If you want to avoid casting, a tiny helper works:

function getLabelFromMap(map: Record<string, string>, key: string) {
  return Object.prototype.hasOwnProperty.call(map, key) ? map[key] : undefined;
}

Then:

const label = getLabelFromMap(ABC_LIKE, contestId);
if (label) return label;

303-304: Anchor the Axc regex to avoid partial matches

regexForAxc can match prefixes of longer strings (e.g., abc123x). Anchoring to end eliminates false positives in label generation.

Apply this diff:

-const regexForAxc = /^(abc|arc|agc)(\d{3})/i;
+const regexForAxc = /^(abc|arc|agc)(\d{3})$/i;

Please ensure this doesn’t affect any existing label cases beyond the intended ones (tests for ABC/ARC/AGC should still pass).

📜 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 b79ad98 and d82ad1b.

📒 Files selected for processing (2)
  • src/lib/utils/contest.ts (1 hunks)
  • src/test/lib/utils/test_cases/contest_type.ts (4 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 (2)
src/lib/utils/contest.ts (1)

98-113: Expanded ABC_LIKE prefixes: looks good

New prefixes align with the import targets in the PR objective and match AtCoder IDs. Classification order preserves expected precedence.

Please confirm there’s no overlap with ARC_LIKE/OTHERS by running the test suite; if you want, I can generate a quick script to diff the key sets and check for collisions.

src/test/lib/utils/test_cases/contest_type.ts (1)

190-221: New ABC_LIKE classification tests: looks good

Coverage aligns with the newly added prefixes and keeps expectations consistent.

Also applies to: 230-233, 242-245

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 2c52996 into staging Sep 24, 2025
3 checks passed
@KATO-Hiro KATO-Hiro deleted the #2617 branch September 24, 2025 09:43
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.

ABC-like のコンテストの問題をインポートできるようにしましょう

1 participant