Skip to content

feat: add /version endpoint and --version CLI flag#248

Merged
mccutchen merged 6 commits intomainfrom
version
Apr 12, 2026
Merged

feat: add /version endpoint and --version CLI flag#248
mccutchen merged 6 commits intomainfrom
version

Conversation

@mccutchen
Copy link
Copy Markdown
Owner

In order not to suddenly reveal potentially sensitive information without users explicitly opting in, the /version endpoint will only name the service:

{
  "service": "go-httpbin"
}

But with --use-full-version/USE_FULL_VERSION=true set, it exposes more detailed info:

{
  "service": "go-httpbin",
  "version": "2.22.0-next",
  "commit": "6c58644",
  "build_date": "2026-04-11T15:50:03Z",
  "go_version": "go1.26.1"
}

Closes #191, #190, and #188.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 11, 2026

Codecov Report

❌ Patch coverage is 83.33333% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.72%. Comparing base (356a145) to head (9b31d96).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
httpbin/cmd/cmd.go 66.66% 3 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #248      +/-   ##
==========================================
+ Coverage   94.68%   94.72%   +0.04%     
==========================================
  Files          10        9       -1     
  Lines        1975     1991      +16     
==========================================
+ Hits         1870     1886      +16     
+ Misses         63       62       -1     
- Partials       42       43       +1     
Files with missing lines Coverage Δ
httpbin/handlers.go 98.30% <100.00%> (-0.34%) ⬇️
httpbin/httpbin.go 100.00% <100.00%> (ø)
httpbin/options.go 93.61% <100.00%> (+1.30%) ⬆️
httpbin/cmd/cmd.go 88.78% <66.66%> (-0.51%) ⬇️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mccutchen mccutchen enabled auto-merge (squash) April 12, 2026 02:28
@mccutchen mccutchen merged commit edb789c into main Apr 12, 2026
6 checks passed
@mccutchen mccutchen deleted the version branch April 12, 2026 02:29
@mloskot
Copy link
Copy Markdown
Contributor

mloskot commented Apr 13, 2026

Thank you!

@mccutchen
Copy link
Copy Markdown
Owner Author

@mloskot thank you for the push to get this added! Just note that in the final implementation you’ll need to deploy it with USE_FULL_VERSION=1/-use-full-version to get detailed version info

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.

2 participants