Skip to content

SANDBOX-1561 | feature: Make targets for debugging services and operators#1251

Open
MikelAlejoBR wants to merge 1 commit intocodeready-toolchain:masterfrom
MikelAlejoBR:SANDBOX-1561-debug-sandbox-resources-host-op
Open

SANDBOX-1561 | feature: Make targets for debugging services and operators#1251
MikelAlejoBR wants to merge 1 commit intocodeready-toolchain:masterfrom
MikelAlejoBR:SANDBOX-1561-debug-sandbox-resources-host-op

Conversation

@MikelAlejoBR
Copy link
Contributor

@MikelAlejoBR MikelAlejoBR commented Feb 3, 2026

Adds a new Make target which triggers build in the underlying services and operators which end up building the images without any code optimizations and with Delve on them.

Once pushed and deployed to the local OpenShift cluster, it patches the host operator, the member operator and the registration service to launch them with the Delve executable, which allows debugging them on port 50000 after port-forwarding to those pods.

Related pull requetss

Jira ticket

[SANDBOX-1561]

Summary by CodeRabbit

  • New Features

    • Added local e2e debugging with Delve for running services and operators under a debugger; new deploy target to enable it and propagate debug mode through the deploy flow.
  • Documentation

    • Added usage docs for local debug deployment, default architecture, port-forwarding, and services included in the debug mode.
  • Chores

    • Propagated a DEBUG_MODE option across build/deploy/publish flows and set a default image builder behavior to support debug images.

@openshift-ci
Copy link

openshift-ci bot commented Feb 3, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: MikelAlejoBR
Once this PR has been reviewed and has the lgtm label, please assign rsoaresd for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@coderabbitai
Copy link

coderabbitai bot commented Feb 3, 2026

Warning

Rate limit exceeded

@MikelAlejoBR has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 14 minutes and 12 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

Walkthrough

Adds a new dev Makefile target to deploy an OpenShift local debug flow that builds debug images and patches operator CSVs to run under the Delve debugger (port 50000); propagates a DEBUG_MODE flag through build/publish scripts and documents the workflow in README.adoc.

Changes

Cohort / File(s) Summary
Documentation
README.adoc
Adds doc for dev-deploy-e2e-local-debug: local OpenShift debug deploy, Delve shipped, port 50000, default TARGET_ARCH linux-amd64 and overrides.
Config
deploy/host-operator/dev/toolchainconfig.yaml
Adds replicas: 1 under spec.host.registrationService for dev ToolchainConfig.
Debug Target & Orchestration
make/dev.mk
New dev-deploy-e2e-local-debug target: exports DEBUG_MODE=true, delegates to dev-deploy-e2e-local, patches host/member CSVs to run registration-service and operators under Delve, and waits for rollouts/readiness.
Make plumbing
make/test.mk
Adds DEBUG_MODE_PARAM plumbing and appends it to member/host operator publish/deploy invocations (both versioned and latest flows).
Operator publish scripts
scripts/ci/manage-host-operator.sh, scripts/ci/manage-member-operator.sh
Add `-dm
Image push logic
scripts/ci/manage-operator.sh
push_image now accepts DEBUG_MODE to set a -debug make target suffix; sets default IMAGE_BUILDER="${IMAGE_BUILDER:-podman}" and uses ${IMAGE_BUILDER}-push${DEBUG_MODE_SUFFIX}.

Sequence Diagram(s)

mermaid
sequenceDiagram
participant Dev as Developer/IDE
participant Make as Makefile (dev-deploy-e2e-local-debug)
participant Kube as kubectl/Cluster (CSV, Deployments)
participant Image as Image Builder (podman/docker)
Dev->>Make: invoke dev-deploy-e2e-local-debug
Make->>Image: build/push images (with DEBUG_MODE -> -debug)
Make->>Kube: deploy base e2e-local resources
Make->>Kube: patch CSVs (registration-service, host-operator, member-operator) to run dlv
Kube->>Kube: rollout deployments with dlv-enabled commands
Dev->>Kube: port-forward registration-service:50000 -> IDE

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested labels

lgtm

Suggested reviewers

  • alexeykazakov
  • rajivnathan

Poem

🐰 With Delve in paw I hop to the code,
I patch CSVs down the debug road,
Port 50000 hums like a tune,
Operators nap while I sing to the moon,
Breakpoints and carrots — debug mode bestowed!

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% 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 directly aligns with the main objective: adding Make targets for debugging services and operators with Delve integration.

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

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

@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

🤖 Fix all issues with AI agents
In `@scripts/ci/manage-member-operator.sh`:
- Around line 71-74: The --debug-mode option in the argument parsing incorrectly
sets DEBUG_MODE=$1 (capturing the flag string) so push_image's check (which
expects DEBUG_MODE=="true") fails; change the parser to set DEBUG_MODE=true when
encountering -dm|--debug-mode and shift appropriately so downstream logic that
computes DEBUG_MODE_SUFFIX and push_image behave correctly (mirror the
implementation used in manage-host-operator.sh); ensure variables referenced are
DEBUG_MODE, DEBUG_MODE_SUFFIX and the push_image function receive the expected
"true" value.
🧹 Nitpick comments (3)
README.adoc (1)

154-163: Consider noting alternate local ports when debugging multiple components.

All three components listen on :50000; if someone debugs more than one at a time, local port-forwarding will conflict. A short note like oc port-forward <pod> 50001:50000 can prevent confusion.

make/test.mk (1)

334-338: Gate DEBUG_MODE_PARAM on DEBUG_MODE == true to avoid accidental debug builds.

Right now any non-empty value (including false) will still pass --debug-mode. If you want a strict boolean, consider checking for true explicitly.

🔧 Suggested change
-ifneq (${DEBUG_MODE},"")
-    ifneq (${DEBUG_MODE},)
-		$(eval DEBUG_MODE_PARAM = --debug-mode)
-    endif
-endif
+ifeq ($(DEBUG_MODE),true)
+	$(eval DEBUG_MODE_PARAM = --debug-mode)
+endif
-ifneq (${DEBUG_MODE},"")
-    ifneq (${DEBUG_MODE},)
-		$(eval DEBUG_MODE_PARAM = --debug-mode)
-    endif
-endif
+ifeq ($(DEBUG_MODE),true)
+	$(eval DEBUG_MODE_PARAM = --debug-mode)
+endif

Also applies to: 348-348, 368-372, 378-378

make/dev.mk (1)

42-79: .ONESHELL affects all subsequent targets—confirm this global behavior is intended.

If you only needed a single shell for dev-deploy-e2e-local-debug, .ONESHELL will also change execution semantics of later recipes in this file. If that’s not intended, consider wrapping this recipe in a single-shell block instead of enabling .ONESHELL globally.

@MikelAlejoBR MikelAlejoBR force-pushed the SANDBOX-1561-debug-sandbox-resources-host-op branch from 574b517 to e63d183 Compare February 4, 2026 10:52
Adds a new Make target which triggers build in the underlying services
and operators which end up building the images without any code
optimizations and with Delve on them.

Once pushed and deployed to the local OpenShift cluster, it patches the
host operator, the member operator and the registration service to
launch them with the Delve executable, which allows debugging them on
port 50000 after port-forwarding to those pods.

SANDBOX-1561
@MikelAlejoBR MikelAlejoBR force-pushed the SANDBOX-1561-debug-sandbox-resources-host-op branch from e63d183 to e5db64d Compare February 16, 2026 16:49
@sonarqubecloud
Copy link

@openshift-ci
Copy link

openshift-ci bot commented Mar 18, 2026

PR needs rebase.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant