Skip to content

Comments

✨ Add tasks (#2590)#2611

Merged
KATO-Hiro merged 2 commits intostagingfrom
#2590
Sep 23, 2025
Merged

✨ Add tasks (#2590)#2611
KATO-Hiro merged 2 commits intostagingfrom
#2590

Conversation

@KATO-Hiro
Copy link
Collaborator

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

close #2590

Summary by CodeRabbit

  • New Features

    • Added recognition for additional AtCoder contests: ACL Beginner Contest, QUPC (Kyushu University) contests, JSC 2025 Final, and Tenka1 2015 Qual B.
    • Improved university contest ID matching to include QU-prefix contests.
  • Documentation

    • Updated examples and references to include QUPC and new contest entries; adjusted hack date to September 2025.
  • Tests

    • Added test cases for ACL Beginner Contest, QUPC (2014/2018), JSC 2025 Final, and Tenka1 2015 Qual B.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 23, 2025

Walkthrough

Adds new AtCoder contest identifiers and mappings: introduces abl in ABC-like, adds qupc to universities and others, extends others with jsc2025-final and tenka1-2015-qualb, and widens the university regex to include qu. Updates tests to cover new IDs and titles.

Changes

Cohort / File(s) Summary
Contest utils updates
src/lib/utils/contest.ts
Added ABC_LIKE entry abl; added qupc to ATCODER_UNIVERSITIES; added qupc, jsc2025-final, tenka1-2015-qualb to ATCODER_OTHERS; updated regexForAtCoderUniversity to include qu/qupc and tightened end anchor; updated inline docs/comments and examples.
Test cases extended
src/test/lib/utils/test_cases/contest_type.ts
Added ABC-like test for abl; appended qupc2014, qupc2018 to university IDs; added OTHERS tests for tenka1-2015-qualb and jsc2025-final; added explanatory comment about QUPC.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Caller
  participant Utils as ContestUtils
  Caller->>Utils: classifyContest(contestId)
  alt ABC-like match
    Note right of Utils#lightgreen: map contains "abl"
    Utils-->>Caller: type = ABC_LIKE
  else University regex match
    Note right of Utils#lightblue: regex now includes "qupc" (qu prefix)
    Utils-->>Caller: type = UNIVERSITY
  else Others map match
    Note right of Utils#lightyellow: map contains "qupc", "jsc2025-final", "tenka1-2015-qualb"
    Utils-->>Caller: type = OTHERS
  else Fallback
    Utils-->>Caller: type = UNKNOWN
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

I hop and scrawl: new names arrive, hooray!
abl and qupc leap out to play.
Tenka and JSC join the burrowed queue,
Regex stretched a stitch or two.
Tests munch carrots — green lights on their way 🥕🐇

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "✨ Add tasks (#2590)" is short and directly references issue #2590 and the primary action of adding tasks, so it relates to the main change in this PR; it is somewhat generic and could be clearer by naming the specific contests or noting "inclusion–exclusion tasks."
Linked Issues Check ✅ Passed The PR implements the coding-related items from issue #2590 by adding the requested contest identifiers and tests: 'abl' was added to ABC_LIKE, 'qupc' was added to ATCODER_UNIVERSITIES and ATCODER_OTHERS with qupc2014/qupc2018 test cases, and 'tenka1-2015-qualb' and 'jsc2025-final' were added to ATCODER_OTHERS; the AtCoder university regex was also updated to recognize the qu prefix. These changes correspond to the four tasks listed in the linked issue and satisfy the mapping and test updates required to include those contests.
Out of Scope Changes Check ✅ Passed The changes are focused on adding contest mappings, updating the AtCoder-university regex, and expanding test cases to cover the linked tasks, all of which align with the issue objectives; the only unrelated edit is a minor documentation/comment update changing a hack date from June 2025 to September 2025, which is cosmetic. No other out-of-scope functional code 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 #2590

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 (1)
src/lib/utils/contest.ts (1)

301-313: Anchor the university regex to match full IDs (doc/code consistency).

Docs say “End with exactly year (four digits)” but the regex isn’t anchored. Safe to anchor.

Apply this diff:

-const regexForAtCoderUniversity = /^(ku|qu|ut|tt|tu)(pc)(\d{4})/i;
+const regexForAtCoderUniversity = /^(ku|qu|ut|tt|tu)(pc)(\d{4})$/i;
📜 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 b6bf77c and a48c7d6.

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

95-105: Add ABL to ABC_LIKE — looks good.

The new entry for ACL Beginner Contest (abl) integrates cleanly with ABC_LIKE classification.


127-156: QUPC added to universities — classification path is correct.

Prefix inclusion, comments, and examples align. Consider adding/confirming a label test for qupc (e.g., 'QUPC 2018') via getAtCoderUniversityContestLabel.


173-199: OTHERS: Tenka1 2015 Qual B and JSC2025 Final — OK.

Prefixes will classify correctly via startsWith; tests cover both.

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

189-194: Test for ABL in ABC_LIKE — good addition.


284-301: University tests: QUPC coverage added — good.

IDs reflect known years (2014, 2018) and align with the new regex/prefix.

If there are other QUPC years hosted elsewhere, consider documenting them in the comment for future contributors.


389-393: OTHERS test: Tenka1 2015 Qual B — OK.


425-428: OTHERS test: JSC2025 Final — OK.

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)

95-105: ABL (ACL Beginner Contest) addition is correct; consider surfacing label in getContestNameLabel

Classification will return ABC_LIKE for abl, but getContestNameLabel('abl') currently falls back to ABL. Consider mapping ABC-like IDs to friendly names to avoid regressions in UI strings.

You can inject a fast path before the university/others/AOJ branches:

// Add before the university branch in getContestNameLabel()
if (abcLikePrefixes.has(contestId)) {
  return (ABC_LIKE as Record<string, string>)[contestId];
}

Please confirm whether the UI expects "ACL Beginner Contest" for abl. If so, this small mapping is needed to avoid showing "ABL".


127-153: QUPC inclusion in University contests — looks good; prevent regex drift

  • Adding qupc to ATCODER_UNIVERSITIES aligns with the widened regex and classification by prefix.
  • Optional: derive the university regex from ATCODER_UNIVERSITIES keys to keep one source of truth and avoid future divergence.

Example approach:

// Build once from ATCODER_UNIVERSITIES to avoid manual sync of prefixes.
const universityHeads = getContestPrefixes(ATCODER_UNIVERSITIES).map(k => k.slice(0, 2));
const regexForAtCoderUniversity = new RegExp(`^(${universityHeads.join('|')})(pc)(\\d{4})$`, 'i');

Please verify tests cover both qupc2014 and qupc2018 for label generation ("QUPC 2014/2018") and classification.


173-198: Map ATCODER_OTHERS in getContestNameLabel to use provided display names

getContestNameLabel currently falls back to contestId.toUpperCase(), so new ATCODER_OTHERS entries (e.g., tenka1-2015-qualb, jsc2025-final) will display as uppercased IDs instead of their Japanese titles — add a prefix lookup that returns ATCODER_OTHERS value before the AOJ branches/final fallback.

Insert in src/lib/utils/contest.ts inside getContestNameLabel(), before AOJ branches/fallback:

const key = atCoderOthersPrefixes.find((prefix) => contestId.startsWith(prefix));
if (key) return (ATCODER_OTHERS as Record<string, string>)[key];

📜 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 a48c7d6 and 0d73c91.

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

301-313: University regex tightening (added 'qu', anchored with $) — LGTM

The stricter anchor and inclusion of qu align with the new QUPC entries and avoid partial matches.

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 66d2d4c into staging Sep 23, 2025
5 of 6 checks passed
@KATO-Hiro KATO-Hiro deleted the #2590 branch September 23, 2025 23:04
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.

包除原理に関する問題を追加しましょう

1 participant