Skip to content

ROSAENG-61040 | refactor: remove github.com/nathan-fiscaletti/consolesize-go - #3415

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift:masterfrom
markirish:ROSAENG-61040-remove-consolesize-go
Jul 24, 2026
Merged

ROSAENG-61040 | refactor: remove github.com/nathan-fiscaletti/consolesize-go#3415
openshift-merge-bot[bot] merged 1 commit into
openshift:masterfrom
markirish:ROSAENG-61040-remove-consolesize-go

Conversation

@markirish

@markirish markirish commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

PR Summary

Switch to golang.org/x/term.GetSize which was already a transitive dependency. Add an 80-column fallback for piped/redirected output.

Detailed Description of the Issue

Our ROSA CLI project currently imports several third-party libraries that are only utilized in a single file (e.g., exclusively within a test file or for a single validation function). Relying on entire external dependencies for isolated use cases unnecessarily increases our security attack surface, complicates dependency management, and bloats the project.

This PR is part of that initiative to remove github.com/nathan-fiscaletti/consolesize-go

Related Issues and PRs

Type of Change

  • feat - adds a new user-facing capability.
  • fix - resolves an incorrect behavior or bug.
  • docs - updates documentation only.
  • style - formatting or naming changes with no logic impact.
  • refactor - code restructuring with no behavior change.
  • test - adds or updates tests only.
  • chore - maintenance work (tooling, housekeeping, non-product code).
  • build - changes build system, packaging, or dependencies for build output.
  • ci - changes CI pipelines, jobs, or automation workflows.
  • perf - improves performance without changing intended behavior.

Previous Behavior

Behavior After This Change

How to Test (Step-by-Step)

Preconditions

Test Steps

  1. run make test

Expected Results

All tests pass

Proof of the Fix

Tests pass

Breaking Changes

  • No breaking changes
  • Yes, this PR introduces a breaking change (describe impact and migration plan below)

Developer Verification Checklist

  • Commit subject/title follows [JIRA-TICKET] | [TYPE]: <MESSAGE>.
  • PR description clearly explains both what changed and why.
  • Relevant Jira/GitHub issues and related PRs are linked.
  • make install-hooks has been run in this clone.
  • Tests were added/updated where appropriate.
  • I manually tested the change.
  • make test passes.
  • make lint passes.
  • make rosa passes.
  • Documentation or repo-local agent guidance was added/updated where appropriate.
  • Any risk, limitation, or follow-up work is documented.

Summary by CodeRabbit

Terminal sizing dependency evaluation

We evaluated replacing consolesize-go with golang.org/x/term. x/term is already a direct dependency, so this introduces no meaningful additional module-graph cost; Go's linker also removes unreachable code from the final binary. More importantly, term.GetSize provides maintained cross-platform terminal sizing and returns errors for non-TTY stdout, which this command handles with a deterministic 80-column fallback. This makes x/term the safer and more maintainable solution.

…size-go

Switch to golang.org/x/term.GetSize which was already a transitive
dependency. Add an 80-column fallback for piped/redirected output.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@markirish, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 14 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 9fce5435-a6d1-436e-b8f5-7134cc7015af

📥 Commits

Reviewing files that changed from the base of the PR and between 71fe022 and b511864.

⛔ Files ignored due to path filters (6)
  • go.sum is excluded by !**/*.sum
  • vendor/github.com/nathan-fiscaletti/consolesize-go/LICENSE is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/nathan-fiscaletti/consolesize-go/README.md is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/nathan-fiscaletti/consolesize-go/consolesize_unix.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/nathan-fiscaletti/consolesize-go/consolesize_windows.go is excluded by !vendor/**, !**/vendor/**
  • vendor/modules.txt is excluded by !vendor/**, !**/vendor/**
📒 Files selected for processing (2)
  • cmd/list/gates/cmd.go
  • go.mod
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@openshift-ci
openshift-ci Bot requested review from gdbranco and marcolan018 July 23, 2026 18:03
Comment thread cmd/list/gates/cmd.go
@amandahla

Copy link
Copy Markdown
Contributor

/approve
/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jul 23, 2026
@openshift-ci

openshift-ci Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: amandahla, markirish

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:

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

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 23, 2026
@amandahla

Copy link
Copy Markdown
Contributor

/hold
I'll remove the hold once the pr description is updated otherwise will merge ;)

@openshift-ci openshift-ci Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 23, 2026
@openshift-ci

openshift-ci Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

@markirish: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/govulncheck b511864 link false /test govulncheck
ci/prow/security b511864 link false /test security

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@amandahla

Copy link
Copy Markdown
Contributor

/unhold

@openshift-ci openshift-ci Bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 24, 2026
@openshift-merge-bot
openshift-merge-bot Bot merged commit 3577b83 into openshift:master Jul 24, 2026
10 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants