Show app version in UI with Forgejo update check #28
No reviewers
Labels
No labels
area:ai
area:ci-cd
area:notifications
area:observability
area:public-pages
backlog
bug
duplicate
enhancement
help wanted
invalid
question
type:decision
type:feature
type:infra
type:maintenance
type:security
v1.0.1
v1.1.0
v1.2.0
v1.3.0
v2.0.0
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
rbrooks/WeatherBot!28
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/app-version"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Implements #27.
What
app/services/app_version.py::get_version()readsWEATHERBOT_VERSION, stamped into the image at build time from the release tag (DockerfileAPP_VERSIONbuild arg); falls back todev.app/main.pynow feeds FastAPI'sversion=and a Jinjaapp_versionglobal from it (replacing the hard-coded"1.0.0").get_update_status()compares the running version to the latest Forgejo release (/api/v1/repos/rbrooks/WeatherBot/releases/latest). Cached 1h (5m on error), non-blocking, fail-soft.GET /api/version); the diagnostics page gains a Version panel with current/latest/status.APP_VERSIONbuild arg →WEATHERBOT_VERSIONenv in the Dockerfile anddocker-compose.yml; added a.dockerignore(keeps.git/.env/tests/caches out of the image and shrinks the context).forgejo_base_url,update_check_repo,update_check_enabled.Validation (dev server)
tests/test_app_version.py: 10 passed (version parse/compare, update-status caching, error handling, disabled mode,/api/versionendpoint).Notes / decisions
releases/latestalready excludes drafts/prereleases).devunless the build passesAPP_VERSION— the CD work (#12) will set it from the tag; for manual builds useAPP_VERSION=$(git describe --tags) docker compose build app.Closes #27