Skip to content

Versioning improvements - #17

Merged
ivpusic merged 3 commits into
mainfrom
versioning
Mar 6, 2026
Merged

ivpusic merged 3 commits into
mainfrom
versioning

Conversation

@ivpusic

@ivpusic ivpusic commented Mar 6, 2026

Copy link
Copy Markdown
Member

A couple versioning improvements for dune --version

@ivpusic
ivpusic requested a review from va3093 March 6, 2026 10:11
@cursor

cursor Bot commented Mar 6, 2026 •

Copy link
Copy Markdown

PR Summary

Low Risk
Low risk: changes are limited to CLI version metadata and build/install ldflags, with no impact on API calls or query execution logic.

Overview
Improves CLI versioning output. cmd/main.go now derives version, commit, and date from Go build info when ldflags aren’t provided (e.g. go install), and cli/root.go passes the formatted version string via fang.WithVersion.

Updates local build tooling. The makefile now injects version metadata via -ldflags for build and adds an install target; remaining diffs are formatting-only alignment/whitespace tweaks in command definitions.

Written by Cursor Bugbot for commit 6a28b67. Configure here.

@coderabbitai

coderabbitai Bot commented Mar 6, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 31ab253a-aa66-4e3a-aad4-46c969f14797

📥 Commits

Reviewing files that changed from the base of the PR and between 70a5fcb and 4747230.

📒 Files selected for processing (1)
  • makefile

📝 Walkthrough

Walkthrough

Adds build-time version embedding and runtime resolution: Makefile exposes VERSION/COMMIT/DATE ldflags, cmd/main.go reads build info to set version/commit/date at startup, and cli/root.go passes the resolved version into fang.Execute via fang.WithVersion.

Changes

Cohort / File(s) Summary
Build & Installer
makefile
Added VERSION, COMMIT, DATE variables and LDFLAGS; updated build rule and added install target to embed version metadata into binaries via -ldflags.
Runtime version resolution
cmd/main.go
Added build-info-based versioning: new resolveVersion() and setDefaults() functions to read module/build info (vcs.revision, vcs.time, module version) and populate version/commit/date before CLI runs.
CLI wiring
cli/root.go
Replaced direct rootCmd.Version assignment with local versionStr and now passes version through fang.WithVersion when executing the CLI.
Query command formatting
cmd/query/archive.go, cmd/query/get.go
Whitespace/formatting alignment in command initialization (Args and RunE) with no behavioral changes.
Minor cleanup
output/output.go
Removed trailing empty line; no logic change.

Sequence Diagram(s)

sequenceDiagram
    participant Make as Builder
    participant Bin as Binary
    participant BI as BuildInfo (embedded)
    participant CLI as fang/rootCmd
    Note over Make: Build with LDFLAGS (VERSION/COMMIT/DATE)
    Make->>Bin: produce binary (metadata embedded)
    Bin->>BI: embed module & vcs metadata
    Bin->>Bin: start (cmd/main)
    Bin->>BI: runtime/debug.ReadBuildInfo
    Bin->>Bin: resolveVersion() -> determine version, commit, date
    Bin->>CLI: fang.WithVersion(version) -> fang.Execute
    CLI->>CLI: run commands with provided version
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • va3093
  • norbertdurcansk
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 21.43% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Versioning improvements' accurately summarizes the main change in the changeset, which focuses on improving version handling across multiple files.
Description check ✅ Passed The description 'A couple versioning improvements for dune --version' is clearly related to the changeset, which implements versioning metadata and improves the version output command.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@makefile`:
- Around line 21-22: The install target currently runs go install on ./cmd which
produces a binary named after the path (cmd) rather than dune-cli; change the
install target to build the binary with an explicit output name (matching the
dune-cli target) and keep the same LDFLAGS so the produced artifact is named
dune-cli and not cmd, i.e., replace the go install invocation inside the install
target with a go build invocation that uses $(LDFLAGS), -o dune-cli and ./cmd.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1a853899-42a9-49ac-90ac-bda444c17e79

📥 Commits

Reviewing files that changed from the base of the PR and between 92ffb50 and 6a28b67.

📒 Files selected for processing (13)
  • cli/root.go
  • cmd/dataset/search.go
  • cmd/docs/search.go
  • cmd/main.go
  • cmd/query/archive.go
  • cmd/query/create.go
  • cmd/query/get.go
  • cmd/query/run.go
  • cmd/query/run_sql.go
  • cmd/query/update.go
  • cmd/usage/usage.go
  • makefile
  • output/output.go
💤 Files with no reviewable changes (1)
  • output/output.go

Comment thread makefile Resolved
@ivpusic
ivpusic merged commit 2aa5214 into main Mar 6, 2026
2 checks passed
@ivpusic
ivpusic deleted the versioning branch March 6, 2026 11:43
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.

2 participants