Skip to content

fix(config): read framework version from box.json (closes #2232) - #2240

Merged
bpamiri merged 1 commit into
developfrom
peter/fix-hardcoded-version-2232
Apr 23, 2026
Merged

bpamiri merged 1 commit into
developfrom
peter/fix-hardcoded-version-2232

Conversation

@bpamiri

@bpamiri bpamiri commented Apr 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Introduces $readFrameworkVersion() in vendor/wheels/Global.cfc which reads the version key from vendor/wheels/box.json (sibling of Global.cfc).
  • onapplicationstart.cfc now calls this helper instead of hardcoding "4.0.0". TODO comment removed.
  • vendor/wheels/box.json gets a "version":"@build.version@" key. tools/build/scripts/prepare-core.sh already runs sed 's/@build.version@/${VERSION}/g' across .json|.cfm|.cfc during release packaging, so a distributed framework carries its real version.
  • Dev checkouts ship the @build.version@ literal; the helper detects this and returns "0.0.0-dev".
  • Missing/unparseable box.json or missing version key → throws Wheels.VersionReadFailed loudly (per issue spec: "fail loudly — but this should never happen in a distributed copy").
  • Adds vendor/wheels/tests/specs/events/frameworkVersionSpec.cfc with 7 specs covering runtime post-condition, happy path, placeholder detection, and three failure modes.

Closes #2232.

Acceptance criteria (from issue)

  • application.wheels.version matches box.json version field at runtime (confirmed via /wheels/cli → wheelsVersion: 0.0.0-dev).
  • No hardcoded 4.0.0 in CFML source (grep -rn '"4\.0\.0"' vendor/wheels/ → empty).
  • TODO comment gone.
  • Release tooling only needs to bump box.json — no code edit required for 4.0.1+.

Test plan

  • Full core suite on Lucee 7 + SQLite: 3258 pass, 0 fail, 0 error (baseline had 7 pre-existing pagination flakes in linksSpec that happened to pass this run; no new failures).
  • Runtime check: curl /wheels/cli → wheelsVersion: 0.0.0-dev (placeholder correctly translated).
  • Grep: no "4.0.0" string literal remains in vendor/wheels/.
  • CI matrix (Lucee 5/6/7, Adobe 2018/2021/2023/2025, BoxLang × databases) — pending green check.

Cross-engine notes

Uses only portable CFML built-ins: FileExists, FileRead, DeserializeJSON, GetCurrentTemplatePath, GetDirectoryFromPath, Throw. No engine-specific APIs.

🤖 Generated with Claude Code

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>
@github-actions github-actions Bot added enhancement dependencies Pull requests that update a dependency file labels Apr 23, 2026
@bpamiri
bpamiri merged commit c69ed7a into develop Apr 23, 2026
3 checks passed
@bpamiri
bpamiri deleted the peter/fix-hardcoded-version-2232 branch April 23, 2026 01:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(config): hardcoded version string "4.0.0" in onapplicationstart.cfc with TODO

1 participant