Skip to content

Add shared dev environment integration#410

Draft
mpryc wants to merge 1 commit into
medik8s:mainfrom
mpryc:add-dev-environment
Draft

Add shared dev environment integration#410
mpryc wants to merge 1 commit into
medik8s:mainfrom
mpryc:add-dev-environment

Conversation

@mpryc

@mpryc mpryc commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Why we need this PR

Integrates the shared medik8s dev environment from medik8s/tools. Adding a small snippet to the Makefile gives all contributors access to make dev-* targets for local development and testing.

Changes made

  • Makefile: Added dev environment snippet at the end. Uses a local sibling ../tools checkout if available, otherwise shallow-clones the tools repo into .tools/ on first use.
  • .gitignore: Added .tools/ to ignore the auto-cloned copy.

Available targets after this change

make dev-setup              # Create Kind cluster (1 CP + 3 workers)
make dev-deploy             # Build, load image, install CRDs, deploy operator
make dev-describe           # Full summary (nodes, pods, CRs, events)
make dev-simulate-failure   # Stop kubelet on a worker -> triggers remediation
make dev-recover            # Restore all workers
make dev-teardown           # Destroy Kind cluster
make dev-help               # Show all dev targets

Also supports external clusters (OCP, etc.) with SKIP_KIND=true and ttl.sh ephemeral registry.

Which issue(s) this PR fixes

N/A — new functionality.

Test plan

  • Verified make dev-setup && make dev-deploy && make dev-describe works on Kind (podman)
  • Verified SKIP_KIND=true make dev-setup && SKIP_KIND=true make dev-deploy works on OCP
  • Full NHC + SNR remediation flow tested end-to-end

Summary by CodeRabbit

  • New Features

    • Added automatic bootstrapping for shared development workflows, with a local fallback when the shared tools configuration isn’t available.
    • Dev workflow targets now self-provision the required tools when missing and automatically load the shared configuration when present.
  • Chores

    • Updated version control ignore rules to exclude locally generated development tool files under .tools/.

@openshift-ci

openshift-ci Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

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

openshift-ci Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: mpryc
Once this PR has been reviewed and has the lgtm label, please assign clobrano 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

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds Makefile bootstrap logic for shared dev-* workflows, including fallback cloning of medik8s/tools into a local .tools/ directory when needed, and ignores .tools/ in version control.

Changes

Dev environment bootstrap

Layer / File(s) Summary
Bootstrap logic and ignore rule
Makefile, .gitignore
Makefile defines TOOLS_DIR and DEV_MK, conditionally switches to a local .tools/ checkout when the shared dev makefile is missing, includes that makefile, and .gitignore excludes .tools/.
Dev target clone rule
Makefile
Adds the dev-% fallback that shallow-clones medik8s/tools into $(TOOLS_DIR), verifies $(DEV_MK), and re-invokes the requested target when the shared dev makefile is absent.

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

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: integrating the shared medik8s development environment.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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 current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Makefile`:
- Around line 549-557: The Makefile bootstrap currently clones medik8s/tools
during parse time and hides failures, so restrict the clone logic to dev-*
target paths and keep it out of unrelated targets. Update the DEV_MK bootstrap
around the existing DEV_MK/TOOLS_DIR checks so the git clone only runs when a
dev target is being invoked, and if the clone or include still fails, emit a
clear error instead of silently relying on -include.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e626ec6f-0174-4c6f-9f7a-71dc2c18c1a4

📥 Commits

Reviewing files that changed from the base of the PR and between d4a4253 and 4153ef0.

📒 Files selected for processing (2)
  • .gitignore
  • Makefile

Comment thread Makefile
@mpryc

mpryc commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

Depends-on: medik8s/tools#21

@mpryc
mpryc force-pushed the add-dev-environment branch from 4153ef0 to f7b138a Compare July 9, 2026 06:08

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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 current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Makefile`:
- Around line 554-559: The bootstrap fallback in the dev-% rule is not
idempotent and can re-clone into an existing .tools directory, causing confusing
git failures; update the Makefile logic around DEV_MK and dev-% to clean or
reuse prior state before running git clone, then verify that dev/dev.mk is
present after cloning and fail with a clear error if it is still missing. Make
sure the recursive $(MAKE) $@ path does not loop back into the same fallback
when DEV_MK remains absent, and handle repeated dev-* targets consistently by
checking the existing tools checkout before cloning.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1ad4bd1e-2c26-40cc-af24-829a9c161651

📥 Commits

Reviewing files that changed from the base of the PR and between 4153ef0 and f7b138a.

📒 Files selected for processing (2)
  • .gitignore
  • Makefile
✅ Files skipped from review due to trivial changes (1)
  • .gitignore

Comment thread Makefile
@mpryc
mpryc force-pushed the add-dev-environment branch from f7b138a to 5fb54b4 Compare July 9, 2026 11:50
Include the medik8s/tools dev environment snippet in the Makefile.
Uses a local sibling checkout (../tools) if available, otherwise
shallow-clones the tools repo into .tools/ on first use.

Signed-off-by: Michal Pryc <mpryc@redhat.com>
@mpryc
mpryc force-pushed the add-dev-environment branch from 5fb54b4 to 3889f47 Compare July 9, 2026 11:51
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