Skip to content

OSAC-3849: add GPU fields to describe instancetype output - #232

Merged
omer-vishlitzky merged 2 commits into
osac-project:mainfrom
Tzif-Morgen:feat/OSAC-3849-describe-gpu-fields
Aug 11, 2026
Merged

omer-vishlitzky merged 2 commits into
osac-project:mainfrom
Tzif-Morgen:feat/OSAC-3849-describe-gpu-fields

Conversation

@Tzif-Morgen

@Tzif-Morgen Tzif-Morgen commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Display GPU count, resource name, and PCI device selector in describe instancetype output when a GpuSpec is present
  • GPU fields are omitted for non-GPU instance types
  • Description field moved after GPU fields to group hardware specs together

Jira

https://redhat.atlassian.net/browse/OSAC-3849

Test plan

  • GPU fields displayed when GpuSpec is present
  • GPU fields omitted when GpuSpec is absent
  • Verified on cluster with osac describe instancetype gpu-a100-test
image
  • Unit tests pass (ginkgo run -r internal/cmd/cli/describe/instancetype/)
  • Full lint pass (uv run dev.py lint)

Summary by CodeRabbit

  • New Features

    • Instance type details now display GPU count, resource name, and PCI device selector when GPU configuration is available.
  • Bug Fixes

    • GPU-specific fields are omitted when no GPU configuration is defined, keeping displayed details accurate.

Display GPU PCI device selector, resource name, and count in the
describe instancetype output when a GpuSpec is present.

Assisted-by: Claude Code <noreply@anthropic.com>
Signed-off-by: Tzif <tmorgens@redhat.com>
@openshift-ci-robot

openshift-ci-robot commented Aug 10, 2026 •

Copy link
Copy Markdown

@Tzif-Morgen: This pull request references OSAC-3849 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Summary

  • Display GPU count, resource name, and PCI device selector in describe instancetype output when a GpuSpec is present
  • GPU fields are omitted for non-GPU instance types
  • Description field moved after GPU fields to group hardware specs together

Jira

https://redhat.atlassian.net/browse/OSAC-3849

Test plan

  • GPU fields displayed when GpuSpec is present
  • GPU fields omitted when GpuSpec is absent
  • Verified on cluster with osac describe instancetype gpu-a100-test
  • Unit tests pass (ginkgo run -r internal/cmd/cli/describe/instancetype/)
  • Full lint pass (uv run dev.py lint)

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 openshift-eng/jira-lifecycle-plugin repository.

@coderabbitai

coderabbitai Bot commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

The instance type description command now renders GPU count, resource name, and PCI device selector when GpuSpec is configured. Tests cover both configured and absent GPU specifications.

Changes

GPU instance type description

Layer / File(s) Summary
Conditional GPU field rendering
fulfillment-service/internal/cmd/cli/describe/instancetype/describe_instancetype_cmd.go, fulfillment-service/internal/cmd/cli/describe/instancetype/describe_instancetype_cmd_test.go
The renderer conditionally displays GPU fields. Tests verify output with and without GpuSpec.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

Suggested reviewers: akshaynadkarni, jhernand, danmanor

🚥 Pre-merge checks | ✅ 10 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (10 passed)
Check name Status Explanation
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.
No-Hardcoded-Secrets ✅ Passed The full PR diff adds only GPU display logic and unit-test fixtures; it contains no API keys, tokens, passwords, private keys, credential URLs, or secret-shaped blobs.
No-Weak-Crypto ✅ Passed The PR adds only GPU output and tests; scans of added lines and changed Go files found no MD5, SHA1, DES, RC4, Blowfish, ECB, crypto API, or custom crypto code.
No-Injection-Vectors ✅ Passed The PR adds only fixed-format fmt.Fprintf calls for GPU fields and tests; no SQL concatenation, shell execution, eval/exec, unsafe YAML, pickle, os.system, or HTML injection.
Container-Privileges ✅ Passed The PR changes only Go rendering logic and tests. The complete patch contains no Kubernetes manifests or privilege markers such as privileged, hostPID, hostNetwork, hostIPC, SYS_ADMIN, or allowPriv...
No-Sensitive-Data-In-Logs ✅ Passed The PR adds only GPU count, resource name, and PCI selector to user-facing stdout via fmt.Fprintf; the diff adds no passwords, tokens, API keys, PII, or logger calls.
Ai-Attribution ✅ Passed Both PR commits identify Claude Code with an Assisted-by trailer; neither commit uses Co-Authored-By for AI.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the addition of GPU fields to describe instancetype output.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 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.

@Tzif-Morgen

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Move GPU fields after memory and before state/description to group
hardware specs together.

Assisted-by: Claude Code <noreply@anthropic.com>
Signed-off-by: Tzif <tmorgens@redhat.com>

@coderabbitai coderabbitai Bot left a comment

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.

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
`@fulfillment-service/internal/cmd/cli/describe/instancetype/describe_instancetype_cmd.go`:
- Around line 108-112: Update renderInstanceType to return the error from its
tabwriter.Writer Flush call, propagate that error from run when invoking
renderInstanceType(c.console, matched), and adjust the test helper to handle the
new return value.
🪄 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: Repository: osac-project/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 42d56f5d-8779-4285-89ce-a4506dedc85a

📥 Commits

Reviewing files that changed from the base of the PR and between 12ac434 and cea0bcc.

📒 Files selected for processing (2)
  • fulfillment-service/internal/cmd/cli/describe/instancetype/describe_instancetype_cmd.go
  • fulfillment-service/internal/cmd/cli/describe/instancetype/describe_instancetype_cmd_test.go

Comment on lines +108 to +112
if gpu := spec.GetGpu(); gpu != nil {
fmt.Fprintf(writer, "GPU Count:\t%d\n", gpu.GetCount())
fmt.Fprintf(writer, "GPU Resource Name:\t%s\n", gpu.GetResourceName())
fmt.Fprintf(writer, "GPU PCI Device Selector:\t%s\n", gpu.GetPciDeviceSelector())
}

@coderabbitai coderabbitai Bot Aug 10, 2026 •

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.

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail
rg -n -C 4 '\brenderInstanceType\s*\(' fulfillment-service/internal/cmd/cli/describe/instancetype --glob '*.go'
rg -n -C 2 'fmt\.Fprintf|\.Flush\(\)' fulfillment-service/internal/cmd/cli/describe/instancetype --glob '*.go'

Repository: osac-project/osac

Length of output: 8157


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

# Inspect the full function and call sites without modifying repository files.
cat -n fulfillment-service/internal/cmd/cli/describe/instancetype/describe_instancetype_cmd.go | sed -n '1,170p'

echo '--- tests ---'
cat -n fulfillment-service/internal/cmd/cli/describe/instancetype/describe_instancetype_cmd_test.go | sed -n '1,120p'

Repository: osac-project/osac

Length of output: 11265


Propagate tabwriter flush errors.

renderInstanceType creates a *tabwriter.Writer, fills it with output, and calls Flush() while ignoring its error. That can silently emit incomplete CLI output. Make renderInstanceType return error, propagate it from renderInstanceType(c.console, matched) in run, and update the test helper accordingly.

🤖 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
`@fulfillment-service/internal/cmd/cli/describe/instancetype/describe_instancetype_cmd.go`
around lines 108 - 112, Update renderInstanceType to return the error from its
tabwriter.Writer Flush call, propagate that error from run when invoking
renderInstanceType(c.console, matched), and adjust the test helper to handle the
new return value.

Sources: Path instructions, Learnings

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Pre-existing pattern across all describe commands - not in scope for this PR.

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.

@Tzif-Morgen, acknowledged. This is a pre-existing pattern and is outside the scope of this GPU rendering PR. I will not require a change here.

Would you like me to open a follow-up GitHub issue to track consistent error handling for output writers, tabwriter.Flush(), and connection closure across the describe commands?


🧠 Learnings used
Learnt from: ajamias
Repo: osac-project/osac PR: 156
File: fulfillment-service/internal/cmd/cli/describe/baremetalinstancetype/describe_baremetalinstancetype_cmd.go:67-71
Timestamp: 2026-08-05T18:46:46.995Z
Learning: Across the fulfillment-service CLI, consistently handle errors from output writers, tabwriter.Flush(), and gRPC ClientConn.Close() rather than addressing them only in a new command. Follow the codebase’s established error-reporting or propagation conventions so I/O and connection-close failures are not silently ignored.

You are interacting with an AI system.

@ygalblum ygalblum left a comment

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.

/approve
/lgtm

@openshift-ci

openshift-ci Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Tzif-Morgen, ygalblum

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

@omer-vishlitzky
omer-vishlitzky merged commit 8edded6 into osac-project:main Aug 11, 2026
65 of 67 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request Aug 12, 2026
5 tasks done
eliorerz pushed a commit that referenced this pull request Sep 18, 2026
…ectrpc-connect-web-2.x-lockfile

NO-ISSUE: Update dependency @connectrpc/connect-web to v2.2.0

This branch was previously deployed

1 inactive deployment
e2e-test — cea0bcc9 Deployed Aug 10, 2026 by Tzif-Morgen via e2e-vmaas-full-install / e2e #1068
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.

4 participants