Repository navigation
fix: report the real version and commit in the binary - #436
Conversation
dgraph/ratel:v25.2.0 says "Ratel Version: 21.03.0" with an empty commit
ID, and so does every image before it. The Docker tag has always been
right; only the binary's own answer was wrong, which makes it useless for
working out what someone is running.
Three separate causes.
The Dockerfile ran build.prod.sh without --version, so the build fell back
to client/package.json, which has read 21.03.0 since 2021. The Makefile
already derives BUILD_VERSION from git describe for the image tag, so it
now passes the same value through --build-arg. A bare docker build with no
argument reports "dev" rather than a six-year-old number.
buildServer declared commitID and commitINFO locally. The comment said
they were "assigned in build script", and they are — as globals in
build.prod.sh — but `declare` inside a function creates an empty local that
shadows the global for the rest of the call, so both were compiled in
blank. Removing the two declarations lets the caller's values through.
go_bindata stays: it is only read by an error message in the same function.
With commitINFO no longer empty, a third fault became visible: the build
substitutes a sentinel for every space, because -ldflags splits its value
on whitespace, and nothing reversed it. The commit info printed as
"eb93c19¨•¨¨•¨Thu¨•¨Oct". It is now undone at print time.
Verified by building the image through make, as the CD workflow does:
before Ratel Version: 21.03.0
Commit ID:
after Ratel Version: v25.3.0
Commit ID: eb93c19
Commit Info: eb93c19 Thu Oct 1 16:01:35 2026 +0530 (tag: v25.3.0)
The image still serves HTTP 200, and the Help sidebar — which gets its
values from webpack at client build time and was already correct — is
unaffected.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (5)
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review. 📝 WalkthroughWalkthroughThe build now passes ChangesServer version information
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to The build uses its Git-derived version, and commit information is rendered readably. No actionable merge-blocking risk remains in the reviewed changes. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 3 files. (2 skipped: 2 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
dgraph/ratel:v25.2.0 says "Ratel Version: 21.03.0" with an empty commit ID, and so does every image before it. The Docker tag has always been right; only the binary's own answer was wrong, which makes it useless for working out what someone is running.
Three separate causes.
The Dockerfile ran build.prod.sh without --version, so the build fell back to client/package.json, which has read 21.03.0 since 2021. The Makefile already derives BUILD_VERSION from git describe for the image tag, so it now passes the same value through --build-arg. A bare docker build with no argument reports "dev" rather than a six-year-old number.
buildServer declared commitID and commitINFO locally. The comment said they were "assigned in build script", and they are — as globals in build.prod.sh — but
declareinside a function creates an empty local that shadows the global for the rest of the call, so both were compiled in blank. Removing the two declarations lets the caller's values through. go_bindata stays: it is only read by an error message in the same function.With commitINFO no longer empty, a third fault became visible: the build substitutes a sentinel for every space, because -ldflags splits its value on whitespace, and nothing reversed it. The commit info printed as "eb93c19¨•¨¨•¨Thu¨•¨Oct". It is now undone at print time.
Verified by building the image through make, as the CD workflow does:
before Ratel Version: 21.03.0
Commit ID:
after Ratel Version: v25.3.0
Commit ID: eb93c19
Commit Info: eb93c19 Thu Oct 1 16:01:35 2026 +0530 (tag: v25.3.0)
The image still serves HTTP 200, and the Help sidebar — which gets its values from webpack at client build time and was already correct — is unaffected.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by CodeRabbit
devwhen none is provided.