Skip to content

Log git commit hash in startup EventItem#212

Open
neoneye wants to merge 3 commits intomainfrom
feature/startup-commit-hash
Open

Log git commit hash in startup EventItem#212
neoneye wants to merge 3 commits intomainfrom
feature/startup-commit-hash

Conversation

@neoneye
Copy link
Member

@neoneye neoneye commented Mar 8, 2026

Summary

  • When frontend_multi_user starts, the "Flask app started" EventItem now includes the short git commit hash in both the message (e.g. Flask app started (commit 8f72795)) and the event context (commit_hash field).
  • This makes it easy to see which exact version is deployed and rollback to that commit if needed.

Test plan

  • Start frontend_multi_user and verify the startup EventItem in the admin panel shows the commit hash
  • Verify that when git is unavailable (e.g. in a non-git deploy), the hash gracefully falls back to "unknown"

🤖 Generated with Claude Code

neoneye and others added 3 commits March 8, 2026 19:23
When frontend_multi_user starts, the "Flask app started" EventItem now
includes the short git commit hash in both the message and context,
making it easy to identify which version is running and rollback if needed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The container has no .git directory, so the runtime git fallback always
returned "unknown". Now the hash is passed as a Docker build arg
(GIT_COMMIT_HASH) and baked into the PLANEXE_GIT_COMMIT_HASH env var.
The Python code checks this env var first before falling back to git.

Usage: GIT_COMMIT_HASH=$(git rev-parse --short HEAD) docker compose build

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Railway auto-injects RAILWAY_GIT_COMMIT_SHA for GitHub-triggered deploys.
The Dockerfile now accepts it and prefers it over the manual GIT_COMMIT_HASH
arg, so the commit hash works on Railway with zero configuration.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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