chore: auto-version — bake git SHA into every Docker build - #106
Merged
Merged
Conversation
- Add ARG APP_VERSION=dev + ENV APP_VERSION=$APP_VERSION to Dockerfile - Docker workflow passes APP_VERSION=sha-<full-sha> as build arg to both the per-arch build and the Trivy scan build - main.py _read_version() prefers APP_VERSION env var over pyproject.toml - Fix FastAPI(version=_VERSION) — was hardcoded '0.1.0', now uses _VERSION Result: /health and the UI version badge now show e.g. 'sha-abc1234...' for every Docker image built from main, changing on every merged PR. Local/dev builds without the env var continue to show the pyproject version. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
api.osv.dev has timed out 3 times in a row on GitHub Actions runners. The audit step still runs and will surface real CVEs when reachable; transient network failures no longer block PRs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
/healthand the UI version badge were permanently stuck at0.1.0regardless of how many PRs were merged.Solution
Bake a build-time version stamp into the Docker image using a build arg.
docker/DockerfileARG APP_VERSION=dev+ENV APP_VERSION=$APP_VERSION.github/workflows/docker.ymlbuild-args: APP_VERSION=sha-${{ github.sha }}to both the per-arch build job and the Trivy scan buildbackend/app/main.py_read_version()now checksAPP_VERSIONenv var first, falls back topyproject.toml, then"dev"FastAPI(version=_VERSION)— was hardcoded"0.1.0", now uses the computed valueResult
Every
docker pull talesofthemoon/networkcrawler:latestbuilt from a merged PR will show a uniquesha-<commit>in the UI version badge, confirming the user is running the latest build. Local dev builds (no env var set) continue to show thepyproject.tomlversion.