fix(config): walk up two levels for monorepo box.json in $readFrameworkVersion - #2293
Merged
Conversation
…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>
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()'s defaultrootBoxJsonPathwalked up only one level fromGlobal.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 viaonapplicationstart.cfc(called with no args), this causedapplication.wheels.versionto silently resolve to"0.0.0-dev"inside a wheels-dev/wheels checkout. One-character fix plus a regression spec.frameworkVersionSpec.cfcthat asserts the runtime boot result (application.wheels.version) rather than invoking the helper directly, becauseWheelsTest.cfcbinds methods into each spec's scope — which shiftsGetCurrentTemplatePath()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
application.wheels.version="0.0.0-dev"— bug confirmed against a fresh checkout bootapplication.wheels.version="4.0.0-dev"— matches<repo-root>/box.jsonversion +-devsuffixbash tools/test-local.sh): 3328 pass / 0 fail / 0 error (was 3327; the new spec accounts for the delta)Expected [4.0.0-dev] but received [0.0.0-dev]— confirms the test actually catches the bug rather than skipping silentlyTest plan
application.wheels.versionresolves to4.0.0-devat runtime after the fix@build.version@is substituted): regression spec should skip silently via the placeholder guardRelated
🤖 Generated with Claude Code