fix: activate defaulted to a build target platform, and errors printed as {} - #79
Merged
Merged
Conversation
…d as {}
Two real bugs surfaced by testing unity-activate's thin-wrapper PR against
this repo's freshly-merged activate command:
- ActivateCommand inherited UnityOptions' build-oriented targetPlatform
default (StandaloneWindows64), so a bare `game-ci activate <path>` -
exactly what the thin wrapper calls - threw "Windows-based builds are
only supported on 2019.3.X+" for any older Unity version, even though
activation doesn't build anything. Defaults to NoTarget instead, which
RunnerImageTag already maps to the generic image and skips build-target
validation entirely. Explicit --target-platform still works.
- log.error()'s JSON.stringify fallback silently produces '{}' for any
bare Error, since message/stack/name are non-enumerable own properties.
This was masking the actual error above and likely every other uncaught
failure in the CLI. Error objects are now special-cased to print their
stack.
|
Important Review available on request
Reviews should be triggered manually for repositories with fewer than 10 stars. Select Trigger review above or comment ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
frostebite
added a commit
that referenced
this pull request
Aug 14, 2026
…or-logging fixes (#80) * fix: activate defaulted to a build target platform, and errors printed as {} Two real bugs surfaced by testing unity-activate's thin-wrapper PR against this repo's freshly-merged activate command: - ActivateCommand inherited UnityOptions' build-oriented targetPlatform default (StandaloneWindows64), so a bare `game-ci activate <path>` - exactly what the thin wrapper calls - threw "Windows-based builds are only supported on 2019.3.X+" for any older Unity version, even though activation doesn't build anything. Defaults to NoTarget instead, which RunnerImageTag already maps to the generic image and skips build-target validation entirely. Explicit --target-platform still works. - log.error()'s JSON.stringify fallback silently produces '{}' for any bare Error, since message/stack/name are non-enumerable own properties. This was masking the actual error above and likely every other uncaught failure in the CLI. Error objects are now special-cased to print their stack. * chore: bump version to 0.1.4 for the activate target-platform and error-logging fixes (#79)
frostebite
added a commit
that referenced
this pull request
Aug 14, 2026
…#82) RunnerImageTag mapped both NoTarget and the internal 'Test' targetPlatform to the same empty suffix, producing tags like "ubuntu-2019.2.17f1-3" - unityci/editor always has a module suffix (base/webgl/android/etc.), so this is never a real image. `docker pull` failed with "manifest unknown" on every version. Surfaced by unity-activate#111's thin-wrapper CI: `game-ci activate` defaults targetPlatform to NoTarget (#79) and hit this on every job. 'base' is the same image StandaloneLinux64 (pre-il2cpp) already resolves to - the right choice for "just an editor, no specific build target". Split into its own noTarget suffix rather than reusing generic, since 'Test' also used generic and doesn't pull real images - no reason to touch its behavior.
This was referenced Aug 14, 2026
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.
Found and fixed while investigating why unity-activate#111's thin-wrapper CI was failing on every job.
Two real bugs
1.
activateinherited a build-orientedtargetPlatformdefault.ActivateCommand.configureOptions()callsUnityOptions.configure(), which defaultstargetPlatformtoStandaloneWindows64— a sensible default forbuild, meaningless foractivate(which doesn't build anything, just needs an editor image to run activation inside). A baregame-ci activate <path>— exactly what unity-activate's thin wrapper calls, with no--target-platformflag — hitRunnerImageTag's Windows/il2cpp version gate and threw:...for any older Unity version, on every host.
NoTargetalready exists and maps to the generic image, skipping that check entirely — it's whatunity-engine-core's extracted activate logic uses for exactly this case.activatenow defaults to it; an explicit--target-platformstill overrides.2.
log.error()printed[ERROR] {}for any bareError.This is what made bug #1 nearly impossible to see from CI logs.
inspect()'s fallback for non-string values isJSON.stringify(value)— butError'smessage/stack/nameare non-enumerable own properties, soJSON.stringify(new Error('anything'))is always'{}'. Every uncaught error in the CLI — not just this one — was printing as a useless empty object.Errorinstances are now special-cased to print their stack.How I found it
Reproduced locally:
bun run src/index.ts activate <path-to-a-fake-2019.2.14f1-project>on a fresh git repo reproduced the exact[ERROR] {}from CI. Fixing bug #2 first turned that into the real message (bug #1), which then explained every failing job in unity-activate#111 (all older Unity versions — the "Tests" job, which doesn't shell out to a real Unity version, was the only one that passed).Testing
activate-command.test.ts—configureOptions()defaultstargetPlatformtoNoTarget, and still honors an explicit--target-platform.logger/index.test.ts—log.error(new Error(...))prints the message, not{}.bun run test— 147 pass, 3 skip, 0 fail (144 pass, 3 skip before this PR — 3 new tests, no regressions).activatenow reaches the realdocker runinvocation (fails only because Docker isn't installed in my sandbox, which is expected).🤖 Generated with Claude Code