Skip to content

build: upgrade to Go 1.26.5 - #615

Merged
xcoulon merged 3 commits into
codeready-toolchain:masterfrom
xcoulon:upgrade-go-1.26-regsvc
Aug 10, 2026
Merged

build: upgrade to Go 1.26.5#615
xcoulon merged 3 commits into
codeready-toolchain:masterfrom
xcoulon:upgrade-go-1.26-regsvc

Conversation

@xcoulon

@xcoulon xcoulon commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

also, build image using registry.access.redhat.com/ubi10/ubi:latest
also, convert README.adoc to README.md
also, remove the check-format target and move the formatting logic into go.mk

See also:

Signed-off-by: Xavier Coulon xcoulon@redhat.com

Summary by CodeRabbit

  • Documentation

    • Converted the README to Markdown and updated the documented Go requirement to 1.26.x.
  • Maintenance

    • Updated the build environment and Go toolchain to Go 1.26.5.
    • Refreshed development tooling and module versions.
  • Developer Experience

    • Added a Make target for formatting Go code.
  • Security

    • Cleared the vulnerability ignore list so previously silenced findings are no longer excluded.

also, build image using `registry.access.redhat.com/ubi10/ubi:latest`
also, convert `README.adoc` to `README.md`
also, remove the `check-format` target and move the formatting logic into `go.mk`

Signed-off-by: Xavier Coulon <xcoulon@redhat.com>
@openshift-ci
openshift-ci Bot requested review from fbm3307 and rajivnathan August 5, 2026 12:26
@openshift-ci openshift-ci Bot added the approved label Aug 5, 2026
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: 83152694-27ae-4bb7-ae8e-90fd0524673b

📥 Commits

Reviewing files that changed from the base of the PR and between 9187e9b and d74b0f8.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (2)
  • go.mod
  • make/go.mk
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • codeready-toolchain/api (manual)
  • codeready-toolchain/toolchain-common (manual)
  • codeready-toolchain/host-operator (manual) → reviewed against open PR #1290 upgrade-go-1.26-host instead of the default branch
  • codeready-toolchain/toolchain-e2e (manual) → reviewed against open PR #1313 upgrade-go-1.26-e2e instead of the default branch
💤 Files with no reviewable changes (1)
  • make/go.mk
🚧 Files skipped from review as they are similar to previous changes (1)
  • go.mod
📜 Recent review details
⏰ Context from checks skipped due to timeout. (4)
  • GitHub Check: test
  • GitHub Check: GolangCI Lint
  • GitHub Check: govulncheck
  • GitHub Check: Build & push operator bundles & dashboard image for e2e tests

Walkthrough

The change upgrades the Go toolchain and dependencies, updates the build image, adds a Go formatting target, converts the README to Markdown, and clears vulnerability ignores.

Changes

Repository maintenance

Layer / File(s) Summary
Toolchain and dependency upgrades
go.mod, openshift-ci/Dockerfile.tools
The module uses Go 1.26.0 with toolchain Go 1.26.5. Indirect dependencies are updated. The build image uses UBI 10 and Go 1.26.5 with a new checksum.
Maintenance configuration and formatting
.govulncheck.yaml, make/go.mk
The vulnerability ignore list is empty. The format-go-code target formats Go files while excluding vendor and .git.
README Markdown conversion
README.md
AsciiDoc syntax was converted to Markdown. The documented Go requirement is now 1.26.x.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested labels: dependencies, documentation, chore, ci

Suggested reviewers: fbm3307

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the primary change: upgrading the project to Go 1.26.5.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot added chore Routine repo or tooling maintenance ci Add or update CI/CD configuration dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation labels Aug 5, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
openshift-ci/Dockerfile.tools (1)

1-1: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Security Misconfiguration (CWE-829): Inclusion of Functionality from Untrusted Control Sphere

Reachability: External

Pin the UBI base image by digest.

The latest tag can change the build environment without a reviewed Dockerfile change. Use an approved immutable digest to preserve reproducibility and supply-chain control.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@openshift-ci/Dockerfile.tools` at line 1, Update the build-tools stage’s UBI
base image reference to use the approved immutable image digest instead of the
mutable latest tag, preserving the existing registry and image while ensuring
reproducible builds.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@make/go.mk`:
- Line 9: Change GOFORMAT_FILES from immediate to deferred evaluation so the
find/grep discovery runs only when format-go-code expands it, while preserving
the existing exclusions and allowing files generated earlier in the invocation
to be included.

In `@README.md`:
- Line 12: Update the Go download link in the README to replace the vague “here”
text with descriptive link text such as “Go downloads page,” while preserving
the existing destination URL.

---

Nitpick comments:
In `@openshift-ci/Dockerfile.tools`:
- Line 1: Update the build-tools stage’s UBI base image reference to use the
approved immutable image digest instead of the mutable latest tag, preserving
the existing registry and image while ensuring reproducible builds.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: 21199964-a75c-49a6-ab5b-f387eeff161d

📥 Commits

Reviewing files that changed from the base of the PR and between e0308ed and 14e1858.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (7)
  • .govulncheck.yaml
  • README.md
  • go.mod
  • make/format.mk
  • make/go.mk
  • make/gofmt_exclude
  • openshift-ci/Dockerfile.tools
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • codeready-toolchain/api (manual)
  • codeready-toolchain/toolchain-common (manual)
  • codeready-toolchain/host-operator (manual)
  • codeready-toolchain/toolchain-e2e (manual)
💤 Files with no reviewable changes (1)
  • make/format.mk
📜 Review details
⏰ Context from checks skipped due to timeout. (4)
  • GitHub Check: GolangCI Lint
  • GitHub Check: test
  • GitHub Check: govulncheck
  • GitHub Check: Build & push operator bundles & dashboard image for e2e tests
🧰 Additional context used
📓 Path-based instructions (1)
**

⚙️ CodeRabbit configuration file

-Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity.

Files:

  • make/gofmt_exclude
  • openshift-ci/Dockerfile.tools
  • make/go.mk
  • go.mod
  • README.md
🪛 GitHub Actions: ci-check-gomod / 0_go.mod replacements.txt
go.mod

[error] 1-1: Go module replacement(s) are not allowed in go.mod. The pipeline detected forbidden replacements via: go list -m all | grep --color=never -E "${REGEX}.*\s*=>" and exited with code 1. Log: the above replacement(s) are not allowed in go.mod.

🪛 GitHub Actions: ci-check-gomod / go.mod replacements
go.mod

[error] 1-1: Dependency replacement check failed. Protected modules are replaced with unapproved modules: github.com/codeready-toolchain/api => github.com/xcoulon/api and github.com/codeready-toolchain/toolchain-common => github.com/xcoulon/toolchain-common. The command exited with code 1.

🪛 markdownlint-cli2 (0.23.2)
README.md

[warning] 12-12: Link text should be descriptive

(MD059, descriptive-link-text)

🪛 OSV Scanner (2.4.0)
go.mod

[CRITICAL] 163-163: golang.org/x/crypto 0.51.0: Invoking key constraints not enforced in golang.org/x/crypto/ssh/agent

(GO-2026-5005)


[CRITICAL] 163-163: golang.org/x/crypto 0.51.0: Invoking agent constraints dropped when forwarding keys in golang.org/x/crypto/ssh/agent

(GO-2026-5006)


[CRITICAL] 163-163: golang.org/x/crypto 0.51.0: Invoking byte arithmetic causes underflow and panic in golang.org/x/crypto/ssh

(GO-2026-5013)


[CRITICAL] 163-163: golang.org/x/crypto 0.51.0: Invoking bypass of certificate restrictions in golang.org/x/crypto/ssh

(GO-2026-5014)


[CRITICAL] 163-163: golang.org/x/crypto 0.51.0: Invoking server panic during CheckHostKey/Authenticate in golang.org/x/crypto/ssh

(GO-2026-5015)


[CRITICAL] 163-163: golang.org/x/crypto 0.51.0: Invoking memory leak when rejecting channels can lead to DoS in golang.org/x/crypto/ssh

(GO-2026-5016)


[CRITICAL] 163-163: golang.org/x/crypto 0.51.0: Invoking client can cause server deadlock on unexpected responses in golang.org/x/crypto/ssh

(GO-2026-5017)


[CRITICAL] 163-163: golang.org/x/crypto 0.51.0: Invoking pathological RSA/DSA parameters may cause DoS in golang.org/x/crypto/ssh

(GO-2026-5018)


[CRITICAL] 163-163: golang.org/x/crypto 0.51.0: Invoking bypass of FIDO/U2F security keys physical interaction in golang.org/x/crypto/ssh

(GO-2026-5019)


[CRITICAL] 163-163: golang.org/x/crypto 0.51.0: Invoking infinite loop on large channel writes in golang.org/x/crypto/ssh

(GO-2026-5020)


[CRITICAL] 163-163: golang.org/x/crypto 0.51.0: Invoking auth bypass via unenforced @revoked status in golang.org/x/crypto/ssh/knownhosts

(GO-2026-5021)


[CRITICAL] 163-163: golang.org/x/crypto 0.51.0: Invoking VerifiedPublicKeyCallback permissions skip enforcement in golang.org/x/crypto/ssh

(GO-2026-5023)


[CRITICAL] 163-163: golang.org/x/crypto 0.51.0: Invoking pathological inputs can lead to client panic in golang.org/x/crypto/ssh/agent

(GO-2026-5033)


[CRITICAL] 163-163: golang.org/x/crypto 0.51.0: The golang.org/x/crypto/openpgp package is unmaintained, unsafe by design, and has known security issues

(GO-2026-5932)


[CRITICAL] 163-163: golang.org/x/crypto 0.51.0: golang.org/x/crypto vulnerable to invoking bypass of certificate restrictions

(GHSA-45gg-vh54-h5m9)


[CRITICAL] 163-163: golang.org/x/crypto 0.51.0: golang.org/x/crypto vulnerable to auth bypass via unenforced @revoked status

(GHSA-5cgq-3rg8-m6cv)


[CRITICAL] 163-163: golang.org/x/crypto 0.51.0: golang.org/x/crypto is vulnerable to invoking server panic during CheckHostKey/Authenticate flow

(GHSA-78mq-xcr3-xm33)


[CRITICAL] 163-163: golang.org/x/crypto 0.51.0: golang.org/x/crypto: FIDO/U2F security key physical presence check can be bypassed

(GHSA-89gr-r52h-f8rx)


[CRITICAL] 163-163: golang.org/x/crypto 0.51.0: golang.org/x/crypto: Invoking pathological inputs can lead to client panic

(GHSA-9m57-25v3-79x9)


[CRITICAL] 163-163: golang.org/x/crypto 0.51.0: golang.org/x/crypto doesn't drop invoking agent constraints when forwarding keys

(GHSA-f5wc-c3c7-36mc)


[CRITICAL] 163-163: golang.org/x/crypto 0.51.0: golang.org/x/crypto doesn't enforce invoking key constraints

(GHSA-jppx-rxg9-jmrx)


[CRITICAL] 163-163: golang.org/x/crypto 0.51.0: golang.org/x/crypto: Invoking byte arithmetic causes underflow and panic

(GHSA-q4h4-gmj2-qvw2)


[CRITICAL] 163-163: golang.org/x/crypto 0.51.0: golang.org/x/crypto: Invoking memory leak when rejecting channels can lead to DoS

(GHSA-qpw4-5x99-6vjp)


[CRITICAL] 163-163: golang.org/x/crypto 0.51.0: golang.org/x/crypto vulnerable to infinite loop on large channel writes

(GHSA-rm3j-f69w-wqmq)


[CRITICAL] 163-163: golang.org/x/crypto 0.51.0: golang.org/x/crypto: Invoking client can cause server deadlock on unexpected responses

(GHSA-vgwf-h737-ff37)


[CRITICAL] 163-163: golang.org/x/crypto 0.51.0: golang.org/x/crypto: Invoking pathological RSA/DSA parameters may cause DoS

(GHSA-w879-237q-wc7r)


[CRITICAL] 163-163: golang.org/x/crypto 0.51.0: golang.org/x/crypto: Invoking VerifiedPublicKeyCallback permissions skip enforcement

(GHSA-x527-x647-q7gg)

🪛 Trivy (0.72.0)
openshift-ci/Dockerfile.tools

[error] 1-1: Image user should not be 'root'

Specify at least 1 USER command in Dockerfile with non-root user as argument

Rule: DS-0002

Learn more

(IaC/Dockerfile)

🔇 Additional comments (9)
README.md (1)

1-11: LGTM!

Also applies to: 13-14, 24-24, 38-38, 48-48

make/gofmt_exclude (1)

1-1: LGTM!

make/go.mk (1)

11-15: 🎯 Functional Correctness

This review comment is not applicable to the current code state.

check-format does not exist in this repository and has no git history. The format-go-code target is already a formatter with -w flag. No CI workflow runs any formatting checks, so there is no gate to protect. The concern about replacing a required CI check does not apply here.

			> Likely an incorrect or invalid review comment.
.govulncheck.yaml (1)

1-1: 🩺 Stability & Availability

Keep the empty suppression list.

The updated Go toolchain and dependencies meet the fixed versions for all removed vulnerability IDs, including Go 1.26.5, golang.org/x/net v0.55.0, golang.org/x/text v0.39.0, and google.golang.org/grpc v1.82.1.

go.mod (3)

3-5: LGTM!

Also applies to: 107-115, 164-171


163-163: 🔒 Security & Privacy

Do not block this change on the reported golang.org/x/crypto advisories.

The advisories affect golang.org/x/crypto/ssh, ssh/agent, ssh/knownhosts, and openpgp. The dependency graph does not include these packages, so the reported findings are not reachable in this build.


22-25: 🗄️ Data Integrity & Integration

Confirm approval of the forked modules.

The replacements preserve the original module identities. The affected source changes are comment-only, and go mod verify passes. Confirm that github.com/xcoulon is an approved and intentional source before merging.

openshift-ci/Dockerfile.tools (2)

12-13: LGTM!


1-1: 🔒 Security & Privacy

Run pull-request builds as a non-root user when this image is used by OpenShift CI.

registry.access.redhat.com/ubi10/ubi:latest defaults to root, and this Dockerfile sets /bin/bash as the entrypoint without a USER instruction. Add a non-root user with access to ${GOPATH} and ${GOPATH}/src/${GO_PACKAGE_PATH}. Confirm the external OpenShift CI configuration uses this image for untrusted pull-request code.

Comment thread make/go.mk Outdated
Comment thread README.md
## Build

Requires Go version 1.24.x (1.24.13 or higher) - download for your development environment https://golang.org/dl/[here].
Requires Go version 1.26.x (1.26.5 or higher) - download for your development environment [here](https://golang.org/dl/).

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Use descriptive link text for the Go download link.

Line 12 uses here as the link text. Replace it with text such as Go downloads page so the destination is clear in link lists and screen readers.

🧰 Tools
🪛 markdownlint-cli2 (0.23.2)

[warning] 12-12: Link text should be descriptive

(MD059, descriptive-link-text)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@README.md` at line 12, Update the Go download link in the README to replace
the vague “here” text with descriptive link text such as “Go downloads page,”
while preserving the existing destination URL.

Source: Linters/SAST tools

Comment thread go.mod Outdated

replace github.com/codeready-toolchain/api => github.com/xcoulon/api v0.0.0-20260805080027-7512d38caa3b

replace github.com/codeready-toolchain/toolchain-common => github.com/xcoulon/toolchain-common v0.0.0-20260805080255-7db4efab1c46

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Leftover replacement

@openshift-ci

openshift-ci Bot commented Aug 6, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: MatousJobanek, MikelAlejoBR, rajivnathan, xcoulon

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [MatousJobanek,rajivnathan,xcoulon]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Signed-off-by: Xavier Coulon <xcoulon@redhat.com>
@coderabbitai coderabbitai Bot added the refactoring Refactor code label Aug 6, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@make/go.mk`:
- Around line 20-26: Update the check-go-format target’s gofmt pipeline so it
preserves the formatter command’s exit status and fails when gofmt reports an
error or $(OUT_DIR)/gofmt-errors contains output. Remove the unconditional
success masking from the current read/tee/exit flow, while retaining the
existing diagnostic message and error-file display for formatting differences.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: aeb95837-9f4d-4d6f-9270-61227f801a51

📥 Commits

Reviewing files that changed from the base of the PR and between 14e1858 and 9187e9b.

📒 Files selected for processing (2)
  • make/format.mk
  • make/go.mk
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

💤 Files with no reviewable changes (1)
  • make/format.mk
📜 Review details
⏰ Context from checks skipped due to timeout. (5)
  • GitHub Check: test
  • GitHub Check: GolangCI Lint
  • GitHub Check: Generate SBOM
  • GitHub Check: govulncheck
  • GitHub Check: Build & push operator bundles & dashboard image for e2e tests
⚠️ CI failures not shown inline (2)

GitHub Actions: ci-check-gomod / go.mod replacements: build: upgrade to Go 1.26.5

Conclusion: failure

View job details

##[group]Run set -e
 �[36;1mset -e�[0m
 �[36;1mREGEX="("�[0m
 �[36;1mfor m in $(IFS=,; echo $PROTECTED_MODULES); do�[0m
 �[36;1m  REGEX="${REGEX}${m}|"�[0m
 �[36;1mdone�[0m
 �[36;1mREGEX="${REGEX%?})"�[0m
 �[36;1m�[0m
 �[36;1mif go list -m all | grep --color=never -E "${REGEX}.*\s*=>"; then�[0m
 �[36;1m  echo "the above replacement(s) are not allowed in go.mod"�[0m
 �[36;1m  exit 1�[0m
 �[36;1mfi�[0m
 shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
 env:
   PROTECTED_MODULES: github.com/codeready-toolchain/,github.com/kubesaw/
 ##[endgroup]
 github.com/codeready-toolchain/api v0.0.0-20260731065234-734640c901d2 => github.com/xcoulon/api v0.0.0-20260805080027-7512d38caa3b
 github.com/codeready-toolchain/toolchain-common v0.0.0-20260804130313-0d4161d82454 => github.com/xcoulon/toolchain-common v0.0.0-20260805080255-7db4efab1c46
 the above replacement(s) are not allowed in go.mod
 ##[error]Process completed with exit code 1.

GitHub Actions: ci-check-gomod / 0_go.mod replacements.txt: build: upgrade to Go 1.26.5

Conclusion: failure

View job details

##[group]Run set -e
 �[36;1mset -e�[0m
 �[36;1mREGEX="("�[0m
 �[36;1mfor m in $(IFS=,; echo $PROTECTED_MODULES); do�[0m
 �[36;1m  REGEX="${REGEX}${m}|"�[0m
 �[36;1mdone�[0m
 �[36;1mREGEX="${REGEX%?})"�[0m
 �[36;1m�[0m
 �[36;1mif go list -m all | grep --color=never -E "${REGEX}.*\s*=>"; then�[0m
 �[36;1m  echo "the above replacement(s) are not allowed in go.mod"�[0m
 �[36;1m  exit 1�[0m
 �[36;1mfi�[0m
 shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
 env:
   PROTECTED_MODULES: github.com/codeready-toolchain/,github.com/kubesaw/
 ##[endgroup]
 github.com/codeready-toolchain/api v0.0.0-20260731065234-734640c901d2 => github.com/xcoulon/api v0.0.0-20260805080027-7512d38caa3b
 github.com/codeready-toolchain/toolchain-common v0.0.0-20260804130313-0d4161d82454 => github.com/xcoulon/toolchain-common v0.0.0-20260805080255-7db4efab1c46
 the above replacement(s) are not allowed in go.mod
 ##[error]Process completed with exit code 1.
🧰 Additional context used
📓 Path-based instructions (1)
**

⚙️ CodeRabbit configuration file

-Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity.

Files:

  • make/go.mk
🔇 Additional comments (1)
make/go.mk (1)

12-15: LGTM!

Also applies to: 17-19

Comment thread make/go.mk Outdated
Comment on lines +20 to +26
$(Q)find . -name '*.go' -not -path '*/vendor/*' -not -path '*/.git/*' -exec gofmt -s -l {} + 2>&1 \
| tee $(OUT_DIR)/gofmt-errors \
| read \
&& echo "ERROR: These files differ from gofmt's style (run 'make format-go-code' to fix this):" \
&& cat $(OUT_DIR)/gofmt-errors \
&& exit 1 \
|| true

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail
tmp="$(mktemp)"
trap 'rm -f "$tmp"' EXIT

if bash -c 'false | tee "$1" | read && exit 1 || true' bash "$tmp"; then
  echo "Confirmed: the producer failure was masked."
else
  exit 1
fi

Repository: codeready-toolchain/registration-service

Length of output: 259


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- make/go.mk lines 1-45 ---'
cat -n make/go.mk | sed -n '1,45p'

printf '%s\n' '--- related make settings and targets ---'
rg -n -C 3 'SHELL|PIPEFAIL|gofmt-errors|format-go-code|gofmt' Makefile make .github 2>/dev/null | head -240 || true

printf '%s\n' '--- standalone pipeline behavior ---'
bash -c '
  set -o pipefail
  tmp=$(mktemp)
  trap "rm -f \"$tmp\"" EXIT
  set +e
  false | tee "$tmp" | read
  pipeline_status=$?
  set -e
  printf "pipeline_status=%s file_size=%s\\n" "$pipeline_status" "$(wc -c < "$tmp")"
'

Repository: codeready-toolchain/registration-service

Length of output: 4054


🏁 Script executed (no clone):

#!/bin/bash
set -u

sink() {
  local file=$1 line
  while IFS= read -r line; do
    printf '%s\n' "$line" >> "$file"
  done
}

run_case() {
  local name=$1
  shift
  local file rc
  file=$(mktemp)
  set +e
  "$@" | sink "$file" | read
  rc=$?
  if [ "$rc" -eq 0 ]; then
    echo "ERROR: format differences detected"
    cat "$file"
    exit 1
  fi
  true
  rc=$?
  set -e
  printf '%s: recipe_status=%s output_bytes=%s\n' \
    "$name" "$rc" "$(wc -c < "$file")"
  rm -f "$file"
}

no_output_success() { return 0; }
no_output_failure() { return 7; }
one_output_success() { printf '%s\n' 'bad.go'; return 0; }
one_output_failure() { printf '%s\n' 'gofmt: failure'; return 7; }

run_case no_output_success no_output_success
run_case no_output_failure no_output_failure
run_case one_output_success one_output_success
run_case one_output_failure one_output_failure

Length of output: 328


Make check-go-format fail on formatter and output errors.

read is the last pipeline command, and || true masks both empty-output failures and the explicit exit 1. The target therefore returns success for formatting differences and gofmt failures. Capture the formatter status and fail when it is nonzero or gofmt-errors is non-empty.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@make/go.mk` around lines 20 - 26, Update the check-go-format target’s gofmt
pipeline so it preserves the formatter command’s exit status and fails when
gofmt reports an error or $(OUT_DIR)/gofmt-errors contains output. Remove the
unconditional success masking from the current read/tee/exit flow, while
retaining the existing diagnostic message and error-file display for formatting
differences.

Source: Path instructions

also, `remove check-go-format` make goal

Signed-off-by: Xavier Coulon <xcoulon@redhat.com>
@sonarqubecloud

sonarqubecloud Bot commented Aug 7, 2026

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot removed the refactoring Refactor code label Aug 7, 2026
@xcoulon
xcoulon merged commit 989f452 into codeready-toolchain:master Aug 10, 2026
11 of 12 checks passed
@xcoulon
xcoulon deleted the upgrade-go-1.26-regsvc branch August 10, 2026 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved chore Routine repo or tooling maintenance ci Add or update CI/CD configuration dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants