What changed, and why it matters
This commit fixes a bug in how SeedSigner determines and reports its software version. Previously, the version was set once and could be left blank or stale in certain build situations. The patch makes version detection more reliable by trying multiple sources: an environment variable, the current Git branch, the latest Git tag, and finally the short commit hash. There is no direct evidence this is a security fix, but reliable version reporting helps users and developers confirm they are running the expected software.
Treat as a routine bugfix. Review whether version strings are displayed or logged correctly after this change, and verify that downstream build/packaging scripts do not depend on the old Version.get_version() initialization behavior.
Security signals we found
No direct security signals in diff (no memory safety, crypto, authentication, or authorization changes)
Change improves build-time version provenance, which indirectly supports supply-chain/traceability assurance
Evidence from the diff
The change is in src/seedsigner/helpers/version.py. It removes the unconditional initialization of version_info with Version.get_version() and instead builds version_info incrementally. It first attempts to read SEEDSIGNER_VERSION_NAME, then falls back to git branch –show-current, then git describe –tags –abbrev=0, and finally git rev-parse –short HEAD, raising an exception if all fail. This prevents the version_name from being empty or incorrectly derived in detached-HEAD/tag-only build environments.
Changed components
src/seedsigner/helpers/version.pyInspect captured patch +15 / −8
diff --git a/src/seedsigner/helpers/version.py b/src/seedsigner/helpers/version.py
index e7b5880..0f1b356 100644
--- a/src/seedsigner/helpers/version.py
+++ b/src/seedsigner/helpers/version.py
@@ -200,7 +200,7 @@ if __name__ == "__main__":
Uses the last git commit time (via `git log`) as the last edit time.
"""
- version_info = dict(version=Version.get_version())
+ version_info = dict()
# Run `git log` in the shell to get the last commit time
try:
@@ -211,18 +211,25 @@ if __name__ == "__main__":
raise Exception("Could not get last commit time from git log.") from e
try:
- version_name = None
-
# If we're currently building SeedSigner OS, check the env var
version_name = os.getenv("SEEDSIGNER_VERSION_NAME")
- print(f"SEEDSIGNER_VERSION_NAME={version_name}")
if not version_name:
version_name = os.popen("git branch --show-current").read().strip()
- if not version_name:
- # If we're on a tag, there won't be a current branch. Instead, try to get the
- # current tag.
- version_name = os.popen("git describe --tags --abbrev=0").read().strip()
+
+ if not version_name:
+ # If we're on a tag, there won't be a current branch. Instead, try to get the
+ # current tag.
+ version_name = os.popen("git describe --tags --abbrev=0").read().strip()
+
+ if not version_name:
+ # Fallback to commit hash
+ version_name = os.popen("git rev-parse --short HEAD").read().strip()
+
+ if not version_name:
+ raise Exception("No git info found for version name.")
+
+ version_info["version"] = version_name
except Exception as e:
raise Exception("Could not get version name from SeedSigner OS env var nor git.") from e
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.