Skip to content

fix(ci): set GOARCH on scanner cache step for correct cache keys#19578

Closed
davdhacs wants to merge 1 commit intomasterfrom
davdhacs/fix-scanner-cache-goarch
Closed

fix(ci): set GOARCH on scanner cache step for correct cache keys#19578
davdhacs wants to merge 1 commit intomasterfrom
davdhacs/fix-scanner-cache-goarch

Conversation

@davdhacs
Copy link
Contributor

Summary

Set GOARCH environment variable on the cache-go-dependencies step in pre-build-scanner-go-binary so each architecture gets its own GOCACHE key.

Problem

The scanner build matrix cross-compiles for multiple architectures (amd64, arm64, ppc64le, s390x). The cache action reads go env GOARCH to include the architecture in the cache key, but without GOARCH set in the environment, it always returns the runner's native amd64. All architecture variants share one cache entry containing incompatible .a files.

Fix

Add env: GOARCH: ${{ matrix.goarch }} to the cache step, matching how build.yaml already handles this for pre-build-go-binaries.

Partially generated by AI.

pre-build-scanner-go-binary cross-compiles for multiple architectures
(amd64, arm64, ppc64le, s390x) but the cache-go-dependencies step
reads GOARCH via `go env GOARCH` which returns the runner's native
arch (amd64) when GOARCH is not set in the environment. All arch
variants share one cache key, restoring incompatible entries.

Fix: set GOARCH to matrix.goarch on the cache step, matching what
build.yaml already does for pre-build-go-binaries.

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

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@rhacs-bot
Copy link
Contributor

Images are ready for the commit at f29c12f.

To use with deploy scripts, first export MAIN_IMAGE_TAG=4.11.x-431-gf29c12f05f.

@codecov
Copy link

codecov bot commented Mar 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.26%. Comparing base (47557b3) to head (f29c12f).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #19578   +/-   ##
=======================================
  Coverage   49.26%   49.26%           
=======================================
  Files        2735     2735           
  Lines      206138   206138           
=======================================
  Hits       101546   101546           
  Misses      97045    97045           
  Partials     7547     7547           
Flag Coverage Δ
go-unit-tests 49.26% <ø> (ø)

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.

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.

2 participants