Skip to content

perf(ci): disable go buildvcs stamping#19585

Open
davdhacs wants to merge 1 commit intomasterfrom
davdhacs/disable-buildvcs-tests
Open

perf(ci): disable go buildvcs stamping#19585
davdhacs wants to merge 1 commit intomasterfrom
davdhacs/disable-buildvcs-tests

Conversation

@davdhacs
Copy link
Contributor

@davdhacs davdhacs commented Mar 24, 2026

Problem:

Go 1.18+ silently enabled -buildvcs=auto, which stamps every binary with VCS metadata (commit, modified status) via debug.ReadBuildInfo(). No code in this repo reads this metadata — version info is injected via -X ldflags instead.

The VCS stamping adds unnecessary overhead: Go must query git state for every build/test invocation, and changes to git state (e.g. untracked files) can invalidate build cache entries.

Fix:

Explicitly set -buildvcs=false in invoke_go() in go-tool.sh, which is the single choke point for all Go build/test/run invocations.

Testing and quality

How I validated my change

  • CI-only change (build flags). No functional difference — VCS metadata was never consumed.
  • Verified locally: builds and tests pass with -buildvcs=false.

Go 1.18+ silently enabled -buildvcs=auto, which stamps every binary
with VCS metadata (commit, modified status) via debug.ReadBuildInfo().
No code in this repo reads this metadata — version info is injected
via -X ldflags instead.

The VCS stamping adds unnecessary overhead: Go must query git state
for every build/test invocation, and changes to git state (e.g.
untracked files) can invalidate build cache entries.

Explicitly set -buildvcs=false for both build and test invocations.

Partially generated by AI.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@openshift-ci
Copy link

openshift-ci bot commented Mar 24, 2026

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@davdhacs davdhacs changed the title perf(ci): disable buildvcs for builds and tests perf(ci): disable go buildvcs stamping Mar 24, 2026
@rhacs-bot
Copy link
Contributor

Images are ready for the commit at 0e04bb8.

To use with deploy scripts, first export MAIN_IMAGE_TAG=4.11.x-432-g0e04bb8f6f.

@codecov
Copy link

codecov bot commented Mar 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.25%. Comparing base (bbcc7d3) to head (0e04bb8).
⚠️ Report is 10 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #19585      +/-   ##
==========================================
- Coverage   49.26%   49.25%   -0.01%     
==========================================
  Files        2735     2735              
  Lines      206138   206138              
==========================================
- Hits       101545   101543       -2     
- Misses      97046    97047       +1     
- Partials     7547     7548       +1     
Flag Coverage Δ
go-unit-tests 49.25% <ø> (-0.01%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@davdhacs davdhacs marked this pull request as ready for review March 25, 2026 04:09
@davdhacs davdhacs requested review from a team, janisz, porridge and tommartensen March 25, 2026 04:09
@porridge porridge added the auto-retest PRs with this label will be automatically retested if prow checks fails label Mar 25, 2026
@rhacs-bot
Copy link
Contributor

/retest

shift
if [[ "$RACE" == "true" ]]; then
CGO_ENABLED=1 go "$tool" -race -ldflags="${ldflags[*]}" -tags "$(tr , ' ' <<<"$GOTAGS")" "$@"
CGO_ENABLED=1 go "$tool" -race -buildvcs=false -ldflags="${ldflags[*]}" -tags "$(tr , ' ' <<<"$GOTAGS")" "$@"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This list is getting long, making it harder to spot the difference. Perhaps we should try to de-duplicate with something like:

  if [[ "$RACE" == "true" ]]; then
    env="CGO_ENABLED=1"
    args="-race"
  else
    env=""
    args=""
  fi
  $env go "$tool" $args -buildvcs=false -ldflags="${ldflags[*]}" -tags "$(tr , ' ' <<<"$GOTAGS")" "$@"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right. It is getting too long to parse. I like your suggestion much better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-assisted auto-retest PRs with this label will be automatically retested if prow checks fails

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants