Repository navigation
fix(config): read framework version from box.json (closes #2232) - #2240
Merged
Merged
Conversation
Closes #2232. onapplicationstart.cfc hardcoded the framework version as "4.0.0" with a TODO, forcing a code edit for every 4.0.1+ patch release. Introduces $readFrameworkVersion() in Global.cfc which reads the version key from vendor/wheels/box.json (sibling of Global.cfc). The release build pipeline already substitutes @build.version@ in box.json via prepare-core.sh, so a distributed framework carries its real version. Dev checkouts ship "@build.version@" literal; the helper detects this and returns "0.0.0-dev". A missing file, unparseable JSON, or missing version key throws Wheels.VersionReadFailed loudly (per issue spec: "fail loudly — but this should never happen in a distributed copy"). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 of 4 tasks
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.
Summary
$readFrameworkVersion()invendor/wheels/Global.cfcwhich reads theversionkey fromvendor/wheels/box.json(sibling ofGlobal.cfc).onapplicationstart.cfcnow calls this helper instead of hardcoding"4.0.0". TODO comment removed.vendor/wheels/box.jsongets a"version":"@build.version@"key.tools/build/scripts/prepare-core.shalready runssed 's/@build.version@/${VERSION}/g'across.json|.cfm|.cfcduring release packaging, so a distributed framework carries its real version.@build.version@literal; the helper detects this and returns"0.0.0-dev".versionkey → throwsWheels.VersionReadFailedloudly (per issue spec: "fail loudly — but this should never happen in a distributed copy").vendor/wheels/tests/specs/events/frameworkVersionSpec.cfcwith 7 specs covering runtime post-condition, happy path, placeholder detection, and three failure modes.Closes #2232.
Acceptance criteria (from issue)
application.wheels.versionmatchesbox.jsonversionfield at runtime (confirmed via/wheels/cli→wheelsVersion: 0.0.0-dev).4.0.0in CFML source (grep -rn '"4\.0\.0"' vendor/wheels/→ empty).box.json— no code edit required for 4.0.1+.Test plan
linksSpecthat happened to pass this run; no new failures).curl /wheels/cli→wheelsVersion: 0.0.0-dev(placeholder correctly translated)."4.0.0"string literal remains invendor/wheels/.Cross-engine notes
Uses only portable CFML built-ins:
FileExists,FileRead,DeserializeJSON,GetCurrentTemplatePath,GetDirectoryFromPath,Throw. No engine-specific APIs.🤖 Generated with Claude Code