fix(japanpost): repair KEN_ALL_ROME download URL and refresh data#12
Open
stjean2016 wants to merge 3 commits into
Open
fix(japanpost): repair KEN_ALL_ROME download URL and refresh data#12stjean2016 wants to merge 3 commits into
stjean2016 wants to merge 3 commits into
Conversation
…fresh Japan Post moved the postal-code download to https and renamed the file to KEN_ALL_ROME.zip; the old http/lowercase URL now 404s, so gen.sh could no longer fetch source data and jp/*.json froze at the 2023-08 snapshot (e.g. 216-0043 / 神奈川県川崎市宮前区野川台 was missing). - gen.sh: fix download URL; build the processor for the host platform when Go is available (the committed binary is macOS/amd64, unusable on arm64 Macs and Linux runners); pack jp.tar.gz with a relative path so it stays rooted at jp/ (s3_sync.sh needs a top-level jp/ entry). - update.sh: also stage jp.tar.gz so the S3 Sync workflow (triggered on that file) actually fires. - add .github/workflows/update-data.yaml: workflow_dispatch + monthly cron that regenerates the data and opens a PR when Japan Post publishes changes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Regenerated with the repaired pipeline against Japan Post's current KEN_ALL_ROME (dated 2025-06-03). Adds 730 new postal codes and updates 671, including 216-0043 (神奈川県川崎市宮前区野川台) which was missing from the 2023-08 snapshot. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
216-0043(神奈川県川崎市宮前区野川台) and every postal code created since 2023-08 returned 404 — the served data (jp/*.jsonon S3) had been frozen at the 2023-08-22 snapshot.Root cause: Japan Post moved the entire postal-code download tree from
/zipcode/dl/to/service/search/zipcode/download/.japanpost/gen.shstill pointed at the oldhttp://www.post.japanpost.jp/zipcode/dl/roman/ken_all_rome.zip, which now 404s, so the data could no longer be regenerated. There was also no scheduled job running the update —s3-sync.yamlonly deploysjp.tar.gzwhen it changes.Changes
Pipeline fixes (
c301e04d9)japanpost/gen.shhttps://www.post.japanpost.jp/service/search/zipcode/download/roman/KEN_ALL_ROME.zip.processorfor the host platform when Go is available. The committed binary is macOS/amd64 and won't run on arm64 Macs or Linux CI runners.jp.tar.gzwith a relative path (tar -C "$WORK_DIR" ... jp) so it stays rooted atjp/;s3_sync.shextracts it and runsaws s3 sync jp/, which needs a top-leveljp/entry.update.sh— also stagejp.tar.gzso the S3 Sync workflow (which triggers on that file) actually fires after a manual update..github/workflows/update-data.yaml(new) —workflow_dispatch+ monthly cron that regenerates the data and opens a PR whenever Japan Post publishes changes.Data refresh (
c6ec4d2e0)KEN_ALL_ROME(dated 2025-06-03): 730 new postal codes, 671 updated, including216-0043.Verification
bash -n,go vet, YAML parse: pass.processorfrommain.go; ran it against the realKEN_ALL_ROME.CSV→jp/2160043.json={"prefecture":"神奈川県","city":"川崎市宮前区","town":"野川台"}.jp.tar.gzverified: 120,851 entries, rooted atjp/, no corruption, contains2160043; matches thejp/tree exactly.Notes for reviewers
c6ec4d2e0) can be dropped and regenerated via the new workflow after merge.🤖 Generated with Claude Code