fix(cli): support --version and -V - #579
Conversation
Session-Id: 01a0d4c3-fc7d-7882-9e9e-342059219272
|
Warning Review limit reachedNext included review available in 33 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (5)
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 |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
| export function packageVersion(): string { | ||
| try { | ||
| const manifest: unknown = JSON.parse( | ||
| readFileSync(new URL('../package.json', import.meta.url), 'utf8'), |
There was a problem hiding this comment.
🟡 Standalone executable reports placeholder version
For Bun-compiled flows, packageVersion() cannot find the SDK manifest beside its bundled module. Both version flags print 0.0.0 instead of the release version.
Learn more
The standalone build imports runCli into a temporary entrypoint, then compiles that entrypoint as a single executable. The compiled module does not have the SDK package manifest at the relative URL used by packageVersion(). The failed read reaches the placeholder fallback, so the new flags report 0.0.0 in standalone artifacts even though the installed Node CLI reports the correct version. The release workflow builds standalone binaries for both supported platforms.
Example: Compile the standalone executable into packages/runtime-linux-x64/bin/flows and invoke flows --version. The SDK package version is 2.0.31, but the manifest read fails and stdout contains 0.0.0.
Recommended fix: Embed the SDK version at standalone build time and pass it to runCli for version output, while retaining the manifest read for source and Node-installed packages. Add an assertion for both version flags against a built standalone executable.
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
Fixed in 5413fba. The standalone builder now reads packages/sdk/package.json at build time and passes the embedded version to runCli. Added bin.test.ts coverage that compiles the standalone executable and asserts both --version and -V return 2.0.31 with rc 0 and empty stderr. The Linux artifact CI is green on this head.
Session-Id: 01a0d4c3-fc7d-7882-9e9e-342059219272
|
Addressed Devin review in 5413fba. The Bun standalone build now embeds the SDK manifest version into runCli, so the self-contained executable reports 2.0.31 rather than falling back to 0.0.0. Added compiled-standalone regression tests for --version and -V; focused gate now reports 91/91 passing. |
Summary
flows --versionandflows -Vin the SDK CLI.@relayflows/sdk/package.jsonversion at runtime for Node/npm artifacts.Verification
Focused gate:
Installed npm artifact smoke:
Compiled standalone smoke:
The repository's full SDK gate was also run before the standalone follow-up:
Those failures are environment/runtime fixture failures (missing built Surface fixture, missing local
kernel/target/debug/relayflowd, Bun 1.4.2 vs the test's 1.4.0 pin, and missing live daemon connection); the focused CLI/surface/standalone tests pass.