Skip to content

ROSAENG-62596: fix: set cluster as non namespaced for client generator - #285

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift-online:mainfrom
gdbranco:feat/rosaeng-62596
Aug 10, 2026
Merged

ROSAENG-62596: fix: set cluster as non namespaced for client generator#285
openshift-merge-bot[bot] merged 1 commit into
openshift-online:mainfrom
gdbranco:feat/rosaeng-62596

Conversation

@gdbranco

@gdbranco gdbranco commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Description

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactoring (no functional changes)
  • CI/CD or tooling change

Testing

  • Unit tests pass (make test)
  • Integration tests pass (if applicable)
  • Manual verification completed

Checklist

  • My code follows the project's coding conventions
  • I have updated documentation as needed
  • I have added tests that prove my fix/feature works
  • All new and existing tests pass

Summary by CodeRabbit

  • New Features

    • Cluster resources can now be accessed without specifying an account or namespace.
    • Client generation supports non-namespace-scoped resources while preserving namespace-based access for others.
  • Bug Fixes

    • Updated cluster creation, readiness checks, deletion, and usage examples to use the simplified access pattern.
    • Node pool access remains appropriately scoped to its cluster.

@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 5, 2026
@openshift-ci

openshift-ci Bot commented Aug 5, 2026

Copy link
Copy Markdown

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

@gdbranco
gdbranco marked this pull request as ready for review August 5, 2026 21:24
@openshift-ci openshift-ci Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 5, 2026
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: openshift-online/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 53a2a409-d6a7-47d7-9a65-bc779b06106a

📥 Commits

Reviewing files that changed from the base of the PR and between c6cf933 and 568b9ed.

⛔ Files ignored due to path filters (4)
  • clientset/generated/typed/v1alpha1/public/cluster.go is excluded by !**/generated/**
  • clientset/generated/typed/v1alpha1/public/fake/fake_cluster.go is excluded by !**/generated/**
  • clientset/generated/typed/v1alpha1/public/fake/fake_v1alpha1_client.go is excluded by !**/generated/**
  • clientset/generated/typed/v1alpha1/public/v1alpha1_client.go is excluded by !**/generated/**
📒 Files selected for processing (5)
  • api/v1alpha1/public/cluster_types.go
  • clientset/hyperfleet.go
  • clientset/wrappers/wire_wrappers_generated.go
  • hack/clientset/cmd/wire-gen/main.go
  • test/e2e-sdk/sdk_sanity_test.go
🚧 Files skipped from review as they are similar to previous changes (3)
  • clientset/hyperfleet.go
  • clientset/wrappers/wire_wrappers_generated.go
  • hack/clientset/cmd/wire-gen/main.go

Walkthrough

The Cluster resource is marked non-namespaced. Client generation and wrappers now expose Clusters() without a namespace. SDK examples and end-to-end tests use the updated accessor.

Changes

Cluster client access

Layer / File(s) Summary
Declare Cluster as non-namespaced
api/v1alpha1/cluster_types.go, api/v1alpha1/public/cluster_types.go
Cluster API types include the +genclient:nonNamespaced marker.
Generate resource-specific accessors
hack/clientset/cmd/wire-gen/main.go
The generator detects non-namespaced markers and emits namespace-free accessors while preserving namespace parameters for namespaced resources.
Update wrappers and SDK usage
clientset/wrappers/wire_wrappers_generated.go, clientset/hyperfleet.go, test/e2e-sdk/sdk_sanity_test.go
The wrapped client, example, and SDK sanity tests use Clusters() without an account or namespace. NodePool access remains cluster-scoped.

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

Sequence Diagram(s)

sequenceDiagram
  participant ClusterResource
  participant WireGenerator
  participant ClusterClient
  ClusterResource->>WireGenerator: provide nonNamespaced marker
  WireGenerator->>ClusterClient: generate Clusters() accessor
Loading

Possibly related PRs

Suggested reviewers: cdoan1, typeid

🚥 Pre-merge checks | ✅ 10 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Ai-Attribution ⚠️ Warning CodeRabbit is mentioned in the PR context, but the sole PR commit has no Assisted-by or Generated-by trailer. Add a Red Hat-approved Assisted-by or Generated-by trailer to the PR commit; do not use Co-Authored-By for the AI tool.
✅ Passed checks (10 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: configuring clusters as non-namespaced for client generation.
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.
No-Weak-Crypto ✅ Passed The pull-request changes only client-generation annotations and accessors; no weak crypto APIs, custom crypto, or secret comparisons were added.
Container-Privileges ✅ Passed The PR changes no YAML, JSON, Dockerfile, or Containerfile paths, and added-line scans found no prohibited container privilege settings.
No-Sensitive-Data-In-Logs ✅ Passed The PR adds no logging or output statements and does not alter log payloads; changes only adjust client accessors and code-generation markers.
No-Hardcoded-Secrets ✅ Passed The commit adds only client-generation markers, accessor code, empty namespace literals, and example identifiers; scans found no secrets, credential URLs, private keys, or long base64 literals.
No-Injection-Vectors ✅ Passed The patch only changes client accessors, annotations, and generator logic; no flagged SQL, eval/exec, unsafe YAML/pickle, os.system, shell=True, or HTML injection vector was introduced.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@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

🧹 Nitpick comments (1)
test/e2e-sdk/sdk_sanity_test.go (1)

671-671: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Remove the obsolete customerAccountID parameter.

deleteCluster now uses the platform-scoped client at Line [671] and does not read customerAccountID. Remove the parameter and update both callers. This keeps the helper contract aligned with the non-namespaced API.

🤖 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 `@test/e2e-sdk/sdk_sanity_test.go` at line 671, Remove the unused
customerAccountID parameter from deleteCluster, then update both deleteCluster
call sites to use its revised signature. Keep the platform-scoped Clusters
client flow unchanged.
🤖 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 `@hack/clientset/cmd/wire-gen/main.go`:
- Around line 209-214: Preserve the existing public Clusters(namespace string)
API across all generated layers. In hack/clientset/cmd/wire-gen/main.go lines
209-214, emit the namespaced-compatible interface signature; in lines 230-238,
make the generated implementation use that same signature while delegating to
w.inner.Clusters(). Apply the corresponding interface and implementation
signature updates in clientset/wrappers/wire_wrappers_generated.go lines 235 and
252-253.

---

Nitpick comments:
In `@test/e2e-sdk/sdk_sanity_test.go`:
- Line 671: Remove the unused customerAccountID parameter from deleteCluster,
then update both deleteCluster call sites to use its revised signature. Keep the
platform-scoped Clusters client flow unchanged.
🪄 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: openshift-online/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: ae72e998-ad25-48bd-ab68-4dfe4fc9be1e

📥 Commits

Reviewing files that changed from the base of the PR and between afde279 and 857222e.

⛔ Files ignored due to path filters (4)
  • clientset/generated/typed/v1alpha1/internalversion/cluster.go is excluded by !**/generated/**
  • clientset/generated/typed/v1alpha1/internalversion/fake/fake_cluster.go is excluded by !**/generated/**
  • clientset/generated/typed/v1alpha1/internalversion/fake/fake_v1alpha1_client.go is excluded by !**/generated/**
  • clientset/generated/typed/v1alpha1/internalversion/v1alpha1_client.go is excluded by !**/generated/**
📒 Files selected for processing (5)
  • clientset/hyperfleet.go
  • clientset/wrappers/wire_wrappers_generated.go
  • hack/clientset/cmd/wire-gen/main.go
  • hyperfleet-operator/api/v1alpha1/cluster_types.go
  • test/e2e-sdk/sdk_sanity_test.go

Comment thread hack/clientset/cmd/wire-gen/main.go
@gdbranco
gdbranco force-pushed the feat/rosaeng-62596 branch from 857222e to aa84ff0 Compare August 6, 2026 12:35
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@gdbranco
gdbranco force-pushed the feat/rosaeng-62596 branch from aa84ff0 to c6cf933 Compare August 6, 2026 19:28
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@cdoan1 cdoan1 changed the title ROSAENG-62596 | fix: set cluster as non namespaced for client generator ROSAENG-62596: fix: set cluster as non namespaced for client generator Aug 8, 2026
@openshift-ci-robot

openshift-ci-robot commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator

@gdbranco: This pull request references ROSAENG-62596 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 story to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Description

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactoring (no functional changes)
  • CI/CD or tooling change

Testing

  • Unit tests pass (make test)
  • Integration tests pass (if applicable)
  • Manual verification completed

Checklist

  • My code follows the project's coding conventions
  • I have updated documentation as needed
  • I have added tests that prove my fix/feature works
  • All new and existing tests pass

Summary by CodeRabbit

  • New Features

  • Cluster resources can now be accessed without specifying an account or namespace.

  • Client generation now supports resources that are not namespace-scoped while preserving namespace-based access for other resources.

  • Bug Fixes

  • Updated cluster creation, readiness checks, deletion, and usage examples to use the simplified access pattern.

  • Node pool access remains appropriately scoped to its cluster.

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.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Aug 8, 2026
@gdbranco
gdbranco force-pushed the feat/rosaeng-62596 branch from c6cf933 to 568b9ed Compare August 10, 2026 12:37
@cdoan1

cdoan1 commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

/approve

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

cdoan1 commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

/test on-demand-e2e

@cdoan1

cdoan1 commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

/lgtm

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

openshift-ci Bot commented Aug 10, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cdoan1, gdbranco

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-merge-bot
openshift-merge-bot Bot merged commit a1bbdf1 into openshift-online:main Aug 10, 2026
14 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. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants