Skip to content

[codex] Use reachable git tag for build version#3115

Merged
tbavelier merged 2 commits into
mainfrom
tbavelier/use-reachable-version-tag
Jun 9, 2026
Merged

[codex] Use reachable git tag for build version#3115
tbavelier merged 2 commits into
mainfrom
tbavelier/use-reachable-version-tag

Conversation

@tbavelier

@tbavelier tbavelier commented Jun 9, 2026

Copy link
Copy Markdown
Member

What changed

Update the Makefile version discovery used by build ldflags so the default embedded operator version only uses an explicit release tag when HEAD is 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:

git tag | sort -V | tail -1

That made CI sensitive to unrelated fetched tags. A v1.27 release-branch image build could embed v1.28.0-rc.1 if that tag existed in the checkout, even though the image was built from the correct v1.27 commit.

Impact

  • Tagged release builds embed the exact release tag, for example v1.27.1-rc.1.
  • Untagged builds from main, release branches, or custom branches embed only the short SHA.
  • Explicit make VERSION=... usage still takes precedence, preserving the bundle/release workflow.

Validation

  • make -n docker-build-push-ci GOARCH=amd64 IMG=test/operator:test
  • make -n VERSION=1.27.1-rc.1 LATEST_VERSION=1.27.0 bundle

@datadog-prod-us1-3

This comment has been minimized.

@tbavelier
tbavelier marked this pull request as ready for review June 9, 2026 12:51
@tbavelier
tbavelier requested a review from a team June 9, 2026 12:51
@codecov-commenter

codecov-commenter commented Jun 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 43.48%. Comparing base (34b1fdb) to head (795c354).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #3115   +/-   ##
=======================================
  Coverage   43.48%   43.48%           
=======================================
  Files         352      352           
  Lines       30020    30020           
=======================================
  Hits        13053    13053           
  Misses      16095    16095           
  Partials      872      872           
Flag Coverage Δ
unittests 43.48% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 34b1fdb...795c354. Read the comment docs.

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

@tbavelier
tbavelier merged commit 7656117 into main Jun 9, 2026
30 of 38 checks passed
@tbavelier
tbavelier deleted the tbavelier/use-reachable-version-tag branch June 9, 2026 13:29
tbavelier added a commit that referenced this pull request Jun 9, 2026
* Use reachable git tag for build version

* Use short SHA for untagged build version

(cherry picked from commit 7656117)

Co-authored-by: Timothée Bavelier <[email protected]>
tbavelier added a commit that referenced this pull request Jun 9, 2026
* Use reachable git tag for build version

* Use short SHA for untagged build version

(cherry picked from commit 7656117)

Co-authored-by: Timothée Bavelier <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants