feat: show git commit hash alongside the version

This commit is contained in:
imSp4rky
2026-07-30 13:44:07 -06:00
parent 42d7fd8303
commit 72b8ab7027
7 changed files with 97 additions and 6 deletions
+8 -2
View File
@@ -8,7 +8,7 @@ import click
from aiohttp import web
from aiohttp_swagger3 import SwaggerDocs, SwaggerInfo, SwaggerUiSettings
from unshackle.core import __version__
from unshackle.core import __commit__, __version__
from unshackle.core.api.errors import APIError, APIErrorCode, build_error_response, handle_api_exception
from unshackle.core.api.handlers import (
cancel_download_job_handler,
@@ -105,6 +105,10 @@ async def health(request: web.Request) -> web.Response:
version:
type: string
example: "2.0.0"
commit:
type: string
nullable: true
example: "a24c9b9"
update_check:
type: object
properties:
@@ -128,7 +132,9 @@ async def health(request: web.Request) -> web.Response:
log.warning(f"Failed to check for updates: {e}")
update_info = {"update_available": None, "current_version": __version__, "latest_version": None}
return web.json_response({"status": "ok", "version": __version__, "update_check": update_info})
return web.json_response(
{"status": "ok", "version": __version__, "commit": __commit__ or None, "update_check": update_info}
)
@api_handler