Skip to content

Include Git info in GetFirmwareInfo's version - #86

Open
puddly wants to merge 3 commits into
devfrom
puddly/git-version
Open

puddly wants to merge 3 commits into
devfrom
puddly/git-version

Conversation

@puddly

@puddly puddly commented Nov 4, 2026

Copy link
Copy Markdown
Member

For example, ziggurat/0.1.0+0490795-dirty.

Copilot AI balanced review requested due to automatic review settings November 4, 2026 23:54

Copilot AI 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.

🟡 Changes recommended

The build script fails outside Git checkouts unless an override is supplied, and unstaged source edits can leave cached version metadata incorrectly reporting a clean build.

2 open issues
What changed in this PR

Adds Git revision information to the version reported by GetFirmwareInfo, sharing one version string between the host server and embedded firmware.

Changes:

  • Generates Git version metadata at build time, with an environment-variable override.
  • Defines a shared version string using the workspace package version and Git metadata.
  • Updates both request handlers to return the shared string.
File Description
crates/​ziggurat-server/​src/​main.rs Returns the shared version in host firmware-info responses.
crates/​ziggurat-protocol/​src/​lib.rs Exposes the combined package and Git version string.
crates/​ziggurat-protocol/​Cargo.toml Inherits the package version from the workspace.
crates/​ziggurat-protocol/​build.rs Obtains Git metadata and configures build-script rerun triggers.
crates/​ziggurat-ncp-api/​src/​protocol.rs Returns the shared version in embedded firmware-info responses.

Review effort: Balanced

Comment thread crates/ziggurat-protocol/build.rs Outdated
Comment on lines +4 to +5
let output = Command::new("git").args(args).output().unwrap();
assert!(output.status.success(), "git {args:?} failed");
Comment thread crates/ziggurat-protocol/build.rs Outdated
Comment on lines +18 to +19
// An edit that is not staged does not re-run this script.
for path in ["HEAD", "logs/HEAD", "index"] {
@zigpy-review-bot zigpy-review-bot added the new feature Adds new feature label Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new feature Adds new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants