Add An Autofix CLI For Invalid Format Versions #15
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feature/implement-autofix-invalid-format-versions"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Adds
npm run fix:formatVersions. It scans the same assets asnpm run validate:formatVersionsand bumps outdatedformat_versionvalues in place.format_versionstring, so the rest of the file stays as it is.npm run validate:formatVersionsshould pass. Files with noformat_version, or a legacygeometry.*root, are skipped and still need a manual edit.Test plan
npm run validate:formatVersionsis green on this branchformat_version, runnpm run fix:formatVersions, accept that category, confirm the string bumped and validate is green againReview of head
3f3ad944c9fc2— newfix:formatVersionsCLI + first-run asset bumps. No prior reviews. mergeable=true vs mainf3dee531. Auth as bot. No open same-repo issues to link.Blocker:
collectOutdatedVersionEntriesstoresstripSubpackPrefix(relPath)asrelPath.SCAN_DIRSincludessubpacks/, so outdated subpack assets get written to the wrong place (root counterpart / miss) whenfix:formatVersionsjoinsprocess.cwd()+ that stripped path. Keep the full pack-relative path for IO; strip only for category resolution / display if needed.Scope: title is CLI-focused, but the PR also lands ~25
format_versionbumps. Same charm/hyde/rotom/gymleader/entity bumps already sit on open res#8 head36667487(identicalcatching_charmblob). Prefer CLI-only here and keep the data migration on one PR, or state clearly that #15 owns the bumps and strip them from #8 to avoid double-merge churn.Otherwise the validate refactor (
getRequiredInfo/walkValidatedFiles/ JSDoc) looks solid,@inquirer/promptsis already a dependency, and charm →1.16.100matchesattachableClient(c.is_first_person). Empty PR body /Initcommit — please describe intended usage + whether validate is green after the bumps.Nit: async
main()is invoked without.catch(unhandled rejection on prompt/IO failure).@ -0,0 +90,4 @@if (!shouldUpdate) continue;for (const entry of list) {const absPath = path.join(process.cwd(), entry.relPath);Uses
entry.relPathfor the write target. OncecollectOutdatedVersionEntriesreturns the real pack-relative path (including anysubpacks/...prefix), this join is correct; with the current stripped path it can create/update the wrong file.@ -0,0 +98,4 @@console.log(`\n✅ Updated ${updatedCount} file(s).`);}if (require.main === module) main();Nit:
main()is async — prefermain().catch((err) => { console.error(err); process.exit(1); })so prompt/IO failures do not become unhandled rejections.@ -198,0 +235,4 @@const version = data["format_version"];if (typeof version !== "string" || isAtLeast(version, info.required)) return;entries.push({ relPath: rel, category: info.category, current: version, required: info.required });Blocker:
relisstripSubpackPrefix(...), then stored asrelPath. Subpack files undersubpacks/<name>/...(also walked viaSCAN_DIRS) will report/fix the wrong path. Store the original pack-relativerelPathfor IO; use the stripped form only when resolving category.Re-review of head
3095b489(was3f3ad944). Nathan resolved the three prior inlines (subpackrelPathwrite bug +.catch). CIbuild-and-testgreen on this head (run 160 / 29s). Model Preview red (run 161) — not treating as the merge gate. No open same-repo issues to link. Auth as bot.Fixed:
collectOutdatedVersionEntriesnow stores the real pack-relativerelPath(JSDoc matches);main().catch(...)is in place.Still open — scope / double-merge: title is CLI-focused, but ~25
format_versionbumps remain and still overlap open res#8 (charms/hyde/rotom/gymleader paths). Pick one and write it in the PR body:validate:formatVersionson main) → strip the identical format_version-only churn from #8 before either merges; orEmpty PR body still — please describe
npm run fix:formatVersionsusage + that validate is green after the bumps.Nit (non-blocking): confirm prompt missing
?(Do you want to update them).@ -6,6 +6,7 @@"scripts": {"test": "jest","validate:formatVersions": "npx ts-node --project tsconfig.json scripts/validateFormatVersions.ts","fix:formatVersions": "npx ts-node --project tsconfig.json scripts/fixFormatVersions.ts",Scope still open:
fix:formatVersionsis the feature, but this PR also lands ~25format_versionasset bumps that overlap res#8. Either declare in the PR body that #15 owns those bumps and strip the same format_version-only churn from #8, or drop the bumps here and keep this CLI-only.Re-review of head
f09d33516d5830f8bc832361827c96dfd9c80096(was3095b489— merge main into feature). Auth as bot. mergeable=true vs main5a2ff211. CIbuild-and-testgreen (run 331 / ~30s). Model Preview still pending — not treating as the merge gate. No open same-repo issues to link.Prior blockers cleared:
collectOutdatedVersionEntriesstill stores the real pack-relativerelPath(incl.subpacks/…) for IO; strip only for category resolution.main().catch(...)still in place.5a2ff211already shipped the broad format_version migration, so the old “who owns the bumps” fight is moot.Still open — drop leftover asset churn: the six animation paths still in the diff (
wrist_charm,hyde,dragon/electric/ghost/psychic_gymleader) are whitespace-only (spaces→tabs / blank-line reshuffle). Semantic JSON is unchanged andformat_versionstays at already-required1.10.0— they are not autofix output that moves versions. Title is CLI-focused; please revert those six files so this PR ispackage.json+scripts/fixFormatVersions.ts+scripts/validateFormatVersions.tsonly.Still open — empty PR body: please describe
npm run fix:formatVersionsusage (interactive per-category confirm) and that validate is expected green after a fix run.Nit (non-blocking): confirm prompt still missing
?(Do you want to update them).CLI refactor itself looks solid once the indent noise is gone.
@ -0,0 +84,4 @@}const shouldUpdate = await confirm({message: "Do you want to update them",Nit: confirm message is missing a trailing
?(Do you want to update them→Do you want to update them?).REQUEST_CHANGES on head
f09d33516d5830f8bc832361827c96dfd9c80096(merge of main5a2ff211intofeature/implement-autofix-invalid-format-versions). mergeable=true. CI gatebuild-and-testsuccess (run 331 / ~30s). Model Preview run 332 pending — non-gate. Open same-repo issues: 0 (no Fixes/Could Fix). Auth as bot. No prior bot review on this tip.Cleared since
3095b489:relPathIO +main().catchstill correct.5a2ff211already raised the staleformat_versions.Still open
wrist_charm,hyde,*_gymleader) are semantically identical to main (format_versionalready1.10.0; JSON equal). Diff is tabs/whitespace/wrap only, not whatbumpFormatVersiondoes. Title is CLI-focused; keep this PR scripts +package.jsononly.npm run fix:formatVersions(category prompts, safe in-place bump) and that validate is green on tip.CLI/
validateFormatVersionsrefactor looks good (getRequiredInfo,walkValidatedFiles, JSDoc,OutdatedVersionEntry.relPathdocs).Nit (non-blocking, still present): confirm prompt
Do you want to update themmissing?.Next: strip the 6 no-op animation files + fill PR body → re-review for approve.
@ -23,3 +2,1 @@}}}"format_version": "1.10.0",Scope: tip vs main is whitespace-only (tabs/indent);
format_versionis already1.10.0on both and JSON content is identical. Same forhyde+ the four*_gymleaderanimation files in this PR. Please revert these 6 asset files so the diff stays CLI-only (scripts/*+package.json).REQUEST_CHANGES on head
385db876f45f63daf8db704e361f298aa64cb562(wasf09d3351— sole new commit: point model-preview at Forgejopokebedrock/mc-model-preview@b10a8ffc). mergeable=true vs main5a2ff211/ merge-base. Auth as bot. Open same-repo issues: 0 — no Fixes/Could Fix. CI on this tip still pending (build-and-testrun 347 + Model Preview run 348) at review time; prior tip had greenbuild-and-test.New since last review — OK:
.github/workflows/model-preview.ymlcorrectly leaves GitHubsmell-of-curry/mc-model-preview@latestfor a Forgejo-pinnedhttps://git.pokebedrock.com/pokebedrock/mc-model-preview@b10a8ffc…. Chrome install step unchanged. Non-blocking on its own.Still open (unchanged from REQUEST_CHANGES on
f09d3351):wrist_charm,hyde,dragon/electric/ghost/psychic_gymleader) remainjson_equalto main withformat_versionalready1.10.0. Diff is tabs/whitespace/wrap only, notbumpFormatVersionoutput. Title is CLI-focused; keep this PR topackage.json+scripts/fixFormatVersions.ts+scripts/validateFormatVersions.ts(+ the model-preview pin is fine to keep).npm run fix:formatVersions(interactive per-category confirm, in-place bump) and that validate is expected green after a fix run.CLI/
validateFormatVersionsrefactor still looks solid (relPathpack-relative for IO,main().catch, JSDoc).Nit (non-blocking, still present): confirm prompt
Do you want to update themmissing?.Next: strip the 6 no-op animation files + fill PR body → re-review for approve.
Minecraft Model Preview (
385db87)Model Changes
REQUEST_CHANGES on head
385db876f45f63daf8db704e361f298aa64cb562(wasf09d3351— Point model preview at the Forgejo copy of the action.). Auth as bot. mergeable=true vs moving main. CIbuild-and-test+ Model Preview still pending on this tip — not treating as green yet. Open same-repo issues: 0 (no Fixes/Could Fix).Tip delta vs last review: only
.github/workflows/model-preview.yml—uses:now pinshttps://git.pokebedrock.com/pokebedrock/mc-model-preview@b10a8ffc…(matches current main). Fine; not a blocker.Still open (unchanged since REQUEST_CHANGES#2950 @
f09d3351)wrist_charm,hyde,dragon/electric/ghost/psychic_gymleader) remain JSON-equal to main (format_versionalready1.10.0). Diff is whitespace/indent only, not autofix output. Keep this PR topackage.json+scripts/fixFormatVersions.ts+scripts/validateFormatVersions.ts(+ the workflow pin is OK).npm run fix:formatVersions(per-category confirm, in-place bump) and that validate is expected green after a fix run.CLI/
validateFormatVersionsrefactor still looks solid (collectOutdatedVersionEntrieskeeps full pack-relativerelPath,main().catch, JSDoc).Nit (non-blocking): confirm prompt still
Do you want to update them(missing?).Next: strip the 6 no-op animation files + fill PR body → re-review for approve once CI settles.
Minecraft Model Preview (
0cb915b)Model Changes
Superseded by #22. The six whitespace-only animation files are gone, and the CLI description is on the new PR. This branch's diff stayed rooted at
5a2ff211, so Forgejo still listed files that are already onmain. Closing so that one is the review.Pull request closed