Skip to content

Conversation

@FletcherMan
Copy link
Collaborator

@FletcherMan FletcherMan commented Dec 17, 2025

Description

Add  `version` subcommand to display build information.

Usage

morphnode version

Output

morphnode v0.4.7
Git Commit: abc1234
Build Time: 2024-12-17T10:00:00Z
Go Version: go1.24.0
OS/Arch:    linux/amd64

Changes

  • Add version.go with version command
  • Update Makefile to inject version info via ldflags

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

* **New Features**
  * Added a version command that displays the application version, Git commit hash, build time, Go runtime version, and system architecture information.

<sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub>

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

@FletcherMan FletcherMan requested a review from a team as a code owner December 17, 2025 05:32
@FletcherMan FletcherMan requested review from r3aker86 and removed request for a team December 17, 2025 05:32
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 17, 2025

Walkthrough

This change adds a version CLI command to the application that displays build metadata (version, Git commit, build time, Go runtime, OS/Architecture). The Makefile is updated to capture version information during build and inject it into the binary via linker flags.

Changes

Cohort / File(s) Change Summary
Build configuration
node/Makefile
Updated Git revision capture to use --short flag; introduced VERSION and BUILD_TIME variables; added linker flags to embed version metadata (Version, GitCommit, BuildTime) into the binary.
Version command implementation
node/cmd/node/version.go
New file defining three exported string variables (Version, GitCommit, BuildTime) and a versionCmd CLI command that prints application metadata including version, commit hash, build time, Go runtime version, and OS/Architecture.
CLI integration
node/cmd/node/main.go
Registered versionCmd into the app.Commands list alongside the existing keyConverterCmd.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify the Makefile linker flag syntax and variable interpolation are correct (VERSION and BUILD_TIME injection pattern)
  • Confirm version.go follows the existing urfave/cli command pattern used in the codebase
  • Validate that the versionCmd correctly integrates into app.Commands without breaking existing functionality

Poem

🐰 A version command hops into view,
Displaying build metadata fresh and true—
Git commits and timestamps align,
Runtime details in every line.
The app now wears its credentials with pride! 🎉

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and specifically describes the main change: adding a version subcommand to the morphnode application.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch add_node_version

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 27e80af and 43136fc.

📒 Files selected for processing (3)
  • node/Makefile (1 hunks)
  • node/cmd/node/main.go (1 hunks)
  • node/cmd/node/version.go (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
  • GitHub Check: test
  • GitHub Check: test
  • GitHub Check: check
  • GitHub Check: check
  • GitHub Check: test
  • GitHub Check: Analyze (rust)
  • GitHub Check: Analyze (go)
🔇 Additional comments (6)
node/cmd/node/version.go (2)

10-15: LGTM!

The exported variables with sensible default values are correctly structured for ldflags injection during build.


17-29: LGTM!

The version command implementation is clean and correctly displays all the required build information. The output format matches the PR objectives, and the use of runtime package for Go version and OS/Arch information is appropriate.

node/cmd/node/main.go (1)

44-44: LGTM!

The version command is correctly integrated into the CLI application's command list.

node/Makefile (3)

1-1: LGTM!

Using --short for the Git commit hash is appropriate and produces more concise output for the version command.


3-4: LGTM!

The VERSION and BUILD_TIME variables are correctly defined. The VERSION fallback to "dev" matches the default value in version.go, and the ISO 8601 timestamp format is standard and appropriate.


8-9: LGTM!

The linker flags correctly inject the VERSION and BUILD_TIME variables into the corresponding main.Version and main.BuildTime variables in the binary.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@FletcherMan FletcherMan merged commit 18b49b2 into main Dec 17, 2025
13 checks passed
@FletcherMan FletcherMan deleted the add_node_version branch December 17, 2025 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants