Repository navigation
fix: resolve path inconsistencies in MakeManualSiteNamesJson / MakeManualSiteNamesJsonのパス解決不整合を修正 - #593
Merged
zigzagdev merged 3 commits intoOct 20, 2026
Conversation
resolvePath() used base_path() directly, which only worked because the --in default option already includes the full storage/app/private/... prefix. Unlike every other console command in this pipeline, it could not accept a disk-relative path (e.g. --in=unesco/manual_input.txt), silently resolving it to the wrong location under the project root. ResolvesLocalDiskPaths::resolvePathToFile() handles both forms correctly and resolves to the identical path for the existing default option value.
…on output toLocalDiskPath() only stripped the storage/app/ prefix, not private/. With the documented default --out value (storage/app/private/unesco/site_names_manual.json), the file actually landed at storage/app/private/private/unesco/site_names_manual.json on the local disk (root storage/app/private), while the log line claimed the correct single-private path. Switch to ResolvesLocalDiskPaths::normalizeLocalDiskPath(), which strips both prefixes, and log the real resolved path instead of a hardcoded "storage/app/" prefix assumption.
Regression tests for both fixes: - --in now accepts a disk-relative path like every other command - --out no longer lands under a doubled private/ segment
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## refactor/console-commands-cleanup #593 +/- ##
=======================================================================
+ Coverage 67.72% 69.06% +1.33%
+ Complexity 1691 1687 -4
=======================================================================
Files 151 152 +1
Lines 8912 8915 +3
=======================================================================
+ Hits 6036 6157 +121
+ Misses 2876 2758 -118
🚀 New features to boost your workflow:
|
zigzagdev
merged commit Oct 20, 2026
175f8c1
into
refactor/console-commands-cleanup
28 checks passed
zigzagdev
deleted the
refactor/console-commands-cleanup_manual-names-path
branch
October 20, 2026 13:34
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.
Motivation / 目的
While investigating a candidate for the console-command path-resolution cleanup, MakeManualSiteNamesJson was found to have its own divergent resolvePath()/toLocalDiskPath() implementations instead of using the shared ResolvesLocalDiskPaths trait. Investigating why revealed two real bugs, not just duplication.
コンソールコマンドのパス解決共通化のリファクタ候補を調査する中で、MakeManualSiteNamesJsonだけが独自resolvePath()/toLocalDiskPath()を持っていることが分かりました。単なる重複ではなく、実際に2つの不具合が
見つかりました。
What I have done / 実施内容
ResolvesLocalDiskPathsfor--in:resolvePath()usedbase_path()directly, which only happened to work because the documented default already includes the fullstorage/app/private/...prefix. Unlike every other command in this pipeline, it could not accept a disk-relative path (e.g.--in=unesco/manual_input.txt), silently resolving to the wrong location under the project root.private/segment bug on--out:toLocalDiskPath()only stripped thestorage/app/prefix, notprivate/. With the documented default (storage/app/private/unesco/site_names_manual.json), the file actually landed atstorage/app/private/private/unesco/site_names_manual.json(local disk root isstorage/app/private), while the log line claimed the correct single-privatepath. Switched toResolvesLocalDiskPaths::normalizeLocalDiskPath()and fixed the log line to print the real resolved pathTest Results / テスト結果
php artisan test(full suite): 228 passed, no regressionsMakeManualSiteNamesJsonTest: confirms--inaccepts a disk-relative path, and--outno longer lands under a doubledprivate/segment