Skip to content

[Backport v1.27] [codex] Use reachable git tag for build version#3118

Merged
tbavelier merged 1 commit into
v1.27from
backport-3115-to-v1.27
Jun 9, 2026
Merged

[Backport v1.27] [codex] Use reachable git tag for build version#3118
tbavelier merged 1 commit into
v1.27from
backport-3115-to-v1.27

Conversation

@dd-octo-sts

@dd-octo-sts dd-octo-sts Bot commented Jun 9, 2026

Copy link
Copy Markdown

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 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

* Use reachable git tag for build version

* Use short SHA for untagged build version

(cherry picked from commit 7656117)
@dd-octo-sts
dd-octo-sts Bot requested a review from a team as a code owner June 9, 2026 13:29
@dd-octo-sts dd-octo-sts Bot added tooling qa/skip-qa backport label added by backport action bot label added by backport bot team/container-platform labels Jun 9, 2026
@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 41.61%. Comparing base (ab91a53) to head (5c22d87).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##            v1.27    #3118   +/-   ##
=======================================
  Coverage   41.61%   41.61%           
=======================================
  Files         336      336           
  Lines       28737    28737           
=======================================
  Hits        11958    11958           
  Misses      15984    15984           
  Partials      795      795           
Flag Coverage Δ
unittests 41.61% <ø> (ø)

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 ab91a53...5c22d87. Read the comment docs.

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

@datadog-official

Copy link
Copy Markdown

Code Coverage

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 41.91% (+0.00%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 5c22d87 | Docs | Datadog PR Page | Give us feedback!

@tbavelier
tbavelier merged commit 509ac59 into v1.27 Jun 9, 2026
54 of 62 checks passed
@tbavelier
tbavelier deleted the backport-3115-to-v1.27 branch June 9, 2026 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport label added by backport action bot label added by backport bot qa/skip-qa team/container-platform tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants