fix: 郵便番号CSVのダウンロードURLを新URLへ変更 - #1425
Conversation
日本郵便のken_all.zip配布URLが変更され、旧URL (https://www.post.japanpost.jp/zipcode/dl/kogaki/zip/ken_all.zip) が404を返すようになったため、新URL (https://www.post.japanpost.jp/service/search/zipcode/download/kogaki/zip/ken_all.zip) へ更新する。 - data/mtb_constants_init.php: ZIP_DOWNLOAD_URL 定数のフォールバック値 - html/install/sql/insert_data.sql: 新規インストール時に mtb_constants へ投入される値 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
既存環境の mtb_constants に登録済みの ZIP_DOWNLOAD_URL を新URLへ更新する マイグレーションを追加する。管理画面で独自URLへ変更済みの環境を上書きしないよう、 値が旧URLの場合のみ更新する。 なお DB 更新のみでは定数キャッシュ(data/cache/n.php)へ即時反映されないため、 反映には管理画面「システム設定 > パラメータ設定」での保存操作が必要。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthrough郵便番号ZIPアーカイブの取得先URLを新しいパスへ変更し、初期データ・インストールSQL・既存環境向けマイグレーションに反映しています。 Changes郵便番号ZIP URL更新
Estimated code review effort: 1 (Trivial) | ~5 minutes Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1425 +/- ##
==========================================
+ Coverage 56.20% 56.23% +0.03%
==========================================
Files 87 87
Lines 11090 11091 +1
==========================================
+ Hits 6233 6237 +4
+ Misses 4857 4854 -3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@data/migrations/Version20260714000001_UpdateZipDownloadUrl.php`:
- Around line 29-30: Update the migration SQL in
Version20260714000001_UpdateZipDownloadUrl to use parameter placeholders with
$this->sql() instead of concatenating self::NEW_URL and self::OLD_URL into the
query. Bind both URL constants through the migration’s supported params
mechanism while preserving the existing update conditions.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: b070ef36-a839-44da-910d-d30d021ad004
📒 Files selected for processing (3)
data/migrations/Version20260714000001_UpdateZipDownloadUrl.phpdata/mtb_constants_init.phphtml/install/sql/insert_data.sql
CodeRabbit の指摘に対応し、ZIP_DOWNLOAD_URL 更新マイグレーションの UPDATE 文を文字列連結からプレースホルダ (?) + params バインドへ変更。 id / name の3値すべてをバインドし、SQL の扱いを一貫させる。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
b2f2caa のプレースホルダ化を取り消し、文字列連結方式へ戻す。 継承元 Eccube2\Migration\Migration::sql() のシグネチャは sql(string $sql, ?string $pgsql, ?string $sqlite) であり、第2引数は params 配列ではなく pgsql/sqlite 用のSQL派生文字列。内部の execute() も プレースホルダバインドをサポートしないため、配列を渡すと TypeError となり pgsql マイグレーションが失敗していた。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Summary
日本郵便の郵便番号CSV(
ken_all.zip)配布URLが変更され、旧URLが404を返すようになったため、ZIP_DOWNLOAD_URLを新URLへ更新します。https://www.post.japanpost.jp/zipcode/dl/kogaki/zip/ken_all.ziphttps://www.post.japanpost.jp/service/search/zipcode/download/kogaki/zip/ken_all.zip旧URLが404となったことで、管理画面「基本情報管理 > 郵便番号DB登録」の自動更新(
update_csv/auto)が動作しなくなっていました。変更点
data/mtb_constants_init.php:ZIP_DOWNLOAD_URL定数のフォールバック値を新URLへ変更html/install/sql/insert_data.sql: 新規インストール時にmtb_constantsへ投入される値を新URLへ変更data/migrations/Version20260714000001_UpdateZipDownloadUrl.php: 既存環境のmtb_constantsを新URLへ更新するマイグレーションを追加(管理画面で独自URLへ変更済みの環境を上書きしないよう、値が旧URLの場合のみ更新)既存環境への反映についての注意
ZIP_DOWNLOAD_URLは定数キャッシュ (data/cache/n.php) 経由で参照されます。マイグレーションでmtb_constants(DB) を更新しても、定数キャッシュには即時反映されません。 反映には管理画面「システム設定 > パラメータ設定」での保存操作(キャッシュ再生成)が必要です。Test plan
mtb_constantsのZIP_DOWNLOAD_URLが新URLへ更新されることken_all.zipが取得・展開されmtb_zipへ登録されること🤖 Generated with Claude Code
Summary by CodeRabbit