Skip to content

feat: added goreleaser and versioning strategy#25

Merged
SantiagoDePolonia merged 1 commit intomainfrom
feature/goreleaser
Jan 3, 2026
Merged

feat: added goreleaser and versioning strategy#25
SantiagoDePolonia merged 1 commit intomainfrom
feature/goreleaser

Conversation

@SantiagoDePolonia
Copy link
Copy Markdown
Contributor

@SantiagoDePolonia SantiagoDePolonia commented Dec 28, 2025

Summary by CodeRabbit

Release Notes

  • New Features

    • Added --version flag to display application version, commit, and build date information
  • Chores

    • Implemented automated release pipeline triggered by version tags
    • Multi-platform binary distributions now available for Linux, Windows, and macOS (amd64 and arm64 architectures)
    • Enhanced build infrastructure with expanded testing and linting capabilities

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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Dec 28, 2025

📝 Walkthrough

Walkthrough

This PR introduces release automation and version tracking capabilities. It adds a GitHub Actions workflow triggered by git tags, includes a GoReleaser configuration for building multi-platform binaries, enhances the Makefile with versioning metadata injection and new test/lint targets, adds a CLI --version flag, and creates a new internal version package to manage and display build metadata.

Changes

Cohort / File(s) Summary
CI/CD & Release Configuration
.github/workflows/release.yml, .goreleaser.yaml
New GitHub Actions workflow automates releases on git tag pushes (v*). Configures GoReleaser to build multi-platform binaries (Linux/Windows/macOS, amd64/arm64) with version metadata injection via ldflags, generates checksums, and produces tar.gz archives.
Build System
Makefile
Introduces VERSION, COMMIT, and DATE variables for build-time metadata injection. Replaces build target to use ldflags. Adds convenience targets: clean, tidy, test, test-e2e, test-all, lint, and lint-fix.
Application Code
cmd/gomodel/main.go, internal/version/version.go
Adds --version CLI flag and startup version logging. New internal/version package exports Version, Commit, Date variables and Info() function for formatted version output with Go runtime version.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 A tag is pushed, the workflow springs to life,
GoReleaser builds with purpose, free of strife,
Version whispers through the binary's soul,
From tag to release, automation's goal! 🚀✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: introduction of GoReleaser automation and versioning metadata injection throughout the codebase.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ 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 feature/goreleaser

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

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d63cae8 and c92ebed.

📒 Files selected for processing (5)
  • .github/workflows/release.yml
  • .goreleaser.yaml
  • Makefile
  • cmd/gomodel/main.go
  • internal/version/version.go
🧰 Additional context used
📓 Path-based instructions (1)
cmd/gomodel/main.go

📄 CodeRabbit inference engine (CLAUDE.md)

Provider packages must be imported in cmd/gomodel/main.go using blank imports (_ "gomodel/internal/providers/{name}")

Files:

  • cmd/gomodel/main.go
🧠 Learnings (2)
📚 Learning: 2025-12-26T16:40:36.115Z
Learnt from: CR
Repo: ENTERPILOT/GOModel PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-26T16:40:36.115Z
Learning: Applies to internal/cache/**/*.go : Cache structure must include Version, UpdatedAt timestamp, and Models map with modelID as key mapping to CachedModel info

Applied to files:

  • .goreleaser.yaml
  • Makefile
  • cmd/gomodel/main.go
📚 Learning: 2025-12-26T16:40:36.115Z
Learnt from: CR
Repo: ENTERPILOT/GOModel PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-26T16:40:36.115Z
Learning: Applies to internal/cache/**/*.go : Model registry must support both local file cache and Redis cache backends for instant startup and multi-instance deployments

Applied to files:

  • cmd/gomodel/main.go
🧬 Code graph analysis (1)
cmd/gomodel/main.go (1)
internal/version/version.go (4)
  • Info (16-18)
  • Version (10-10)
  • Commit (11-11)
  • Date (12-12)
🔇 Additional comments (6)
internal/version/version.go (1)

1-18: LGTM! Standard version injection pattern implemented correctly.

The version package follows best practices for build-time metadata injection:

  • Exported variables with sensible defaults for development builds
  • Info() function provides a well-formatted version string including Go runtime version
  • Ready for ldflags injection from build tools
cmd/gomodel/main.go (2)

75-82: LGTM! Version flag handling is correctly positioned.

The version flag check is appropriately placed before other initialization, enabling fast exit when users run gomodel --version or gomodel -version.


88-93: LGTM! Version logging aids troubleshooting.

Logging version metadata (version, commit, build_date) at startup using structured logging is a best practice that helps with debugging and tracking deployed versions.

.github/workflows/release.yml (1)

1-32: LGTM! Standard release automation workflow.

The workflow correctly implements automated releases:

  • Triggered by semver tags (v*)
  • Required permissions and full git history for changelog generation
  • Current action versions (checkout@v4, setup-go@v5, goreleaser-action@v6)
  • Standard goreleaser invocation with --clean flag
Makefile (2)

3-11: LGTM! Robust version metadata extraction.

The version info extraction follows best practices:

  • git describe --tags --always --dirty provides comprehensive version info with fallback
  • Short commit hash from git rev-parse
  • UTC timestamps in ISO 8601 format
  • ?= operator allows environment variable overrides for CI/CD flexibility

The LDFLAGS construction correctly injects metadata into gomodel/internal/version.* variables.


19-45: LGTM! Comprehensive development and testing targets.

The new Makefile targets enhance the development workflow:

  • clean: removes build artifacts
  • tidy: maintains clean dependencies
  • test/test-e2e/test-all: structured testing approach
  • lint/lint-fix: code quality enforcement including e2e tests

All targets follow Makefile conventions and use appropriate flags.

@SantiagoDePolonia SantiagoDePolonia merged commit e7184b7 into main Jan 3, 2026
7 checks passed
@SantiagoDePolonia SantiagoDePolonia deleted the feature/goreleaser branch March 22, 2026 14:23
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.

1 participant