Skip to content

avoid non-constant format string in calls - #1314

Merged
xcoulon merged 3 commits into
codeready-toolchain:masterfrom
xcoulon:pre-upgrade-go-1.26-e2e
Aug 6, 2026
Merged

avoid non-constant format string in calls#1314
xcoulon merged 3 commits into
codeready-toolchain:masterfrom
xcoulon:pre-upgrade-go-1.26-e2e

Conversation

@xcoulon

@xcoulon xcoulon commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

add method that do not need extra variadic args to format the message (causing build failures in Go 1.26)

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

Summary by CodeRabbit

  • Bug Fixes

    • Improved terminal messaging for token acquisition failures and results-file reporting.
    • Prevented error messages from being interpreted as formatting strings.
    • Fatal errors now run registered cleanup actions before exiting.
  • Enhancements

    • Added consistent informational, error, and fatal terminal output handling.
    • Improved clarity and reliability of command-line feedback during setup and results reporting.

add method that do not need extra variadic args to format the message (causing build failures in Go 1.26)

Signed-off-by: Xavier Coulon <xcoulon@redhat.com>
@openshift-ci
openshift-ci Bot requested review from alexeykazakov and metlos August 5, 2026 14:56
@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: f6bddf44-0434-472b-bd49-82476f19db9b

📥 Commits

Reviewing files that changed from the base of the PR and between dc5c7f5 and 1a66b44.

📒 Files selected for processing (1)
  • setup/metrics/gather_test.go
🔗 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)
📜 Recent review details
⏰ Context from checks skipped due to timeout. (3)
  • GitHub Check: govulncheck
  • GitHub Check: Build & push operator bundles & dashboard image for e2e tests
  • GitHub Check: GolangCI Lint
🧰 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:

  • setup/metrics/gather_test.go
🔇 Additional comments (1)
setup/metrics/gather_test.go (1)

10-10: LGTM!

Also applies to: 22-33, 208-217, 219-237, 241-251


Walkthrough

The terminal API adds direct informational, error, and fatal methods. Token failure handling and results-file reporting now use these methods. Test doubles implement the expanded interface.

Changes

Terminal output API

Layer / File(s) Summary
Add terminal methods
setup/terminal/terminal.go
The Terminal interface adds Info, Error, and Fatal. DefaultTerminal implements these methods, including fatal hooks and exit status handling.
Migrate callers and test doubles
setup/cmd/root.go, setup/results/results.go, setup/metrics/gather_test.go
Token failures use term.Fatal. Results-file reporting uses term.Info. The metrics test terminal implements the expanded interface.

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

Possibly related PRs

Suggested labels: bug

Suggested reviewers: metlos, alexeykazakov, victoremepunto

🚥 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 main change: avoiding non-constant format strings in terminal calls.
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 the bug Something isn't working label Aug 5, 2026
@openshift-ci

openshift-ci Bot commented Aug 5, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 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 [rajivnathan,xcoulon]

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

rajivnathan and others added 2 commits August 5, 2026 13:38
Signed-off-by: Xavier Coulon <xcoulon@redhat.com>
@sonarqubecloud

sonarqubecloud Bot commented Aug 6, 2026

Copy link
Copy Markdown

@xcoulon
xcoulon merged commit 83cd15c into codeready-toolchain:master Aug 6, 2026
9 of 10 checks passed
@xcoulon
xcoulon deleted the pre-upgrade-go-1.26-e2e branch August 6, 2026 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants