Skip to content

NO-ISSUE: Add claude md file for using the node_utils and export util functions#31078

Open
ngopalak-redhat wants to merge 1 commit intoopenshift:mainfrom
ngopalak-redhat:ngopalak/util_function_node_help_claude
Open

NO-ISSUE: Add claude md file for using the node_utils and export util functions#31078
ngopalak-redhat wants to merge 1 commit intoopenshift:mainfrom
ngopalak-redhat:ngopalak/util_function_node_help_claude

Conversation

@ngopalak-redhat
Copy link
Copy Markdown
Contributor

@ngopalak-redhat ngopalak-redhat commented Apr 27, 2026

Adds Claude.md file so that the node_utils functions are used by the team when developing test cases with Claude.
Currently I see some duplicate code and this is one way to reduce it.

I have to refactor the functions to use capital letter to start so that they look like the utility functions and other can notice it and use it.

Later we can add some github action or makefile change that will automatically keep the Claude.md file updated.

Summary by CodeRabbit

  • Tests

    • Added an automated check to ensure testing documentation stays synchronized with test utilities and to warn on missing entries.
    • Standardized test suites to use the updated, consistent test helper interfaces.
  • Documentation

    • Added a comprehensive developer-facing guide for node E2E testing with workflows, helper usage, common pitfalls, and reference pointers.

@openshift-merge-bot
Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: automatic mode

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 27, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Exports many previously unexported node test helpers in test/extended/node/node_utils.go, updates test call sites to use the exported names, adds a developer-facing node E2E guide (test/extended/node/CLAUDE.md), and adds a Bash check (test/extended/node/claude-docs-check.sh) that verifies documentation coverage of exported helpers.

Changes

Node utilities export, tests wiring, docs, and validation

Layer / File(s) Summary
API / Package docs
test/extended/node/node_utils.go
Added package-level comment and renamed many helper functions from unexported to exported (PascalCase), exposing selection, kubelet config, drop-in management, kubelet lifecycle, CNV and MCP helpers.
Internal rewiring
test/extended/node/node_utils.go
Updated internal call sites within the file to use the new exported names (e.g., GetNodesByLabel, WaitForNodeToBeReady, WaitForMCP, CleanupDropInAndRestartKubelet). No behavioral changes.
Tests / Wiring
test/extended/node/node_sizing.go, test/extended/node/node_swap.go, test/extended/node/node_swap_cnv.go, test/extended/node/system_compressible.go
Replaced calls to unexported helpers with the exported PascalCase names across test files (e.g., GetKubeletConfigFromNode, GetPureWorkerNodes, GetWorkerGeneratedKubeletMC, CNV helpers). No control-flow or assertion changes.
Documentation
test/extended/node/CLAUDE.md
New developer-facing guide listing node E2E principles, helper functions, common pitfalls, and pointers to examples/tests.
Docs validation script
test/extended/node/claude-docs-check.sh
New Bash script that extracts exported identifiers from node_utils.go, checks CLAUDE.md for whole-word occurrences, prints missing names and exits non‑zero if any are absent; prints success otherwise.

Sequence Diagram(s)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 12
✅ Passed checks (12 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main changes: adding a Claude.md documentation file and exporting utility functions from node_utils for improved discoverability and reuse.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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 All Ginkgo test names are stable and deterministic with static, descriptive strings in test titles. Dynamic values in test bodies are appropriate.
Test Structure And Quality ✅ Passed PR refactors test utilities by renaming functions to exported variants and updating call sites, maintaining existing test quality patterns.
Microshift Test Compatibility ✅ Passed This PR does not introduce any new Ginkgo e2e test definitions. All changes are refactoring of existing utility functions and updating existing test code.
Single Node Openshift (Sno) Test Compatibility ✅ Passed Pull request does not add any new Ginkgo e2e tests; changes consist solely of refactoring helper functions and updating existing tests.
Topology-Aware Scheduling Compatibility ✅ Passed All changes are in test directory only; no production deployment manifests, operator code, controllers, or scheduling configurations affected.
Ote Binary Stdout Contract ✅ Passed PR introduces no OTE Binary Stdout Contract violations; no fmt.Print calls found in process-level code, only documentation and test utility changes.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed Pull request modifies existing test files but does not add any new Ginkgo e2e tests, only refactors function names from unexported to exported.

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

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

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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

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

@ngopalak-redhat
Copy link
Copy Markdown
Contributor Author

/assign @harche
Can you review this? To the best of my knowledge this is one way to make sure that the team uses the util functions and reduce duplication while using claude. Not sure if this will work when other AI tools are used.

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: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@test/extended/node/.claude-docs-check.sh`:
- Around line 11-17: The parser for exported functions (UTILS_FUNCS) is too
narrow and the documentation lookup uses substring matching, so update the
extractor and matcher: change the grep/sed pipeline that builds UTILS_FUNCS to
accept optional receiver syntax and digits (e.g., use a regex like '^func(
\([^)]+\) )?[A-Z][A-Za-z0-9_]*' and extract the actual identifier), and replace
the doc existence check (the grep -q "$func" "$CLAUDE_MD") with a word-boundary
or anchoring regex (e.g., grep -q -E "(^|[^A-Za-z0-9_])$func([^A-Za-z0-9_]|$)")
so method names like Exec2 and receiver methods like (c *Client) Exec2 are
discovered and false substring matches are avoided; keep references to
UTILS_FUNCS, NODE_UTILS, CLAUDE_MD, and the for-loop variable func when making
the edits.

In `@test/extended/node/CLAUDE.md`:
- Around line 150-157: After filtering with getPureWorkerNodes, workerNodes may
be empty and the direct access workerNodes[0] can panic; update the test to
check len(workerNodes) before using index 0 (e.g., assert
o.Expect(len(workerNodes)).To(o.BeNumerically(">", 0)) or handle the zero case
by skipping/failing the test) and only set nodeName from workerNodes[0].Name
after that check so getNodesByLabel, getPureWorkerNodes and the workerNodes ->
nodeName usage are safe.
🪄 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: 4241d8cc-6825-48e9-8089-7dd5e78638da

📥 Commits

Reviewing files that changed from the base of the PR and between 653bd69 and 8ffee6a.

📒 Files selected for processing (3)
  • test/extended/node/.claude-docs-check.sh
  • test/extended/node/CLAUDE.md
  • test/extended/node/node_utils.go

Comment thread test/extended/node/.claude-docs-check.sh Outdated
Comment thread test/extended/node/CLAUDE.md Outdated
@openshift-merge-bot
Copy link
Copy Markdown
Contributor

Scheduling required tests:
/test e2e-aws-csi
/test e2e-aws-ovn-fips
/test e2e-aws-ovn-microshift
/test e2e-aws-ovn-microshift-serial
/test e2e-aws-ovn-serial-1of2
/test e2e-aws-ovn-serial-2of2
/test e2e-gcp-csi
/test e2e-gcp-ovn
/test e2e-gcp-ovn-upgrade
/test e2e-metal-ipi-ovn-ipv6
/test e2e-vsphere-ovn
/test e2e-vsphere-ovn-upi

Copy link
Copy Markdown
Contributor

@harche harche left a comment

Choose a reason for hiding this comment

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

Overall solid idea — documenting utility functions to reduce duplication is valuable. A few issues to address before merging.

Comment thread test/extended/node/.claude-docs-check.sh Outdated
Comment thread test/extended/node/CLAUDE.md Outdated
Comment thread test/extended/node/CLAUDE.md Outdated
Comment thread test/extended/node/node_utils.go Outdated
Comment thread test/extended/node/.claude-docs-check.sh Outdated
@ngopalak-redhat ngopalak-redhat force-pushed the ngopalak/util_function_node_help_claude branch from 8ffee6a to d13dcc7 Compare April 28, 2026 04:08
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: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@test/extended/node/claude-docs-check.sh`:
- Around line 9-14: The current UTILS_FUNCS extraction only matches capitalized
(exported) functions so it misses lowercase helpers in node_utils.go; update the
extraction logic used in UTILS_FUNCS (and the identical pattern referenced
around lines 22-26) to allow both lowercase and uppercase function names by
changing the name-matching character class (replace the [A-Z] constraint) so the
grep/sed regex captures names starting with any letter (e.g., [A-Za-z] or
[a-zA-Z]) and thus includes unexported helpers, or alternatively restrict the
docs to exported helpers only if you intend to keep the original behavior.

In `@test/extended/node/CLAUDE.md`:
- Around line 132-133: Update the guidance sentence that currently states “All
utility functions and test functions should use `context.Context`” to a clearer
instruction such as “Always pass `ctx` when the helper or test function
signature requires it (use `context.Context` where supported).” Also update the
documented helpers in this section to either accept `ctx` in their examples or
call out explicitly which helpers do not support `ctx`, ensuring examples and
text use the `ctx` variable consistently so readers are not misled by
conflicting signatures.
🪄 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: da983fe4-cc13-456b-9474-1f042a9192bb

📥 Commits

Reviewing files that changed from the base of the PR and between 8ffee6a and d13dcc7.

📒 Files selected for processing (3)
  • test/extended/node/CLAUDE.md
  • test/extended/node/claude-docs-check.sh
  • test/extended/node/node_utils.go
✅ Files skipped from review due to trivial changes (1)
  • test/extended/node/node_utils.go

Comment thread test/extended/node/claude-docs-check.sh Outdated
Comment thread test/extended/node/CLAUDE.md Outdated
@ngopalak-redhat ngopalak-redhat force-pushed the ngopalak/util_function_node_help_claude branch from d13dcc7 to b16756e Compare April 28, 2026 04:16
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.

Caution

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

⚠️ Outside diff range comments (1)
test/extended/node/CLAUDE.md (1)

1-189: ⚠️ Potential issue | 🟡 Minor

Integrate the consistency check script into CI to enforce documentation updates automatically.

The claude-docs-check.sh script exists and correctly validates that exported functions from node_utils.go are documented in CLAUDE.md. However, it is not currently referenced in any CI/Makefile configuration, so the check won't run automatically on pull requests. Add this validation to your CI pipeline (e.g., Makefile, GitHub Actions, or OpenShift CI) to prevent documentation drift.

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

In `@test/extended/node/CLAUDE.md` around lines 1 - 189, The CI is missing an
enforcement step: the claude-docs-check.sh script that verifies exported
functions in node_utils.go are documented in CLAUDE.md is not invoked by CI. Add
a build target (e.g., "docs-check") that runs claude-docs-check.sh and fails on
non-zero exit, then wire that target into your CI pipeline (e.g., add it as a
pre-merge step in the GitHub Actions workflow or OpenShift CI presubmit job) so
the script runs on PRs and blocks merges when documentation is out of sync.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@test/extended/node/CLAUDE.md`:
- Around line 1-189: The CI is missing an enforcement step: the
claude-docs-check.sh script that verifies exported functions in node_utils.go
are documented in CLAUDE.md is not invoked by CI. Add a build target (e.g.,
"docs-check") that runs claude-docs-check.sh and fails on non-zero exit, then
wire that target into your CI pipeline (e.g., add it as a pre-merge step in the
GitHub Actions workflow or OpenShift CI presubmit job) so the script runs on PRs
and blocks merges when documentation is out of sync.

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Enterprise

Run ID: a7fa5ddf-4478-47f8-88bf-64d6762f4db5

📥 Commits

Reviewing files that changed from the base of the PR and between d13dcc7 and b16756e.

📒 Files selected for processing (3)
  • test/extended/node/CLAUDE.md
  • test/extended/node/claude-docs-check.sh
  • test/extended/node/node_utils.go
✅ Files skipped from review due to trivial changes (1)
  • test/extended/node/node_utils.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • test/extended/node/claude-docs-check.sh

@ngopalak-redhat ngopalak-redhat force-pushed the ngopalak/util_function_node_help_claude branch from b16756e to e7dad96 Compare April 28, 2026 04:38
@ngopalak-redhat ngopalak-redhat changed the title Add claude md file for using the node_utils Add claude md file for using the node_utils and export util functons Apr 28, 2026
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

Caution

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

⚠️ Outside diff range comments (1)
test/extended/node/node_utils.go (1)

575-587: ⚠️ Potential issue | 🟠 Major

Parse numeric suffix when choosing the “highest numbered” worker kubelet MachineConfig

At Line 584, comparing names lexicographically can select the wrong config (e.g., "…-9" vs "…-10"). This can make downstream validations read the wrong MachineConfig.

Proposed fix
 func GetWorkerGeneratedKubeletMC(ctx context.Context, mcClient *machineconfigclient.Clientset) (*machineconfigv1.MachineConfig, error) {
 	mcList, err := mcClient.MachineconfigurationV1().MachineConfigs().List(ctx, metav1.ListOptions{})
 	if err != nil {
 		return nil, err
 	}
 
 	var highestMC *machineconfigv1.MachineConfig
+	highestSuffix := -1
 	for i := range mcList.Items {
-		if strings.Contains(mcList.Items[i].Name, "worker-generated-kubelet") {
-			if highestMC == nil || mcList.Items[i].Name > highestMC.Name {
-				highestMC = &mcList.Items[i]
-			}
-		}
+		name := mcList.Items[i].Name
+		if !strings.Contains(name, "worker-generated-kubelet") {
+			continue
+		}
+		parts := strings.Split(name, "-")
+		if len(parts) == 0 {
+			continue
+		}
+		suffix, convErr := strconv.Atoi(parts[len(parts)-1])
+		if convErr != nil {
+			continue
+		}
+		if suffix > highestSuffix {
+			highestSuffix = suffix
+			highestMC = &mcList.Items[i]
+		}
 	}
// add import
import "strconv"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/extended/node/node_utils.go` around lines 575 - 587,
GetWorkerGeneratedKubeletMC currently picks the "highest"
worker-generated-kubelet MachineConfig by lexicographic name comparison which
fails for numeric suffixes (e.g., "-9" vs "-10"); change the selection logic in
GetWorkerGeneratedKubeletMC to parse the numeric suffix of mcList.Items[i].Name
(use strconv.Atoi on the portion after the final dash) and compare integers to
pick the largest suffix, falling back to name string comparison if parsing
fails; update imports to include "strconv" and ensure highestMC is updated based
on the numeric comparison rather than raw string ordering.
♻️ Duplicate comments (1)
test/extended/node/CLAUDE.md (1)

159-159: ⚠️ Potential issue | 🟡 Minor

Align Line 159 with mixed helper signatures

Line 159 currently overstates context usage and conflicts with the note at Line 97. Reword to “pass ctx when the helper signature requires it.”

Proposed fix
-3. **Don't skip context propagation** - always pass `ctx` to utility functions
+3. **Don't skip context propagation** - pass `ctx` to helpers that accept `context.Context`
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/extended/node/CLAUDE.md` at line 159, Update the bullet titled "Don't
skip context propagation" so the guidance reads "pass `ctx` when the helper
signature requires it." Replace the current explicit "always pass `ctx` to
utility functions" wording to avoid conflict with the earlier note about mixed
helper signatures; locate and edit the markdown paragraph under that bullet (the
heading text "Don't skip context propagation") to use the new phrasing.
🧹 Nitpick comments (1)
test/extended/node/node_swap_cnv.go (1)

162-163: Use GetControlPlaneNodes in TC1 for label-agnostic control-plane discovery

Line 162 hardcodes the master label and can miss clusters that only expose control-plane. Reuse GetControlPlaneNodes here (as done later in this file).

Proposed fix
-			controlPlaneNodes, err := GetNodesByLabel(ctx, oc, "node-role.kubernetes.io/master")
+			controlPlaneNodes, err := GetControlPlaneNodes(ctx, oc)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/extended/node/node_swap_cnv.go` around lines 162 - 163, The call to
GetNodesByLabel with the "node-role.kubernetes.io/master" label in TC1 should be
replaced with GetControlPlaneNodes to discover control-plane nodes in a
label-agnostic way; locate the code that sets controlPlaneNodes (currently using
GetNodesByLabel) and call GetControlPlaneNodes(ctx, oc) instead, keep the same
error check that asserts err is nil (o.Expect(err).NotTo(o.HaveOccurred())), and
ensure any downstream use of controlPlaneNodes remains 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 `@test/extended/node/node_utils.go`:
- Around line 273-279: The helper CleanupDropInAndRestartKubelet currently
swallows errors from RemoveDropInFile and RestartKubeletOnNode; change
CleanupDropInAndRestartKubelet to propagate errors (return error) and capture
and handle the return values from RemoveDropInFile and RestartKubeletOnNode
(e.g., if err != nil log and return err) before proceeding to
WaitForNodeToBeReady; update callers to handle the returned error. Ensure you
reference the functions RemoveDropInFile, RestartKubeletOnNode,
WaitForNodeToBeReady and the helper CleanupDropInAndRestartKubelet when making
the change.

---

Outside diff comments:
In `@test/extended/node/node_utils.go`:
- Around line 575-587: GetWorkerGeneratedKubeletMC currently picks the "highest"
worker-generated-kubelet MachineConfig by lexicographic name comparison which
fails for numeric suffixes (e.g., "-9" vs "-10"); change the selection logic in
GetWorkerGeneratedKubeletMC to parse the numeric suffix of mcList.Items[i].Name
(use strconv.Atoi on the portion after the final dash) and compare integers to
pick the largest suffix, falling back to name string comparison if parsing
fails; update imports to include "strconv" and ensure highestMC is updated based
on the numeric comparison rather than raw string ordering.

---

Duplicate comments:
In `@test/extended/node/CLAUDE.md`:
- Line 159: Update the bullet titled "Don't skip context propagation" so the
guidance reads "pass `ctx` when the helper signature requires it." Replace the
current explicit "always pass `ctx` to utility functions" wording to avoid
conflict with the earlier note about mixed helper signatures; locate and edit
the markdown paragraph under that bullet (the heading text "Don't skip context
propagation") to use the new phrasing.

---

Nitpick comments:
In `@test/extended/node/node_swap_cnv.go`:
- Around line 162-163: The call to GetNodesByLabel with the
"node-role.kubernetes.io/master" label in TC1 should be replaced with
GetControlPlaneNodes to discover control-plane nodes in a label-agnostic way;
locate the code that sets controlPlaneNodes (currently using GetNodesByLabel)
and call GetControlPlaneNodes(ctx, oc) instead, keep the same error check that
asserts err is nil (o.Expect(err).NotTo(o.HaveOccurred())), and ensure any
downstream use of controlPlaneNodes remains 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: Enterprise

Run ID: 2816d278-298b-49fe-8586-d989da75a542

📥 Commits

Reviewing files that changed from the base of the PR and between b16756e and e7dad96.

📒 Files selected for processing (7)
  • test/extended/node/CLAUDE.md
  • test/extended/node/claude-docs-check.sh
  • test/extended/node/node_sizing.go
  • test/extended/node/node_swap.go
  • test/extended/node/node_swap_cnv.go
  • test/extended/node/node_utils.go
  • test/extended/node/system_compressible.go
✅ Files skipped from review due to trivial changes (1)
  • test/extended/node/claude-docs-check.sh

Comment thread test/extended/node/node_utils.go
@ngopalak-redhat ngopalak-redhat changed the title Add claude md file for using the node_utils and export util functons NO-ISSUE: Add claude md file for using the node_utils and export util functons Apr 28, 2026
@openshift-ci-robot
Copy link
Copy Markdown

@ngopalak-redhat: This pull request explicitly references no jira issue.

Details

In response to this:

Adds Claude.md file so that the node_utils functions are used by the team when developing test cases with Claude.
Currently I see some duplicate code and this is one way to reduce it.

I have to refactor the functions to use capital letter to start so that they look like the utility functions and other can notice it and use it.

Summary by CodeRabbit

  • Tests

  • Added an automated check to ensure testing documentation remains synchronized with test utilities and to warn when docs are missing entries.

  • Improved test tooling to validate exported test helpers are documented.

  • Documentation

  • Added a comprehensive developer guide for node E2E testing with workflows, best practices, examples, and common references.

Note: Documentation and test improvements only; no end-user functionality 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.

@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 28, 2026
@ngopalak-redhat
Copy link
Copy Markdown
Contributor Author

/payload-job periodic-ci-openshift-release-main-nightly-4.22-e2e-aws-disruptive-longrunning

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 28, 2026

@ngopalak-redhat: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command

  • periodic-ci-openshift-release-main-nightly-4.22-e2e-aws-disruptive-longrunning

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/24dc41b0-42be-11f1-9810-f2840d26fc7d-0

@ngopalak-redhat
Copy link
Copy Markdown
Contributor Author

/assign @cpmeadors

@ngopalak-redhat ngopalak-redhat changed the title NO-ISSUE: Add claude md file for using the node_utils and export util functons NO-ISSUE: Add claude md file for using the node_utils and export util functions Apr 28, 2026
@openshift-merge-bot
Copy link
Copy Markdown
Contributor

Scheduling required tests:
/test e2e-aws-csi
/test e2e-aws-ovn-fips
/test e2e-aws-ovn-microshift
/test e2e-aws-ovn-microshift-serial
/test e2e-aws-ovn-serial-1of2
/test e2e-aws-ovn-serial-2of2
/test e2e-gcp-csi
/test e2e-gcp-ovn
/test e2e-gcp-ovn-upgrade
/test e2e-metal-ipi-ovn-ipv6
/test e2e-vsphere-ovn
/test e2e-vsphere-ovn-upi

@openshift-merge-bot openshift-merge-bot Bot added the ready-for-human-review Indicates a PR has been reviewed by automated tools and is ready for human review label Apr 29, 2026
@ngopalak-redhat
Copy link
Copy Markdown
Contributor Author

@harche All the tests I have modified have passed: https://pr-payload-tests.ci.openshift.org/runs/ci/24dc41b0-42be-11f1-9810-f2840d26fc7d-0
Please review. I have run simplify command also.

@ngopalak-redhat ngopalak-redhat force-pushed the ngopalak/util_function_node_help_claude branch from e7dad96 to 39e606e Compare May 4, 2026 01:37
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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@test/extended/node/CLAUDE.md`:
- Line 17: Update the guidance to avoid an absolute rule: change the line
referencing ExecOnNodeWithChroot so it recommends using ExecOnNodeWithChroot for
most root-level commands inside a debug container but explicitly allow
exceptions (e.g., swap management and other cases requiring namespace entry)
where ExecOnNodeWithNsenter should be used; reference the symbols
ExecOnNodeWithChroot and ExecOnNodeWithNsenter in the wording so readers know
which function to choose.
🪄 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: 1b672906-4eb9-49e1-8043-c114a335c100

📥 Commits

Reviewing files that changed from the base of the PR and between e7dad96 and 39e606e.

📒 Files selected for processing (7)
  • test/extended/node/CLAUDE.md
  • test/extended/node/claude-docs-check.sh
  • test/extended/node/node_sizing.go
  • test/extended/node/node_swap.go
  • test/extended/node/node_swap_cnv.go
  • test/extended/node/node_utils.go
  • test/extended/node/system_compressible.go
✅ Files skipped from review due to trivial changes (4)
  • test/extended/node/claude-docs-check.sh
  • test/extended/node/system_compressible.go
  • test/extended/node/node_sizing.go
  • test/extended/node/node_swap_cnv.go
🚧 Files skipped from review as they are similar to previous changes (2)
  • test/extended/node/node_swap.go
  • test/extended/node/node_utils.go

Comment thread test/extended/node/CLAUDE.md
@ngopalak-redhat
Copy link
Copy Markdown
Contributor Author

@harche I have update the Claude.md file to have the human knowledge for some of the functions. Removed generated text. It can further improved when more utility functions are added.

@openshift-merge-bot
Copy link
Copy Markdown
Contributor

Scheduling required tests:
/test e2e-aws-csi
/test e2e-aws-ovn-fips
/test e2e-aws-ovn-microshift
/test e2e-aws-ovn-microshift-serial
/test e2e-aws-ovn-serial-1of2
/test e2e-aws-ovn-serial-2of2
/test e2e-gcp-csi
/test e2e-gcp-ovn
/test e2e-gcp-ovn-upgrade
/test e2e-metal-ipi-ovn-ipv6
/test e2e-vsphere-ovn
/test e2e-vsphere-ovn-upi

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 4, 2026

@ngopalak-redhat: The following test 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/e2e-aws-ovn-fips 39e606e link true /test e2e-aws-ovn-fips

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.

@cpmeadors
Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label May 5, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 5, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cpmeadors, ngopalak-redhat

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 May 5, 2026
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. ready-for-human-review Indicates a PR has been reviewed by automated tools and is ready for human review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants