Skip to content

fix: follow the AOJ API migration - #4219

Merged
KATO-Hiro merged 11 commits into
stagingfrom
#4028
Oct 24, 2026
Merged

KATO-Hiro merged 11 commits into
stagingfrom
#4028

Conversation

@KATO-Hiro

@KATO-Hiro KATO-Hiro commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator

close #4028

#4030 の前段階として位置付け
docsが入っているのはそのせいです

Summary by CodeRabbit

  • 変更点
    • AOJ API の接続先を新しいホストに変更しました。
    • AOJ への通信を開発コンテナで許可する接続先を更新しました。
    • AOJ クライアントのテストを新しい接続先に対応させました。

KATO-Hiro and others added 11 commits October 24, 2026 09:10
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ters

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… titles

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The AOJ Main API moved from judgeapi.u-aizu.ac.jp to
onlinejudge.u-aizu.ac.jp/api/ on 2026-09-07 and the old host returns 410,
so every AOJ import from the admin page failed. Endpoint paths and response
shapes are unchanged (checked against the recorded fixtures).

The client tests now build clients from AOJ_API_BASE_URL and intercept the
literal /api/ paths, so a wrong base URL such as one without the trailing
slash fails them. nock.disableNetConnect keeps them off the real API.

Mutants on AOJ_API_BASE_URL (no trailing slash, old host, extra path
segment, no /api) each fail all 26 tests.

Refs #4028

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keep only the decisions and the facts the code does not show (verified
response shape, base URL pitfall, mutation results, pending manual check)
in done.md, and point plan.md / plan-pr2.md there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The AOJ API moved to onlinejudge.u-aizu.ac.jp (163.143.87.177), which the
egress allowlist did not include, so the admin import failed with 500 inside
the dev container while the browser on the host could open the API. Replace
the retired judgeapi.u-aizu.ac.jp instead of adding a host. The script is
copied into the image, so the change takes effect after a container rebuild.

Refs #4028

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

Walkthrough

AOJ API のベース URL と開発コンテナの許可先を新ホストに変更しました。クライアントテストのモック先も更新しました。task index の実施記録、調査結果、後続作業計画を更新しました。

Changes: AOJ API と task index 関連作業

Layer / File(s) Summary
AOJ API 接続先の変更
.devcontainer/init-firewall.sh, src/lib/constants/urls.ts, src/lib/clients/aizu_online_judge/clients.test.ts, docs/dev-notes/2026-09-09/task-title-index-change-impact/done.md
AOJ API の URL を onlinejudge.u-aizu.ac.jp/api/ に変更しました。テストのモック先を新しいパスに合わせ、テスト中の外部ネットワーク接続を無効化しました。実施記録には検証状況と残タスクを記載しました。
実施状況と共通手順
docs/dev-notes/2026-09-09/task-title-index-change-impact/done.md, docs/dev-notes/2026-09-09/task-title-index-change-impact/plan.md
PR0・PR1 の実施内容と、PR1.5以降の対象、実施順序、移行手順を記録しました。
照合結果と DB 調査
docs/dev-notes/2026-09-09/task-title-index-change-impact/investigation.md
コンテストと問題の照合結果、DB の登録状況、欠落問題、task の書き込み経路などを調査資料にまとめました。
PR2 の移行計画
docs/dev-notes/2026-09-09/task-title-index-change-impact/plan-pr2.md
対象データの照合、記号とタイトルの更新、件数検査、適用手順、テスト項目を計画に記載しました。
後続作業計画
docs/dev-notes/2026-09-09/task-title-index-change-impact/plan-pr2-1.md, docs/dev-notes/2026-09-09/task-title-index-change-impact/plan-pr2-5.md, docs/dev-notes/2026-09-09/task-title-index-change-impact/plan-pr3.md
コンテスト追加、JAG グループ表示、欠落問題への対応について、対象範囲と作業項目を記載しました。

Priority: Not assessed

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Bug fix

Merge Risk: Low · up to 552d2

The AOJ API host migration is a small, low-risk change that reflects the reported move to the new host. Two inaccuracies remain in the planning notes and should be corrected as follow-up. Neither blocks the merge. Confirm after deploy that staging can reach the new API host.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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.

@KATO-Hiro KATO-Hiro left a comment

Copy link
Copy Markdown
Collaborator Author

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 dd96907 into staging Oct 24, 2026
6 checks passed
@KATO-Hiro
KATO-Hiro deleted the #4028 branch October 24, 2026 13:56

This branch was previously deployed

1 inactive deployment
preview — 552d2a11 Deployed Oct 24, 2026 by KATO-Hiro via preview #9088
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] AOJ の API 変更に追従しましょう

1 participant