[Backport v1.28] [codex] Use reachable git tag for build version#3119
Merged
Conversation
* Use reachable git tag for build version * Use short SHA for untagged build version (cherry picked from commit 7656117)
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## v1.28 #3119 +/- ##
=======================================
Coverage 43.64% 43.64%
=======================================
Files 350 350
Lines 30097 30097
=======================================
Hits 13135 13135
Misses 16090 16090
Partials 872 872
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
|
🎯 Code Coverage (details) 🔗 Commit SHA: daaff3c | Docs | Datadog PR Page | Give us feedback! |
tbavelier
approved these changes
Jun 9, 2026
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.
Backport 7656117 from #3115.
What changed
Update the Makefile version discovery used by build ldflags so the default embedded operator version only uses an explicit release tag when
HEADis exactly on that tag. Untagged builds now fall back to the current short commit SHA.Why
The previous default selected the highest version tag present in the local clone:
That made CI sensitive to unrelated fetched tags. A v1.27 release-branch image build could embed
v1.28.0-rc.1if that tag existed in the checkout, even though the image was built from the correct v1.27 commit.Impact
v1.27.1-rc.1.main, release branches, or custom branches embed only the short SHA.make VERSION=...usage still takes precedence, preserving the bundle/release workflow.Validation
make -n docker-build-push-ci GOARCH=amd64 IMG=test/operator:testmake -n VERSION=1.27.1-rc.1 LATEST_VERSION=1.27.0 bundle