Skip to content

CONSOLE-5195: Add AI tooling configuration with Claude Code skills#1140

Open
TheRealJon wants to merge 3 commits intoopenshift:mainfrom
TheRealJon:CONSOLE-5189
Open

CONSOLE-5195: Add AI tooling configuration with Claude Code skills#1140
TheRealJon wants to merge 3 commits intoopenshift:mainfrom
TheRealJon:CONSOLE-5189

Conversation

@TheRealJon
Copy link
Copy Markdown
Member

@TheRealJon TheRealJon commented Apr 17, 2026

Configure AI-assisted development and review tooling for console-operator:

  • Add 6 Claude Code skills (1,142 lines) for operator-specific reviews:

    • controller-review: Validate controller factory patterns and ManagementState
    • sync-handler-review: Check incremental reconciliation logic
    • manifest-review: Review RBAC and cluster profile annotations
    • e2e-test-review: Validate test patterns, cleanup, wait logic
    • e2e-test-create: Scaffold new e2e tests with best practices
    • go-quality-review: Detect deprecated APIs and code smells
  • Update CodeRabbit config to use pattern-based skill triggering:

    • Triggers based on code patterns (function signatures, types) not just file paths
    • More accurate detection of controller code, sync handlers, e2e tests
    • References all skills in knowledge base
  • Add comprehensive documentation:

    • .claude/README.md: Skills overview and usage
    • .github/CODERABBIT_SETUP.md: Integration setup guide

Summary by CodeRabbit

  • Documentation

    • Added new review guides for controller reviews, sync handlers, Go quality, unit tests, e2e test creation/review, and manifest validation.
    • Added setup and usage documentation for the integrated code-review skills.
  • Chores

    • Updated review configuration to apply skill-driven, pattern-based automated reviews across code, tests, and manifests.

Configure AI-assisted development and review tooling for console-operator:

- Add 6 Claude Code skills (1,142 lines) for operator-specific reviews:
  - controller-review: Validate controller factory patterns and ManagementState
  - sync-handler-review: Check incremental reconciliation logic
  - manifest-review: Review RBAC and cluster profile annotations
  - e2e-test-review: Validate test patterns, cleanup, wait logic
  - e2e-test-create: Scaffold new e2e tests with best practices
  - go-quality-review: Detect deprecated APIs and code smells

- Update CodeRabbit config to use pattern-based skill triggering:
  - Triggers based on code patterns (function signatures, types) not just file paths
  - More accurate detection of controller code, sync handlers, e2e tests
  - References all skills in knowledge base

- Add comprehensive documentation:
  - .claude/README.md: Skills overview and usage
  - .github/CODERABBIT_SETUP.md: Integration setup guide

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Apr 17, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

openshift-ci-robot commented Apr 17, 2026

@TheRealJon: This pull request references CONSOLE-5195 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:

Configure AI-assisted development and review tooling for console-operator:

  • Add 6 Claude Code skills (1,142 lines) for operator-specific reviews:

  • controller-review: Validate controller factory patterns and ManagementState

  • sync-handler-review: Check incremental reconciliation logic

  • manifest-review: Review RBAC and cluster profile annotations

  • e2e-test-review: Validate test patterns, cleanup, wait logic

  • e2e-test-create: Scaffold new e2e tests with best practices

  • go-quality-review: Detect deprecated APIs and code smells

  • Update CodeRabbit config to use pattern-based skill triggering:

  • Triggers based on code patterns (function signatures, types) not just file paths

  • More accurate detection of controller code, sync handlers, e2e tests

  • References all skills in knowledge base

  • Add comprehensive documentation:

  • .claude/README.md: Skills overview and usage

  • .github/CODERABBIT_SETUP.md: Integration setup guide

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 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 Apr 17, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 17, 2026

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

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 17, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: TheRealJon

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 Apr 17, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 17, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Enterprise

Run ID: 83ec2701-848c-4c8b-b14a-d9ecf9b3f71b

📥 Commits

Reviewing files that changed from the base of the PR and between 5fae849 and 932ae12.

📒 Files selected for processing (1)
  • .claude/skills/e2e-test-create.md
✅ Files skipped from review due to trivial changes (1)
  • .claude/skills/e2e-test-create.md
📜 Recent review details
🧰 Additional context used
🔀 Multi-repo context openshift/console

[::openshift/console::] .coderabbit.yaml

  • Contains knowledge_base.linked_repositories entry for "openshift/console-operator" with explicit instruction: "pkg/serverconfig/types.go is synchronized with console-operator's pkg/console/subresource/consoleserver/types.go - these structs MUST remain in sync." — .coderabbit.yaml lines ~50-56

[::openshift/console::] pkg/serverconfig/types.go

[::openshift/console::] .claude/skills (existing)

  • Directory contains existing skill markdown files (update-package, test, pre-push-review, plugin-api-review, microcopy-review, gen-rtl-test, bug). The PR adds several new top-level skill files; no name collisions were found with current skills in this repo. — listed files under .claude/skills/

Relevance / impact

  • The repository explicitly links to openshift/console-operator and enforces that certain shared structs (serverconfig types) must remain synchronized. The new controller/manifest-related review skills in the PR could produce review guidance that affects console-operator expectations; reviewers should verify the PR's manifest-review and controller-review content does not conflict with the synchronized contract and the operator's existing API/annotations (e.g., ConsolePlugin CRD lifecycle, plugin enablement, operator-managed feature gates).
  • No direct code consumers of the new skill names were found in this repo; the change is documentation/configuration-focused.

Walkthrough

Adds seven Claude Code review skill documents for controller, sync-handler, Go quality, unit/e2e test creation and review, and manifest reviews; updates CodeRabbit configuration to apply those skills by pattern detection; and adds integration documentation for CodeRabbit/Claude setup and CI guidance.

Changes

Cohort / File(s) Summary
Claude review skills
​.claude/skills/controller-review.md, ​.claude/skills/sync-handler-review.md, ​.claude/skills/go-quality-review.md, ​.claude/skills/unit-test-review.md, ​.claude/skills/e2e-test-review.md, ​.claude/skills/e2e-test-create.md, ​.claude/skills/manifest-review.md
Added new markdown skill definitions providing checklists, heuristics, example snippets, and standardized issue-report formats for controller patterns, sync handlers, Go code quality, unit tests, E2E tests, test scaffolding, and Kubernetes manifest reviews.
CodeRabbit configuration
​.coderabbit.yaml
Updated review routing to apply the new skills via pattern detection (Go files, tests, YAML manifests), expanded knowledge-base inclusion of .claude/skills/*.md, and updated rule logic to trigger skills based on detected constructs.
Integration documentation
​.github/CODERABBIT_SETUP.md
New documentation describing the Claude Code + CodeRabbit integration, skill intents and CLI usage, pattern-driven review behavior, CI skip guidance for tooling-only changes, and procedures for editing/testing skills.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 11 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description comprehensively covers the changes (6 skills, CodeRabbit updates, documentation) but does not follow the required template structure with Analysis, Solution, Test cases, Browser conformance, and Reviewers sections. Restructure the description to match the template: add Analysis/Root cause section, organize Solution description to clearly map to the template, include Test setup and Test cases sections, add Browser conformance checkboxes, and include Reviewers and assignees guidance.
✅ Passed checks (11 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically summarizes the main change: adding AI tooling configuration with Claude Code skills for the console-operator.
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.
Stable And Deterministic Test Names ✅ Passed PR introduces only documentation, configuration, and code templates with static, descriptive test names. No actual Ginkgo tests or dynamic/generated test code are modified.
Test Structure And Quality ✅ Passed PR adds documentation in .claude/skills/ without modifying test code; e2e-test-create.md demonstrates Go testing best practices including defer cleanup, timeouts, wait.Poll, and meaningful error messages.
Microshift Test Compatibility ✅ Passed This PR does not add any new executable Ginkgo e2e tests. The PR introduces documentation and configuration files only: six Claude Code skill documents (markdown files) that provide guidance and templates for reviewing and creating tests, along with CodeRabbit configuration updates. The existing e2e test files in test/e2e/*.go remain unchanged. Since no new test implementations are being added to the codebase, there are no Ginkgo tests to evaluate for MicroShift compatibility.
Single Node Openshift (Sno) Test Compatibility ✅ Passed This pull request does not add any new Ginkgo e2e tests to the codebase. The PR contains only documentation files, configuration updates, and guidance templates. No actual Ginkgo test patterns are being introduced.
Topology-Aware Scheduling Compatibility ✅ Passed PR introduces only documentation and configuration files for AI-assisted code review tooling; no deployment manifests, operator controller code, or scheduling constraints were added or modified.
Ote Binary Stdout Contract ✅ Passed PR adds only documentation and configuration files, making no modifications to Go source code or test files, thus introducing no new OTE Binary Stdout Contract violations.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed PR adds only documentation, templates, and configuration files for AI-assisted code review tooling. No new Ginkgo e2e test code is being added.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Review rate limit: 9/10 reviews remaining, refill in 6 minutes.

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

@openshift-ci-robot
Copy link
Copy Markdown
Contributor

openshift-ci-robot commented Apr 17, 2026

@TheRealJon: This pull request references CONSOLE-5195 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:

Configure AI-assisted development and review tooling for console-operator:

  • Add 6 Claude Code skills (1,142 lines) for operator-specific reviews:

  • controller-review: Validate controller factory patterns and ManagementState

  • sync-handler-review: Check incremental reconciliation logic

  • manifest-review: Review RBAC and cluster profile annotations

  • e2e-test-review: Validate test patterns, cleanup, wait logic

  • e2e-test-create: Scaffold new e2e tests with best practices

  • go-quality-review: Detect deprecated APIs and code smells

  • Update CodeRabbit config to use pattern-based skill triggering:

  • Triggers based on code patterns (function signatures, types) not just file paths

  • More accurate detection of controller code, sync handlers, e2e tests

  • References all skills in knowledge base

  • Add comprehensive documentation:

  • .claude/README.md: Skills overview and usage

  • .github/CODERABBIT_SETUP.md: Integration setup guide

Summary by CodeRabbit

  • Documentation

  • Added AI-assisted code review configuration and setup guide for improved automated code quality checks.

  • Introduced structured review guidelines for controller implementations, end-to-end tests, Kubernetes manifests, and Go code quality standards.

  • Configured pattern-driven code review triggering to automatically apply relevant review checklists based on code type.

  • Chores

  • Established CI/CD integration between CodeRabbit and Claude Code with skip conditions for tooling-only changes.

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.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.coderabbit.yaml (1)

29-31: ⚠️ Potential issue | 🟠 Major

*_test.go is globally excluded, so e2e test skills won’t trigger.

Line 31 (!**/*_test.go) conflicts with the new test path instructions (Line 66+). As written, CodeRabbit won’t review test files, so /e2e-test-review and /e2e-test-create guidance is effectively disabled.

Suggested config fix
   path_filters:
   - "!vendor/**"
-  - "!**/*_test.go"

Also applies to: 66-89

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.coderabbit.yaml around lines 29 - 31, The global exclusion pattern in
path_filters ("!**/*_test.go") prevents any test file reviews and disables the
/e2e-test-review and /e2e-test-create flows; remove or narrow that pattern in
path_filters and instead either (a) delete "!**/*_test.go" and rely on the
specific test includes described later, or (b) replace it with a more specific
exclusion (e.g., only unit tests) and/or add explicit include patterns for your
e2e test paths (e.g., "e2e/**" or the exact e2e directories) so that the
e2e-test-review/e2e-test-create rules can match; update the path_filters block
and keep references consistent with the existing path filters and the e2e test
instructions so tests are no longer globally excluded.
🧹 Nitpick comments (1)
.claude/skills/e2e-test-review.md (1)

68-69: Prefer framework timeout constants over hardcoded durations in examples.

Use framework.AsyncOperationTimeout in examples instead of fixed 5*time.Minute so generated tests stay aligned with the repo’s e2e framework defaults.

Suggested doc fix
-err := wait.Poll(1*time.Second, 5*time.Minute, func() (bool, error) {
+err := wait.Poll(1*time.Second, framework.AsyncOperationTimeout, func() (bool, error) {
...
-ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)
+ctx, cancel := context.WithTimeout(context.Background(), framework.AsyncOperationTimeout)

Also applies to: 99-100

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.claude/skills/e2e-test-review.md around lines 68 - 69, Replace the
hardcoded timeout in the wait.Poll call with the repository's e2e framework
constant: change the second argument currently set to 5*time.Minute to
framework.AsyncOperationTimeout so examples use the shared
AsyncOperationTimeout; update any other occurrences (e.g., the other two places
noted) where 5*time.Minute is used with wait.Poll to use
framework.AsyncOperationTimeout as well, keeping the wait.Poll call and callback
(deployment retrieval via client.AppsV1().Deployments(ns).Get) unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.claude/skills/e2e-test-create.md:
- Around line 68-69: The template uses the incorrect type name "Clientset" which
should match the repo's existing type "ClientSet"; update every occurrence of
"*framework.Clientset" to "*framework.ClientSet" in the e2e test scaffold
signatures (e.g., the function parameter lists shown alongside modify
func(*operatorv1.Console)) and any other examples at the noted locations so
copy-pasted code compiles against the repository's framework package.
- Around line 103-107: Implement the cleanupResources helper to actually delete
resources in reverse creation order and ignore NotFound errors: inside
cleanupResources(ctx := context.Background(), t *testing.T, client
*framework.Clientset) iterate teardown steps in reverse (e.g., delete pods,
services, deployments, namespaces in reverse of creation), call the client
deletion methods (from framework.Clientset) and for each deletion check the
returned error and treat a NotFound error as non-fatal (log it via t.Logf) while
failing the test on other errors (t.Fatalf or t.Error); ensure the function
signature and usages reference cleanupResources, context.Background, t
*testing.T and framework.Clientset so callers remain compatible.

In @.claude/skills/go-quality-review.md:
- Around line 229-238: The "bad" example has a type mismatch: getNamespace() is
declared to return string but returns a []byte; update the function getNamespace
to return a string (e.g., return "openshift-console") or explicitly convert the
byte slice to string (e.g., return string([]byte("openshift-console"))) so the
return type matches the signature and the example compiles; prefer the simpler
constant/string literal to illustrate avoiding unnecessary allocations.

In @.claude/skills/manifest-review.md:
- Around line 54-61: The ServiceAccount example under "Service Account
References" uses `name: console` and `namespace: openshift-console`, which is
inconsistent with this repo’s RBAC pattern; update the example to reference the
operator service account used in cross-namespace bindings (e.g., `name:
console-operator` and `namespace: openshift-console-operator`) and adjust the
surrounding text to note the operator SA convention when demonstrating
`subjects:` -> `- kind: ServiceAccount` entries to avoid misleading guidance.

In @.github/CODERABBIT_SETUP.md:
- Around line 27-30: The fenced code block containing the lines
"/controller-review" and "/e2e-test-review" uses an untyped triple-backtick
fence; update that opening fence to include the language identifier "bash"
(i.e., change ``` to ```bash) so the block reads as a bash code block for
markdownlint MD040 compliance and proper rendering.

---

Outside diff comments:
In @.coderabbit.yaml:
- Around line 29-31: The global exclusion pattern in path_filters
("!**/*_test.go") prevents any test file reviews and disables the
/e2e-test-review and /e2e-test-create flows; remove or narrow that pattern in
path_filters and instead either (a) delete "!**/*_test.go" and rely on the
specific test includes described later, or (b) replace it with a more specific
exclusion (e.g., only unit tests) and/or add explicit include patterns for your
e2e test paths (e.g., "e2e/**" or the exact e2e directories) so that the
e2e-test-review/e2e-test-create rules can match; update the path_filters block
and keep references consistent with the existing path filters and the e2e test
instructions so tests are no longer globally excluded.

---

Nitpick comments:
In @.claude/skills/e2e-test-review.md:
- Around line 68-69: Replace the hardcoded timeout in the wait.Poll call with
the repository's e2e framework constant: change the second argument currently
set to 5*time.Minute to framework.AsyncOperationTimeout so examples use the
shared AsyncOperationTimeout; update any other occurrences (e.g., the other two
places noted) where 5*time.Minute is used with wait.Poll to use
framework.AsyncOperationTimeout as well, keeping the wait.Poll call and callback
(deployment retrieval via client.AppsV1().Deployments(ns).Get) unchanged.
🪄 Autofix (Beta)

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 YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 91de28cb-00fc-4b44-a66a-e1211c08b9f6

📥 Commits

Reviewing files that changed from the base of the PR and between f061939 and 6020ab5.

📒 Files selected for processing (9)
  • .claude/README.md
  • .claude/skills/controller-review.md
  • .claude/skills/e2e-test-create.md
  • .claude/skills/e2e-test-review.md
  • .claude/skills/go-quality-review.md
  • .claude/skills/manifest-review.md
  • .claude/skills/sync-handler-review.md
  • .coderabbit.yaml
  • .github/CODERABBIT_SETUP.md
📜 Review details
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: CR
URL: 
File: .claude/skills/e2e-test-create.md:undefined-undefined
Timestamp: 2026-04-17T14:09:10.706Z
Learning: Test both success and failure paths in e2e tests
Learnt from: CR
URL: 
File: .claude/skills/e2e-test-create.md:undefined-undefined
Timestamp: 2026-04-17T14:09:10.706Z
Learning: Verify operator responds to config changes in e2e tests
Learnt from: CR
URL: 
File: .claude/skills/e2e-test-create.md:undefined-undefined
Timestamp: 2026-04-17T14:09:10.706Z
Learning: Check ClusterOperator status conditions in e2e tests
Learnt from: CR
URL: 
File: .claude/skills/e2e-test-create.md:undefined-undefined
Timestamp: 2026-04-17T14:09:10.706Z
Learning: Clean up resources in reverse order of creation in e2e tests
Learnt from: CR
URL: 
File: .claude/skills/sync-handler-review.md:undefined-undefined
Timestamp: 2026-04-17T14:09:49.416Z
Learning: Implement incremental sync patterns where operators use early returns on errors rather than collecting multiple errors and continuing execution
🪛 LanguageTool
.claude/README.md

[uncategorized] ~138-~138: The official name of this software platform is spelled with a capital “H”.
Context: ... repository for cross-repo context See .github/CODERABBIT_SETUP.md for complete integ...

(GITHUB)

🪛 markdownlint-cli2 (0.22.0)
.github/CODERABBIT_SETUP.md

[warning] 27-27: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🔀 Multi-repo context openshift/console

[::openshift/console::] .claude directory present at repository root; contains many existing skill files and settings:

  • .claude/settings.json (references to CLI/version) — found in search output line: .claude/settings.json:63
  • Multiple skill files under .claude/skills/ (examples found in search):
    • .claude/skills/pre-push-review/SKILL.md (numerous CodeRabbit integration instructions and CLI commands) — multiple matches in search output
    • .claude/skills/microcopy-review/SKILL.md — referenced in search output
    • .claude/skills/update-package/SKILL.md — referenced in search output

[::openshift/console::] .coderabbit.yaml exists at repository root (search hit: .coderabbit.yaml:1) — indicates repository already integrates with CodeRabbit/skill-trigger configuration.

Implication: This repository already contains a .claude skillset and CodeRabbit configuration; adding the new Claude Code skills and updates described in the PR will extend existing tooling rather than introduce an entirely new integration surface. Recommend reviewers check .coderabbit.yaml and the .claude/skills/ directory for overlapping triggers, duplicate skill names, and CI skip patterns.

🔇 Additional comments (14)
.claude/README.md (1)

96-138: Solid integration documentation.

The usage + wiring explanation is clear and matches the skill-based setup introduced in this PR.

.claude/skills/controller-review.md (1)

18-41: LGTM for controller-pattern guidance.

The ManagementState/status/resourceapply checks are well scoped for this codebase.

Also applies to: 64-78

.claude/skills/sync-handler-review.md (1)

75-76: The snippet is correct as-is; both AddCondition and AddConditions are valid API methods.

The AddCondition method exists in pkg/console/status/status.go:171 and is actively used throughout the codebase. The difference between the two methods is semantic: AddCondition takes a single ConditionUpdate, while AddConditions takes a slice. The documented example correctly uses AddCondition for a single condition, matching real usage patterns in the codebase (e.g., sync_v400.go:227). No change is needed.

			> Likely an incorrect or invalid review comment.
.claude/skills/go-quality-review.md (11)

1-5: LGTM!

The YAML frontmatter follows standard skill definition conventions with clear name, description, and appropriate tags.


11-42: LGTM!

The deprecated API examples are accurate. The ioutil package was deprecated in Go 1.16, and the modern alternatives using os.ReadFile, os.WriteFile, io.ReadAll, and context-aware dialing are correct best practices.


44-83: LGTM!

Error handling guidance is sound: %w for error wrapping preserves the error chain, contextual error messages improve debugging, and predicate-based error checks (e.g., apierrors.IsNotFound) are more robust than string matching.


85-131: LGTM!

Resource management examples correctly demonstrate context propagation (avoiding context.Background() when a parent context exists) and proper defer placement to prevent resource leaks on early returns.


133-208: LGTM!

Code smell detection covers important maintainability patterns: function size limits, named constants with context, and early returns to reduce nesting. All examples demonstrate Go best practices effectively.


212-227: LGTM!

The strings.Builder example correctly demonstrates efficient string concatenation compared to repeated string concatenation in loops.


240-262: LGTM!

Concurrency example correctly demonstrates protecting shared map access with sync.RWMutex and using defer for unlock safety.


264-282: LGTM!

Testing guidance correctly emphasizes checking errors in test code rather than using the blank identifier, with appropriate use of t.Fatalf for setup errors and t.Errorf for assertion failures.


284-299: LGTM!

Documentation section correctly demonstrates godoc conventions for exported functions, with the comment starting with the function name and explaining parameters.


301-308: LGTM!

The output format specification is clear and well-structured, providing consistent fields (File:Line, Issue, Category, Fix, Priority) for review comments.


310-318: LGTM!

Example review comments effectively demonstrate the structured output format at different priority levels with realistic scenarios.

Comment thread .claude/skills/e2e-test-create.md Outdated
Comment thread .claude/skills/e2e-test-create.md Outdated
Comment thread .claude/skills/go-quality-review.md
Comment thread .claude/skills/manifest-review.md
Comment thread .github/CODERABBIT_SETUP.md Outdated
Comment thread .claude/skills/manifest-review.md Outdated

# Manifest Review Skill

Review Kubernetes manifest files in `manifests/` and `bindata/assets/` directories.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think we need to also add quickstarts/ and examples/

Comment thread .claude/skills/manifest-review.md
@@ -0,0 +1,318 @@
---
name: go-quality-review
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think we need to add unit-tests section here

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

.... Or maybe as a separate skill

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.

agree, and +1 for a separate skill. Maybe we can ask the agent to use the separate skill from this skill, like a nested call or something similar

Comment thread .claude/skills/e2e-test-create.md Outdated
// Helper functions
func updateOperatorConfig(
ctx context.Context,
client *framework.Clientset,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
client *framework.Clientset,
client *framework.ClientSet,

Comment thread .claude/skills/e2e-test-create.md Outdated
func waitForCondition(
ctx context.Context,
t *testing.T,
client *framework.Clientset,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
client *framework.Clientset,
client *framework.ClientSet,

Comment thread .claude/skills/e2e-test-create.md Outdated
// Ignore NotFound errors
}

func verifyExpectedState(t *testing.T, client *framework.Clientset) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
func verifyExpectedState(t *testing.T, client *framework.Clientset) {
func verifyExpectedState(t *testing.T, client *framework.ClientSet) {

Comment thread .claude/skills/e2e-test-create.md Outdated
defer cancel()

// Get initial operator config
operatorConfig := framework.GetOperatorConfig(t, client.OperatorClient)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

framework.GetOperatorConfig does not exists in the codebase

Comment thread .claude/skills/go-quality-review.md Outdated
```go
// Bad - allocates on every call
func (c *Controller) getNamespace() string {
return []byte("openshift-console")[0:] // Unnecessary allocation
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The "unnecessary allocations" bad example returns []byte from a function declared as string:

  func (c *Controller) getNamespace() string {
      return []byte("openshift-console")[0:] // This is []byte, not string
  }

Should use string([]byte("openshift-console")) or a more realistic example.

Comment thread .claude/skills/manifest-review.md
Comment thread .github/CODERABBIT_SETUP.md Outdated
- Integrates with openshift/console repository context
- Provides operator-specific review guidelines

### Pattern-Based Skill Triggering
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Replace "Pattern-Based Skill Triggering" with something like "Pattern-Based Review Guidelines" and clarify that CodeRabbit embeds the skill content as reviewer instructions - it doesn't call Claude Code.

Issue is that the docs imply CodeRabbit executes Claude Code skills at runtime, which it doesn't - it just inlines the instruction text during review. I'd reword the comments and docs to say CodeRabbit references" or "applies review guidelines from" the skills, not "triggers" them. The .coderabbit.yaml header comment could say:

  # Skills provide review checklists that CodeRabbit includes as
  # path_instructions when reviewing matching files.
  # They are also usable interactively via Claude Code (e.g. /controller-review).

Comment thread .claude/README.md Outdated
@@ -0,0 +1,156 @@
# Claude Code Configuration for Console Operator
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Based on the discussion with Claude 🤖 we should remove this file:
The skill files and CODERABBIT_SETUP.md already cover everything the README says. Removing it eliminates a maintenance burden with no loss of functionality or discoverability.

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.

Also if there are too much instruction been fed at first, whether it will remember all the context or hullucinate?

@TheRealJon TheRealJon marked this pull request as ready for review April 21, 2026 17:34
@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 Apr 21, 2026
@openshift-ci openshift-ci Bot requested review from jhadvig and spadgett April 21, 2026 17:34
Fix issues identified by CodeRabbit and jhadvig:
- Remove test file exclusion from .coderabbit.yaml (enables skill application)
- Replace non-existent framework.GetOperatorConfig with actual pattern
- Update ServiceAccount examples to show both operator and console SA patterns
- Add quickstarts/ and examples/ directories to manifest-review scope
- Replace hardcoded timeouts with framework.AsyncOperationTimeout
- Fix go-quality-review type mismatch in allocation example
- Clarify CodeRabbit integration language (applies vs triggers)
- Remove redundant .claude/README.md (already deleted)

Add comprehensive unit-test-review skill:
- Table-driven test patterns matching repo conventions
- Deep equality checks using go-test/deep
- Error handling with wantErr pattern
- Edge case coverage guidelines
- Test isolation and assertion quality
- Integrated into .coderabbit.yaml and CODERABBIT_SETUP.md

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

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)
.coderabbit.yaml (1)

120-123: Align scoped manifest checks with the declared manifest skill coverage.

This block adds extra checks only for quickstarts/, but .claude/skills/manifest-review.md also scopes review to bindata/assets/ and examples/. Expanding this avoids drift between routing guidance and skill contract.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.coderabbit.yaml around lines 120 - 123, The config currently adds extra
scoped checks only for "quickstarts/" but the skill contract in
.claude/skills/manifest-review.md declares scope should include bindata/assets/
and examples/ as well; update the block that lists quickstarts checks to include
bindata/assets/ and examples/ so the routing/guidance matches the
manifest-review.md contract, making sure the entries (the bullet list that
starts with "For quickstarts/, additionally check:") mention those two paths and
the same checklist items (spec structure, task descriptions/prerequisites,
README guidelines).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.coderabbit.yaml:
- Around line 49-55: Update the apply rule for /sync-handler-review so its
resource sequencing list includes Service Accounts, RBAC, and Services in the
correct reconciliation order; specifically modify the items after
ConfigMaps/Secrets to read: ConfigMaps/Secrets → Service Accounts → RBAC →
Services → Deployments → Routes (so the rule that matches "Main operator sync
functions" and the bullet list with "Dependency ordering of ConfigMaps → Secrets
→ Deployments → Routes" is expanded to include the missing resources).

---

Nitpick comments:
In @.coderabbit.yaml:
- Around line 120-123: The config currently adds extra scoped checks only for
"quickstarts/" but the skill contract in .claude/skills/manifest-review.md
declares scope should include bindata/assets/ and examples/ as well; update the
block that lists quickstarts checks to include bindata/assets/ and examples/ so
the routing/guidance matches the manifest-review.md contract, making sure the
entries (the bullet list that starts with "For quickstarts/, additionally
check:") mention those two paths and the same checklist items (spec structure,
task descriptions/prerequisites, README guidelines).
🪄 Autofix (Beta)

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 YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 508462cc-d3c7-44c9-9868-9a1cf715a135

📥 Commits

Reviewing files that changed from the base of the PR and between 6020ab5 and 5fae849.

📒 Files selected for processing (7)
  • .claude/skills/e2e-test-create.md
  • .claude/skills/e2e-test-review.md
  • .claude/skills/go-quality-review.md
  • .claude/skills/manifest-review.md
  • .claude/skills/unit-test-review.md
  • .coderabbit.yaml
  • .github/CODERABBIT_SETUP.md
✅ Files skipped from review due to trivial changes (6)
  • .claude/skills/manifest-review.md
  • .claude/skills/e2e-test-review.md
  • .github/CODERABBIT_SETUP.md
  • .claude/skills/go-quality-review.md
  • .claude/skills/e2e-test-create.md
  • .claude/skills/unit-test-review.md
📜 Review details
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: CR
Repo: openshift/console-operator

Timestamp: 2026-04-23T20:39:31.521Z
Learning: Sync resources in dependency order: ConfigMaps/Secrets → Service Accounts → RBAC → Services → Deployments → Routes
Learnt from: CR
Repo: openshift/console-operator

Timestamp: 2026-04-23T20:39:31.521Z
Learning: Respect ManagementState in sync handlers and implement proper cleanup logic for Removed state
🔀 Multi-repo context openshift/console

[::openshift/console::] .coderabbit.yaml present at repo root (shows CodeRabbit/Claude integration and existing knowledge_base linked_repositories). Relevant excerpt: knowledge_base.linked_repositories includes "openshift/console-operator" with instructions noting pkg/serverconfig/types.go must remain in sync with console-operator's types — flagging that operator skill changes should consider this existing cross-repo contract.

[::openshift/console::] .claude/settings.json present (.claude/settings.json) — contains CLI permissions and allowed/denied actions used by skills (may affect what the new skills can run/ask). No changes to this file in the PR were reported.

[::openshift/console::] .claude/skills directory exists and currently contains only subdirectories (bug, gen-rtl-test, microcopy-review, plugin-api-review, pre-push-review, test, update-package). No existing top-level skill files with the names introduced in the PR were found.

[::openshift/console::] Repository-wide search (ripgrep) found no references to the new skill names (controller-review, sync-handler-review, manifest-review, e2e-test-review, e2e-test-create, go-quality-review, unit-test-review). That indicates the PR will be adding new skill files rather than clobbering existing named artifacts in this repo.

Implications for reviewers:

  • The repo already integrates with CodeRabbit and links to openshift/console-operator; the new skills and pattern-based triggers should be reviewed for overlap/duplication with existing skills under .claude/skills/* and for consistency with the existing knowledge_base instructions that call out console-operator synchronization.
  • Because the knowledge_base links console-operator and calls out synchronized structs, reviewers should check the PR’s manifest-review and controller-related skills for guidance that could produce cross-repo review comments (console-operator consumers) or encourage changes that break the synchronized contract.

Conclusion: found relevant cross-repo linkage (openshift/console-operator) and confirmed no collisions with existing skill names in this repo.

🔇 Additional comments (2)
.coderabbit.yaml (2)

133-139: Good integration: skill docs are now part of code-guideline ingestion.

Adding .claude/skills/*.md to knowledge_base.code_guidelines.filePatterns should improve consistency between skill definitions and review behavior.


101-101: Reconsider adding *.yml to manifest-review routing.

While the repo does contain one .yml file (frontend/graphql-codegen.yml), it is a GraphQL code generation configuration, not a Kubernetes manifest. The **/*.yaml pattern correctly targets actual manifests; expanding to **/*.yml would unnecessarily include non-manifest tool configuration files in RBAC/annotation checks. Verify that all intended manifests use the .yaml extension, or add .yml only if there are actual manifest files that require coverage.

Comment thread .coderabbit.yaml
Comment on lines +49 to +55
**Apply /sync-handler-review when code contains:**
- Main operator sync functions (e.g., `sync_v400.go` content)
- Sequential resource syncing with early returns
- Incremental reconciliation loops
- Multiple `resourceapply.Apply*()` calls in sequence
- Dependency ordering of ConfigMaps → Secrets → Deployments → Routes
- Feature gate conditional logic
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Update sync dependency order to match operator reconciliation contracts.

Line 54 omits Service Accounts, RBAC, and Services, which can cause /sync-handler-review to suggest incorrect sequencing.

🔧 Proposed fix
-        - Dependency ordering of ConfigMaps → Secrets → Deployments → Routes
+        - Dependency ordering of ConfigMaps/Secrets → Service Accounts → RBAC → Services → Deployments → Routes

Based on learnings: Sync resources in dependency order: ConfigMaps/Secrets → Service Accounts → RBAC → Services → Deployments → Routes.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.coderabbit.yaml around lines 49 - 55, Update the apply rule for
/sync-handler-review so its resource sequencing list includes Service Accounts,
RBAC, and Services in the correct reconciliation order; specifically modify the
items after ConfigMaps/Secrets to read: ConfigMaps/Secrets → Service Accounts →
RBAC → Services → Deployments → Routes (so the rule that matches "Main operator
sync functions" and the bullet list with "Dependency ordering of ConfigMaps →
Secrets → Deployments → Routes" is expanded to include the missing resources).

@TheRealJon
Copy link
Copy Markdown
Member Author

/label tide/merge-method-squash

@openshift-ci openshift-ci Bot added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label Apr 24, 2026
Copy link
Copy Markdown
Contributor

@Leo6Leo Leo6Leo left a comment

Choose a reason for hiding this comment

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

@TheRealJon woops I forgot to hit submit review 🤯🤣

Comment thread .claude/skills/e2e-test-create.md Outdated
modify func(*operatorv1.Console),
) error {
return retry.RetryOnConflict(retry.DefaultBackoff, func() error {
config, err := client.OperatorClient.Consoles().Get(
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.

In the codebase it is supposed to be client.Operator.Consoles().Get()

Suggested change
config, err := client.OperatorClient.Consoles().Get(
config, err := client.Operator.Consoles().Get(

Comment thread .claude/skills/e2e-test-create.md Outdated
return err
}
modify(config)
_, err = client.OperatorClient.Consoles().Update(
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.

In the codebase it is supposed to be client.Operator.Consoles().Update()

Suggested change
_, err = client.OperatorClient.Consoles().Update(
_, err = client.Operator.Consoles().Update(

Comment thread .claude/skills/e2e-test-create.md Outdated
) error {
return wait.Poll(1*time.Second, 2*time.Minute, func() (bool, error) {
// Check for expected condition
deployment, err := client.KubeClient.AppsV1().Deployments(
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.

E2E templates use client.KubeClient.AppsV1() and client.OperatorClient.Consoles() but framework.ClientSet has fields Apps and Operator — scaffolded e2e tests won't compile. (The kubeClient.AppsV1() pattern is valid in controller code using kubernetes.Interface, just not on the e2e ClientSet.)

Comment on lines +190 to +195
Service: consolev1.ConsolePluginService{
Name: "plugin-service",
Namespace: "plugin-namespace",
Port: 8443,
BasePath: "/",
},
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.

Comment thread .claude/skills/e2e-test-create.md Outdated
func TestYourFeature(t *testing.T) {
// Setup client
client := framework.MustNewClientset(t, nil)
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)
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.

every single client.Operator.Consoles().Get(...) call passes context.TODO()

@@ -0,0 +1,318 @@
---
name: go-quality-review
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.

agree, and +1 for a separate skill. Maybe we can ask the agent to use the separate skill from this skill, like a nested call or something similar

Comment thread .claude/README.md Outdated
@@ -0,0 +1,156 @@
# Claude Code Configuration for Console Operator
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.

Also if there are too much instruction been fed at first, whether it will remember all the context or hullucinate?

Corrected hallucinated APIs to match test/e2e/framework:
- client.OperatorClient → client.Operator
- client.KubeClient.AppsV1() → client.Apps
- client.KubeClient.CoreV1() → client.Core
- client.ConsoleClient.ConsoleV1() → client.ConsolePluginV1

Updated patterns to use framework.StandardSetup/StandardCleanup
instead of manual client setup. Added comprehensive Framework API
Reference documenting all ClientSet interfaces and helper functions.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@TheRealJon
Copy link
Copy Markdown
Member Author

/retest-required

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 6, 2026

@TheRealJon: all tests passed!

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.

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. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants