Skip to content

fix(config): walk up two levels for monorepo box.json in $readFrameworkVersion - #2293

Merged
bpamiri merged 1 commit into
developfrom
claude/hardcore-bhaskara-efe216
Apr 24, 2026
Merged

fix(config): walk up two levels for monorepo box.json in $readFrameworkVersion#2293
bpamiri merged 1 commit into
developfrom
claude/hardcore-bhaskara-efe216

Conversation

@bpamiri

@bpamiri bpamiri commented Apr 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Fixes Verify that $readFrameworkVersion()'s default rootBoxJsonPath actually reaches the monorepo at runtime #2291: $readFrameworkVersion()'s default rootBoxJsonPath walked up only one level from Global.cfc (vendor/wheels/../box.json = vendor/box.json), which doesn't exist in the monorepo layout. Correct path walks up two levels to <repo-root>/box.json. At runtime boot via onapplicationstart.cfc (called with no args), this caused application.wheels.version to silently resolve to "0.0.0-dev" inside a wheels-dev/wheels checkout. One-character fix plus a regression spec.
  • Adds a regression test in frameworkVersionSpec.cfc that asserts the runtime boot result (application.wheels.version) rather than invoking the helper directly, because WheelsTest.cfc binds methods into each spec's scope — which shifts GetCurrentTemplatePath() and bypasses the code path we need to cover. The test skips gracefully in release builds and vendored installs via environment-gated early returns.

Why the existing tests didn't catch it

Every pre-existing spec passed explicit path arguments, so the Len(arguments.rootBoxJsonPath) ? ... : <default> ternary always took the left branch. The default-computation side of the ternary was completely uncovered.

Verification

  • Runtime probe pre-fix: application.wheels.version = "0.0.0-dev" — bug confirmed against a fresh checkout boot
  • Runtime probe post-fix: application.wheels.version = "4.0.0-dev" — matches <repo-root>/box.json version + -dev suffix
  • Core suite (Lucee 7 + SQLite, bash tools/test-local.sh): 3328 pass / 0 fail / 0 error (was 3327; the new spec accounts for the delta)
  • Negative control: with fix reverted, the regression test fails with Expected [4.0.0-dev] but received [0.0.0-dev] — confirms the test actually catches the bug rather than skipping silently

Test plan

  • Full core suite green on Lucee 7 + SQLite
  • Manual verification that application.wheels.version resolves to 4.0.0-dev at runtime after the fix
  • Manual verification that regression spec fails with the bug reintroduced
  • CI matrix (Lucee 5/6/7, Adobe 2018/2021/2023/2025, BoxLang × MySQL/Postgres/SQL Server/H2/SQLite/CockroachDB) — relies on the same code path, no engine-specific surface touched
  • Release-build smoke (branch where @build.version@ is substituted): regression spec should skip silently via the placeholder guard

Related

🤖 Generated with Claude Code

…rkVersion (closes #2291)

The default rootBoxJsonPath resolved "../box.json" from Global.cfc's
directory (vendor/wheels/), pointing at vendor/box.json which does not
exist. At runtime boot via onapplicationstart.cfc — where the helper
is called with no arguments — this silently fell through to
"0.0.0-dev" even inside a wheels-dev/wheels checkout. Walking up two
levels reaches <repo-root>/box.json so application.wheels.version now
resolves to "<rootversion>-dev" as intended.

Adds a regression spec that asserts application.wheels.version at boot
(rather than invoking the helper directly), because WheelsTest.cfc
binds methods into each spec's scope which shifts GetCurrentTemplatePath()
and bypasses the code path we need to cover. The existing specs all
passed explicit path arguments, leaving the default-args computation
uncovered.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@bpamiri
bpamiri merged commit d84c681 into develop Apr 24, 2026
3 checks passed
@bpamiri
bpamiri deleted the claude/hardcore-bhaskara-efe216 branch April 24, 2026 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Verify that $readFrameworkVersion()'s default rootBoxJsonPath actually reaches the monorepo at runtime

1 participant