Skip to content

fix: Add operator flags in setup#19

Merged
Agent-Hellboy merged 6 commits intomainfrom
add_operator_flags_in_setup
Mar 24, 2026
Merged

fix: Add operator flags in setup#19
Agent-Hellboy merged 6 commits intomainfrom
add_operator_flags_in_setup

Conversation

@Agent-Hellboy
Copy link
Copy Markdown
Owner

@Agent-Hellboy Agent-Hellboy commented Dec 22, 2025

Summary by CodeRabbit

  • New Features

    • Setup command adds a --test-mode and operator startup flags (metrics/probe addresses, leader-election) and passes them through to operator deployments.
  • Bug Fixes

    • Status updates made more concurrency-safe with improved error and conflict handling.
    • Terminal detection hardened to avoid invalid file-descriptor errors.
  • Tests

    • Tests expanded for status subresource handling, operator arg construction/merging, and setup workflows.
  • Documentation

    • CLI help formatting updated and new operator flags documented.
  • Chores

    • CI action reference style normalized; registry config serialization made more robust.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Dec 22, 2025

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

Walkthrough

Adds operator CLI flags and builds an operatorArgs slice propagated through SetupPlan and setup steps; injects operatorArgs into the manager deployment YAML when present; adds a test-mode path to skip operator build/use preloaded image; and hardens MCPServer status updates to re-fetch resourceVersion and handle NotFound/Conflict.

Changes

Cohort / File(s) Summary
CLI: flags, arg builder, and manifest injection
internal/cli/setup.go
Added --test-mode, --operator-metrics-addr, --operator-probe-addr, --operator-leader-elect; implemented buildOperatorArgs; added manifest helpers (injectOperatorArgs, renderOperatorArgsBlock, parseOperatorArgs, mergeOperatorArgs, operatorArgKey); changed DeployOperatorManifests signature to accept operatorArgs []string.
Plan: carry test mode & operator args
internal/cli/setup_plan.go
Added TestMode bool and OperatorArgs []string to SetupPlanInput and SetupPlan; propagated fields via BuildSetupPlan.
Setup steps wiring
internal/cli/setup_steps.go, internal/cli/setup_steps_test.go, internal/cli/setup_helpers_test.go
Threaded Plan.TestMode into operator image preparation; forwarded Plan.OperatorArgs into deployOperatorStep and DeployOperatorManifests; added tests for test-mode image path and operatorArgs forwarding; updated helper tests for arg building/merging.
Manifest deploy implementation (kubectl path)
internal/cli/setup.go (deployOperatorManifestsWithKubectl and related)
Accepts operatorArgs and, when non-empty, edits config/manager/manager.yaml to inject/override container args/command via new helpers before applying manifests.
Operator controller: status update robustness
internal/operator/controller.go, internal/operator/controller_test.go
updateStatus now re-fetches MCPServer to obtain current resourceVersion, uses Status().Update() with fallback to Update(), treats Conflict as retryable, and skips when resource is NotFound; tests updated to create object with status subresource and assert on fetched status.
CLI help golden
test/golden/cli/testdata/mcp-runtime_setup_help.golden
Updated help golden to include new flags and adjusted alignment.
Printer FD safety & tests
internal/cli/printer.go, internal/cli/printer_test.go
Added isTerminalFD with overflow guard and test TestIsTerminalFDOverflowGuard.
Registry config marshaling
internal/cli/registry.go
Added marshalExternalRegistryConfig to omit empty username/password when saving registry config.
CI action tag normalization
.github/workflows/security-trivy.yaml
Normalized Trivy action reference from 0.33.1 to v0.33.1.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    actor User
    participant CLI as "mcp-runtime setup (CLI)"
    participant Builder as "BuildSetupPlan"
    participant Plan as "SetupPlan"
    participant Steps as "setup step runner"
    participant Deployer as "DeployOperatorManifests"
    participant YAML as "manager.yaml injector"

    User->>CLI: run setup with operator flags / --test-mode
    CLI->>CLI: buildOperatorArgs() -> operatorArgs
    CLI->>Builder: BuildSetupPlan(TestMode, OperatorArgs)
    Builder->>Plan: return SetupPlan (contains TestMode & OperatorArgs)
    CLI->>Steps: run deployOperatorStep(ctx.Plan)
    Steps->>Deployer: call DeployOperatorManifests(operatorImage, operatorArgs)
    Deployer->>YAML: injectOperatorArgs(manager.yaml, operatorArgs)
    YAML-->>Deployer: modified manager.yaml
    Deployer->>Deployer: apply manifests (operator starts with injected args)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • Cleanup #6 — Modifies internal/cli/setup.go and test-mode/operator image selection; overlaps on test-mode behavior and operator image flow.
  • feat: redesign setup and add missed unittest for cli package #13 — Changes operator deployment wiring and DeployOperatorManifests; directly related to manifest-arg injection and deploy path.
  • improve docs #24 — Alters setup wiring and operator arg/test-mode handling; likely touches the same function signatures and plumbing.

Poem

🐰 I hopped through flags and threaded each one through,
I tucked them in YAML so the manager knew,
From CLI to plan, through steps they sped,
Test-mode saved the build — a carrot-fed thread,
A tiny hop, and configs flew.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 17.02% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: Add operator flags in setup' accurately describes the primary change: adding new CLI flags (--test-mode, --operator-metrics-addr, --operator-probe-addr, --operator-leader-elect) to the setup command.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch add_operator_flags_in_setup

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

❤️ Share

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

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)
internal/cli/setup_helpers_test.go (1)

498-499: Tests updated for new signature, but consider adding operatorArgs coverage.

The test call sites correctly pass nil for the new operatorArgs parameter to accommodate the updated signature.

Consider adding a test case that verifies deployOperatorManifestsWithKubectl correctly injects operator arguments into the manager YAML when operatorArgs is non-nil.

Also applies to: 553-553, 575-575, 612-612

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1f8a11d and c7a3883.

📒 Files selected for processing (5)
  • internal/cli/setup.go
  • internal/cli/setup_helpers_test.go
  • internal/cli/setup_plan.go
  • internal/cli/setup_plan_test.go
  • internal/cli/setup_steps.go
🧰 Additional context used
🧬 Code graph analysis (1)
internal/cli/setup.go (3)
internal/cli/registry.go (1)
  • ExternalRegistryConfig (201-205)
internal/cli/printer.go (1)
  • Info (257-257)
internal/cli/kubectl_runner.go (1)
  • KubectlRunner (6-10)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Unit + Integration Tests
🔇 Additional comments (7)
internal/cli/setup_plan.go (1)

13-14: LGTM!

The OperatorArgs field is correctly added to both input and plan structs, and properly propagated through BuildSetupPlan. Clean implementation for passing operator arguments through the setup flow.

Also applies to: 24-25, 54-55

internal/cli/setup_steps.go (1)

100-110: LGTM!

The deployOperatorStepCmd.Run correctly forwards ctx.Plan.OperatorArgs to the deployOperatorStep function, maintaining consistency with the updated function signature.

internal/cli/setup_plan_test.go (1)

152-152: LGTM!

The mock function signatures for DeployOperatorManifests are correctly updated to accept the new []string parameter for operator arguments, maintaining consistency with the updated interface.

Also applies to: 222-222, 302-302

internal/cli/setup.go (4)

126-128: LGTM!

The operator configuration flags are well-named with the operator- prefix for clarity, and using empty string defaults allows the manager.yaml defaults to apply when flags aren't explicitly set.

Also applies to: 168-170


343-348: LGTM!

The function signatures for deployOperatorStep, deployOperatorManifests, and deployOperatorManifestsWithKubectl are consistently updated to accept the new operatorArgs parameter, and the arguments are correctly passed through the call chain.

Also applies to: 643-649


681-684: LGTM!

The conditional check before calling injectOperatorArgs correctly avoids unnecessary processing when no operator arguments are provided.


175-191: No issues found with the buildOperatorArgs function.

The flag names (--metrics-bind-address, --health-probe-bind-address, --leader-elect) are correct and standard for controller-runtime operators. The function logic properly handles conditional argument inclusion based on non-empty and non-default values, preserving manager.yaml defaults.

Comment thread internal/cli/setup.go
@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 22, 2025

Codecov Report

❌ Patch coverage is 72.80000% with 34 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.04%. Comparing base (f240926) to head (b035cee).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
internal/cli/setup.go 75.28% 20 Missing and 2 partials ⚠️
internal/operator/controller.go 47.05% 6 Missing and 3 partials ⚠️
internal/cli/printer.go 50.00% 3 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #19      +/-   ##
==========================================
+ Coverage   77.54%   78.04%   +0.50%     
==========================================
  Files          28       28              
  Lines        3758     3867     +109     
==========================================
+ Hits         2914     3018     +104     
  Misses        686      686              
- Partials      158      163       +5     
Flag Coverage Δ
pre-merge 78.04% <72.80%> (+0.50%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
internal/cli/registry.go 88.64% <100.00%> (+0.18%) ⬆️
internal/cli/setup_plan.go 100.00% <100.00%> (ø)
internal/cli/setup_steps.go 100.00% <100.00%> (ø)
internal/cli/printer.go 80.14% <50.00%> (-0.16%) ⬇️
internal/operator/controller.go 73.37% <47.05%> (-1.51%) ⬇️
internal/cli/setup.go 57.88% <75.28%> (+6.30%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

🧹 Nitpick comments (2)
internal/operator/controller.go (2)

640-642: Consider skipping status update on fetch errors instead of fallback.

When fetching the latest MCPServer fails (non-NotFound errors), the code falls back to using the original mcpServer object. However, this object is likely stale and will cause a conflict error during the Status().Update() call, creating unnecessary retry overhead.

Consider returning early on fetch errors (similar to the NotFound case) and letting the next reconcile retry with fresh data.

🔎 Suggested refactor
 	if err := r.Get(ctx, types.NamespacedName{Name: mcpServer.Name, Namespace: mcpServer.Namespace}, latest); err != nil {
 		// If object not found, it may have been deleted - skip status update
 		if errors.IsNotFound(err) {
 			log.FromContext(ctx).V(1).Info("MCPServer not found, skipping status update (may have been deleted)")
 			return
 		}
-		// For other errors, log but try to update with the original object as fallback
-		log.FromContext(ctx).Error(err, "Failed to fetch MCPServer for status update, using original object")
-		latest = mcpServer
+		// For other errors, skip status update and let next reconcile retry
+		log.FromContext(ctx).Error(err, "Failed to fetch MCPServer for status update, skipping update")
+		return
 	}

659-662: Fallback Update() may inadvertently modify spec fields.

When Status().Update() fails, the code falls back to a full Update() on the latest object. However, this latest object was fetched via Get(), which includes both spec and status. If there's a mismatch between the spec in latest and the actual desired spec, this fallback could inadvertently revert spec changes made elsewhere.

Consider explicitly setting only status fields before the fallback Update(), or document this limitation.

🔎 Proposed refinement
 		} else {
 			// Some environments (like the fake client) may not support status subresources.
+			// Note: This performs a full object update, not just status.
+			// In rare cases, this could revert concurrent spec changes.
 			if updateErr := r.Update(ctx, latest); updateErr != nil {
 				log.FromContext(ctx).Error(updateErr, "Failed to update MCPServer after status update failure", "resourceVersion", latest.ResourceVersion)
 			}
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c7a3883 and 86a9a29.

📒 Files selected for processing (3)
  • internal/operator/controller.go
  • internal/operator/controller_test.go
  • test/golden/cli/testdata/mcp-runtime_setup_help.golden
🧰 Additional context used
🧬 Code graph analysis (2)
internal/operator/controller_test.go (1)
api/v1alpha1/mcpserver_types.go (1)
  • MCPServer (120-126)
internal/operator/controller.go (1)
api/v1alpha1/mcpserver_types.go (1)
  • MCPServer (120-126)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Unit + Integration Tests
🔇 Additional comments (3)
internal/operator/controller_test.go (2)

274-280: LGTM: Test updated to support status subresource.

The test now correctly initializes the fake client with status subresource support and explicitly creates the MCPServer object. This aligns with the controller's refactored updateStatus method that uses Status().Update().


474-482: LGTM: Test correctly verifies status update via API.

The test now fetches the updated MCPServer object from the client and verifies the status fields, which correctly reflects the behavior of the refactored updateStatus method that persists status via the API.

test/golden/cli/testdata/mcp-runtime_setup_help.golden (1)

18-20: Verify default values match operator implementation.

The help text references default values from manager.yaml for the new operator flags. Ensure these defaults (:8080 for metrics, :8081 for probes, false for leader election) match the actual defaults in the operator manager deployment manifest.

Run the following script to verify the default values in the operator configuration:

#!/bin/bash
# Description: Check default values in operator manager YAML files

# Search for manager deployment manifests
fd -e yaml -e yml manager config/

# Search for default flag values in Go code
rg -nP '\bmetrics.*addr\b|\bprobe.*addr\b|\bleader.*elect\b' --type=go -A2 -B2

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)
internal/cli/setup.go (1)

408-423: Critical: Missing operatorArgs parameter breaks the feature.

The deployOperatorStep function receives operatorArgs as a parameter (line 407) but fails to pass it to deps.DeployOperatorManifests at line 409. This means the operator command-line arguments will never be applied to the deployment, completely breaking the new feature.

🔎 Proposed fix
 	Info("Deploying operator manifests")
-	if err := deps.DeployOperatorManifests(logger, operatorImage); err != nil {
+	if err := deps.DeployOperatorManifests(logger, operatorImage, operatorArgs); err != nil {
 		wrappedErr := wrapWithSentinelAndContext(
♻️ Duplicate comments (1)
internal/cli/setup.go (1)

921-959: Critical: Duplicate "args:" header in YAML injection.

This issue was already identified in a previous review. The function builds argsYAML with an "args:\n" prefix (line 930), but then the replacement at line 940 also adds "args:\n", resulting in duplicate headers and malformed YAML output.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 86a9a29 and 318a43b.

📒 Files selected for processing (3)
  • internal/cli/setup.go
  • internal/cli/setup_steps.go
  • internal/operator/controller.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • internal/cli/setup_steps.go
🧰 Additional context used
🧬 Code graph analysis (2)
internal/cli/setup.go (2)
internal/cli/registry.go (1)
  • ExternalRegistryConfig (229-233)
internal/cli/kubectl_runner.go (1)
  • KubectlRunner (6-10)
internal/operator/controller.go (1)
api/v1alpha1/mcpserver_types.go (1)
  • MCPServer (120-126)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Unit + Integration Tests
🔇 Additional comments (9)
internal/operator/controller.go (1)

663-686: LGTM: Robust status update preparation.

The re-fetch logic properly handles the latest resourceVersion and avoids optimistic locking conflicts. The NotFound case is handled gracefully, and the fallback to the original object on fetch errors is reasonable.

internal/cli/setup.go (8)

127-129: LGTM: Flag variable declarations are appropriate.

The three operator flag variables are correctly typed and positioned.


143-144: LGTM: Operator args construction.

The call to buildOperatorArgs correctly assembles operator arguments from the CLI flags.


176-192: LGTM: Clean flag-to-args conversion.

The function correctly constructs operator arguments, including only explicitly set flags. The logic appropriately handles empty strings and boolean defaults.


407-407: LGTM: Function signature updated correctly.

The operatorArgs []string parameter is appropriately added to the function signature.


793-799: LGTM: Function signatures consistently updated.

Both deployOperatorManifests and deployOperatorManifestsWithKubectl signatures are correctly updated to accept operatorArgs []string. The comment at line 798 appropriately reflects the new behavior.


856-859: LGTM: Conditional injection preserves backward compatibility.

The logic correctly injects operator args only when provided, ensuring existing behavior is unchanged when no flags are specified.


45-45: LGTM: Interface signature updated correctly.

The DeployOperatorManifests function type in SetupDeps is appropriately updated to include the operatorArgs []string parameter.


169-171: The code is correctly designed. The operator- prefixed flags at the CLI level (lines 169-171) are intentional aliases that get translated to standard controller-runtime flag names (--metrics-bind-address, --health-probe-bind-address, --leader-elect) by the buildOperatorArgs() function (lines 182, 185, 188) before being passed to the operator. This layering avoids flag name conflicts with other setup flags and maintains compliance with controller-runtime conventions. No changes needed.

Comment thread internal/operator/controller.go
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.

♻️ Duplicate comments (1)
internal/operator/controller.go (1)

695-698: ⚠️ Potential issue | 🟠 Major

Remove the full-object fallback from the status path.

Lines 695-698 switch this code back from a status-only write to a normal object update. In this repo the CRD already exposes subresources.status (config/crd/bases/mcpruntime.org_mcpservers.yaml:188-189) and the controller already has mcpservers/status update permission (config/rbac/role.yaml:80-87), so a non-conflict failure here should be treated as a real status-update failure and retried on the next reconcile, not routed through r.Update. If fake-client compatibility is still needed, keep that behind test-only code instead of the production reconcile path.

🛠️ Proposed fix
 	if err := r.Status().Update(ctx, latest); err != nil {
 		// If it's a conflict error, that's expected in concurrent scenarios - log at debug level
 		if errors.IsConflict(err) {
 			log.FromContext(ctx).V(1).Info("Status update conflict (expected in concurrent reconciles), will retry on next reconcile", "resourceVersion", latest.ResourceVersion)
 		} else {
-			// Some environments (like the fake client) may not support status subresources.
-			if updateErr := r.Update(ctx, latest); updateErr != nil {
-				log.FromContext(ctx).Error(updateErr, "Failed to update MCPServer after status update failure", "resourceVersion", latest.ResourceVersion)
-			}
 			// Log other errors but don't fail the reconcile - status update failures are non-fatal
 			// The next reconcile will retry the status update
 			log.FromContext(ctx).Error(err, "Failed to update MCPServer status", "resourceVersion", latest.ResourceVersion)
 		}
 	}
#!/bin/bash
set -u

echo "== CRD exposes the status subresource =="
rg -n -C2 'subresources:|status:\s*\{\}' config/crd/bases/mcpruntime.org_mcpservers.yaml || true

echo
echo "== RBAC allows MCPServer status updates =="
rg -n -C2 'mcpservers/status|verbs:' config/rbac/role.yaml || true

echo
echo "== Controller tests referencing status-subresource behavior =="
rg -n -C3 'WithStatusSubresource|Status\(\)\.Update|updateStatus' internal/operator/controller_test.go || true
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@internal/operator/controller.go` around lines 695 - 698, The fallback that
performs a full-object write via r.Update(ctx, latest) after a status update
failure must be removed; instead treat the error from the status update as a
real failure and return it (so the controller will retry the status update on
the next reconcile). Locate the block containing the call r.Update(ctx, latest)
in the reconcile path and delete that fallback branch; ensure the reconcile
returns the original status-update error (or wraps it) rather than attempting an
object update. If fake-client compatibility is required, move any special-case
logic into test-only code or test helpers rather than keeping a production-path
r.Update fallback.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@internal/operator/controller.go`:
- Around line 695-698: The fallback that performs a full-object write via
r.Update(ctx, latest) after a status update failure must be removed; instead
treat the error from the status update as a real failure and return it (so the
controller will retry the status update on the next reconcile). Locate the block
containing the call r.Update(ctx, latest) in the reconcile path and delete that
fallback branch; ensure the reconcile returns the original status-update error
(or wraps it) rather than attempting an object update. If fake-client
compatibility is required, move any special-case logic into test-only code or
test helpers rather than keeping a production-path r.Update fallback.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 630a8a21-31db-49b6-b37b-6524f6b9a16f

📥 Commits

Reviewing files that changed from the base of the PR and between 318a43b and baf36f4.

📒 Files selected for processing (10)
  • .github/workflows/security-trivy.yaml
  • internal/cli/printer.go
  • internal/cli/registry.go
  • internal/cli/setup.go
  • internal/cli/setup_helpers_test.go
  • internal/cli/setup_plan.go
  • internal/cli/setup_plan_test.go
  • internal/cli/setup_steps.go
  • internal/operator/controller.go
  • test/golden/cli/testdata/mcp-runtime_setup_help.golden
✅ Files skipped from review due to trivial changes (2)
  • .github/workflows/security-trivy.yaml
  • internal/cli/registry.go
🚧 Files skipped from review as they are similar to previous changes (2)
  • internal/cli/setup_steps.go
  • test/golden/cli/testdata/mcp-runtime_setup_help.golden

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.

🧹 Nitpick comments (1)
internal/cli/setup_plan_test.go (1)

191-201: Consider adding test coverage for OperatorArgs propagation.

The existing setupPlatformWithDeps tests update the DeployOperatorManifests signature but don't verify that plan.OperatorArgs is actually passed through. You could enhance the call recorder to capture the arguments, or add a dedicated test that verifies the operatorArgs slice reaches the deployment function.

This is optional since the production code appears to be a straightforward pass-through, but it would strengthen confidence in the new feature.

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

In `@internal/cli/setup_plan_test.go` around lines 191 - 201, Add a unit test to
assert that SetupPlan.OperatorArgs is passed to DeployOperatorManifests: extend
the existing setupPlatformWithDeps test harness (or its call recorder) to
capture the arguments passed into DeployOperatorManifests and add a case where
plan := SetupPlan{..., OperatorArgs: []string{"--foo","bar"}} is supplied, then
assert the recorded call contains that same slice; update the test to fail if
the OperatorArgs are not propagated so the signature change is covered by tests.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@internal/cli/setup_plan_test.go`:
- Around line 191-201: Add a unit test to assert that SetupPlan.OperatorArgs is
passed to DeployOperatorManifests: extend the existing setupPlatformWithDeps
test harness (or its call recorder) to capture the arguments passed into
DeployOperatorManifests and add a case where plan := SetupPlan{...,
OperatorArgs: []string{"--foo","bar"}} is supplied, then assert the recorded
call contains that same slice; update the test to fail if the OperatorArgs are
not propagated so the signature change is covered by tests.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 191c7795-d6f7-4c95-8625-8c29f5536f1b

📥 Commits

Reviewing files that changed from the base of the PR and between baf36f4 and aaa19e0.

📒 Files selected for processing (7)
  • internal/cli/printer_test.go
  • internal/cli/setup.go
  • internal/cli/setup_plan.go
  • internal/cli/setup_plan_test.go
  • internal/cli/setup_steps.go
  • internal/cli/setup_steps_test.go
  • test/golden/cli/testdata/mcp-runtime_setup_help.golden
✅ Files skipped from review due to trivial changes (2)
  • internal/cli/setup_plan.go
  • internal/cli/setup_steps_test.go
🚧 Files skipped from review as they are similar to previous changes (3)
  • internal/cli/setup_steps.go
  • test/golden/cli/testdata/mcp-runtime_setup_help.golden
  • internal/cli/setup.go

@Agent-Hellboy Agent-Hellboy merged commit 2d87766 into main Mar 24, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant