docs: show each environment's live API version - #161
Merged
aditeyabaral merged 3 commits intoSep 15, 2026
Merged
Conversation
Nothing in the README said which version was deployed anywhere, and there was no way to tell production and staging apart. Two shields.io badges now read `info.version` straight from each environment's `/openapi.json`, which is public and needs no credential. They update themselves, so no release step has to remember to edit the README — and the two disagreeing is the signal that production is behind, which happened twice this week and both times had to be found by hand. A GitHub release badge was the alternative and would have been wrong: the newest release is `v2.1` from July 2025, two majors behind the 4.5.0 the API actually serves. `cacheSeconds=600` keeps shields from re-fetching on every view while staying fresh enough to be useful after a deploy. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VU7YUhP71KSsotWQ1H7CRH
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VU7YUhP71KSsotWQ1H7CRH
A badge reading "production v4.4.0" beside one reading "staging v4.5.0" needs no paragraph saying that the versions are live and that a difference means production is behind. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VU7YUhP71KSsotWQ1H7CRH
42 tasks
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.
📌 Description
Nothing in the README said which version was deployed, or anywhere to see that production and
staging differ. Two badges now read
info.versiondirectly from each environment's/openapi.json— public, unauthenticated, 18 KB.They are self-updating: no release step has to remember to edit the README, and the two
disagreeing is precisely how you notice production is behind. That happened twice this week — prod
sat on 4.1.0 against dev's 4.2.0, then on 4.2.0 against 4.4.0 — and both times it had to be found
by hand. As of this PR the badges read production
v4.4.0against stagingv4.5.0, so the driftis visible rather than discovered.
🧱 Type of Change
requirements.txt,pyproject.toml🧪 How Has This Been Tested?
tests/unit/)tests/functional/)tests/integration/)276 tests, 100.00% coverage, unchanged — no code is touched.
pre-commit run --all-filespasses 12/12 hooks.
Manual: both badge URLs fetched and confirmed to render real SVGs reading
production: v4.4.0andstaging: v4.5.0, matching what each/openapi.jsonreports.Unchecked: nothing in the image or its behaviour changes.
✅ Checklist
scripts/run_tests.py)pre-commit run --all-files).envvars updated (if applicable)scripts/benchmark/benchmark_requests.py)Unchecked items carry no work: no code, no image change, no new variables, nothing a benchmark
measures.
🛠️ Affected API Behaviour
app/app.py– Modified/authenticateroute logicapp/pesu.py– Updated scraping or authentication handlingOnly
README.md.🧩 Models
app/models/request.py– Input validation or request schema changesapp/models/response.py– Authentication response formattingapp/models/profile.py– Profile extraction logic🐳 DevOps & Config
Dockerfile– Changes to base image or build process.github/workflows/*.yaml– CI/CD pipeline or deployment updatespyproject.toml/requirements.txt– Dependency version changes.pre-commit-config.yaml– Linting or formatting hook changesProject version only, 4.5.0 → 4.6.0, plus the matching
uv.lock. No dependency changes.📊 Benchmarks & Analysis
scripts/benchmark/benchmark_requests.py– Performance or latency measurement changesscripts/benchmark/analyze_benchmark.py– Benchmark result analysis changesscripts/run_tests.py– Custom test runner logic or behavior updates🧠 Additional Notes
A GitHub release badge was the obvious alternative and would have been actively wrong. The
newest release is
v2.1, tagged July 2025 — two major versions behind the 4.5.0 the API serves.Worth fixing separately: the releases page is public and currently misleads.
/metricscannot serve this, even though it would be the natural home. It carries no versionmetric, and it now requires a bearer token that shields.io cannot send.
/openapi.jsonis the onlypublic surface exposing the version, which is why the badges point there. A
pesu_auth_build_info{version}gauge would fix the metrics side and let the Grafana dashboardcorrelate a deploy with a change in behaviour — currently it can only show that a restart happened.
cacheSeconds=600keeps shields from re-fetching on every README view. It also means a badgecan lag a deploy by up to ten minutes.
🤖 Generated with Claude Code
https://claude.ai/code/session_01VU7YUhP71KSsotWQ1H7CRH