Skip to content

refactor(cli): group docker adapters#2991

Merged
cv merged 90 commits intomainfrom
refactor/layer-docker-adapters
May 6, 2026
Merged

refactor(cli): group docker adapters#2991
cv merged 90 commits intomainfrom
refactor/layer-docker-adapters

Conversation

@cv
Copy link
Copy Markdown
Contributor

@cv cv commented May 4, 2026

Summary

Move the Docker adapter package under src/lib/adapters/docker/** so Docker process boundaries live with the other adapter modules.

Stack Navigation

Changes

  • Moved src/lib/docker/** to src/lib/adapters/docker/**.
  • Updated Docker adapter imports across actions, onboarding/runtime helpers, services, shields, and tests.
  • Updated the Docker abstraction guard to use the new adapter path.
  • Kept behavior unchanged; this PR is a structural move plus import updates.

Type of Change

  • Code change (feature, bug fix, or refactor)
  • Code change with doc updates
  • Doc only (prose changes, no code sample modifications)
  • Doc only (includes code sample changes)

Verification

  • npx prek run --all-files --stage pre-push passes
  • npm run build:cli
  • npm run typecheck:cli
  • npx tsx scripts/check-layer-import-boundaries.ts
  • Docker adapter targeted tests pass
  • No secrets, API keys, or credentials committed
  • Docs updated for user-facing behavior changes
  • make docs builds without warnings (doc changes only)
  • Doc pages follow the style guide (doc changes only)
  • New doc pages include SPDX header and frontmatter (new pages only)

Signed-off-by: Carlos Villela cvillela@nvidia.com

Summary by CodeRabbit

  • Refactor
    • Reorganized internal Docker utility modules for improved code organization and maintainability. This structural change enhances the codebase architecture without affecting any user-facing functionality or features.

cv added 30 commits May 2, 2026 13:36
@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot Bot commented May 4, 2026

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 4, 2026

Caution

Review failed

Pull request was closed or merged during review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 67973ec6-18c3-4baa-82fa-527f613fcb34

📥 Commits

Reviewing files that changed from the base of the PR and between 392bebb and 7cdb0ec.

📒 Files selected for processing (10)
  • src/lib/actions/maintenance.ts
  • src/lib/actions/sandbox/snapshot.ts
  • src/lib/adapters/docker/exec.ts
  • src/lib/agent-base-image.test.ts
  • src/lib/agent-onboard.ts
  • src/lib/nim.ts
  • src/lib/onboard-vllm.ts
  • src/lib/onboard.ts
  • src/lib/sandbox-config.ts
  • src/nemoclaw.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/lib/nim.ts
  • src/lib/onboard.ts

📝 Walkthrough

Walkthrough

The docker module has been reorganized into an adapters directory structure. Import paths across the codebase are systematically updated from ./docker or ./lib/docker to ./adapters/docker or ./lib/adapters/docker. No functional logic or public API signatures were modified.

Changes

Docker Module Reorganization & Import Path Update

Layer / File(s) Summary
Adapter Module Imports
src/lib/adapters/docker/image.ts, src/lib/adapters/docker/run.ts, src/lib/adapters/docker/index.test.ts
Internal imports within the docker adapters layer updated from ../runner to ../../runner to reflect the new directory structure.
Action Module Updates
src/lib/actions/maintenance.ts, src/lib/actions/sandbox/destroy.ts, src/lib/actions/sandbox/snapshot.ts
Docker utility imports updated from ../../docker or ../../adapters/docker to point to the new ../../adapters/docker path.
Core Library Imports
src/lib/agent-onboard.ts, src/lib/debug.ts, src/lib/nim.ts, src/lib/onboard.ts, src/lib/services.ts, src/lib/shields.ts, src/lib/onboard-vllm.ts, src/lib/sandbox-config.ts
Docker module imports across utility and service files updated from ./docker to ./adapters/docker.
Entry Point & Type Imports
src/nemoclaw.ts
Docker imports updated to ./lib/adapters/docker; type-only imports added for SandboxEntry and Session.
Test Fixtures & Abstraction Guard
test/docker-abstraction-guard.test.ts, test/repro-2681-group-writable.test.ts, src/lib/agent-base-image.test.ts
Test file paths and mocked module references updated from legacy docker/ paths to new adapters/docker/ paths; mock setup remains functionally equivalent.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 The docker lives in adapters now, what a sight!
A hundred paths reorganized, all done just right.
No logic bent, no functions changed, the code still flows,
Just imports reshuffled where the adapter wind blows! 🌀

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 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 change: reorganizing Docker adapters from src/lib/docker to src/lib/adapters/docker to group them with other adapter modules.
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.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/layer-docker-adapters

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

@wscurran wscurran added NemoClaw CLI Use this label to identify issues with the NemoClaw command-line interface (CLI). Docker Support for Docker containerization refactor This is a refactor of the code and/or architecture. labels May 4, 2026
@cv cv mentioned this pull request May 4, 2026
14 tasks
@cv cv requested a review from prekshivyas May 5, 2026 00:28
@cv cv added the v0.0.35 Release target label May 5, 2026
@prekshivyas prekshivyas self-assigned this May 5, 2026
@cjagwani cjagwani assigned cjagwani and unassigned cjagwani May 5, 2026
@ericksoa ericksoa added v0.0.36 Release target and removed v0.0.35 Release target labels May 6, 2026
@cv
Copy link
Copy Markdown
Contributor Author

cv commented May 6, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 6, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

cv added a commit that referenced this pull request May 6, 2026
## Summary
Move registry, config, path, gateway, session, and sandbox persistence
modules into `src/lib/state/**` so persistence boundaries are visible in
paths.

## Stack Navigation
- Position: 59 of 60
- Previous PR: [#2988 — refactor(cli): group global
actions](#2988)
- Next PR: [#2991 — refactor(cli): group docker
adapters](#2991)

## Changes
- Moved registry/config/path/gateway/session/sandbox state modules under
`src/lib/state/`.
- Moved co-located state tests and updated dist/source paths in
integration tests.
- Updated action, command, onboarding, policy, service, and test imports
to the new state paths.
- Updated CodeRabbit path instructions and migrated-path guard canonical
paths for moved state modules.
- Kept behavior unchanged; this PR is a structural move plus import
updates.

## Type of Change
- [x] Code change (feature, bug fix, or refactor)
- [ ] Code change with doc updates
- [ ] Doc only (prose changes, no code sample modifications)
- [ ] Doc only (includes code sample changes)

## Verification
- [x] `npx prek run --all-files --stage pre-push` passes
- [x] `npm run build:cli`
- [x] `npm run typecheck:cli`
- [x] `npx tsx scripts/check-layer-import-boundaries.ts`
- [x] State and registry targeted tests pass
- [x] No secrets, API keys, or credentials committed
- [ ] Docs updated for user-facing behavior changes
- [ ] `make docs` builds without warnings (doc changes only)
- [ ] Doc pages follow the style guide (doc changes only)
- [ ] New doc pages include SPDX header and frontmatter (new pages only)

---
Signed-off-by: Carlos Villela <cvillela@nvidia.com>


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Refactor**
* Reorganized internal state management modules into a dedicated
directory structure to improve code organization and maintainability.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
@cv cv marked this pull request as ready for review May 6, 2026 18:32
@cv cv changed the base branch from refactor/layer-state-modules to main May 6, 2026 18:32
@cv cv enabled auto-merge (squash) May 6, 2026 18:32
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Copy link
Copy Markdown
Contributor

@prekshivyas prekshivyas left a comment

Choose a reason for hiding this comment

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

LGTM. Last PR in the 60-PR stack — same file-organization pattern, 26 files / +26 / -26.

Docker adapter modules moved src/lib/docker/**src/lib/adapters/docker/** (11 files). Most are 0+/0- pure renames; image.ts and run.ts have +1/-1 internal sibling-import updates. 15 consumer files have +1/-1 import-path migrations.

Docker abstraction guard test updated for the new path — necessary companion, not drift.

Verification checklist explicitly cites check-layer-import-boundaries.ts from #2986.

CI: pr.yaml mostly green (lint/dco/check-hash/legacy-path-guard/changes PASS); macos-e2e/wsl-e2e/checks + pr-self-hosted builds still in flight at review time. No failures.

@cv cv merged commit f98f951 into main May 6, 2026
15 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Docker Support for Docker containerization NemoClaw CLI Use this label to identify issues with the NemoClaw command-line interface (CLI). refactor This is a refactor of the code and/or architecture. v0.0.36 Release target

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants