Skip to content

feat(sandbox): Add support for mock device creation + testing for local Kind cluster#35

Open
jojung1 wants to merge 22 commits into
mainfrom
port/network-device-mocking-mr183
Open

feat(sandbox): Add support for mock device creation + testing for local Kind cluster#35
jojung1 wants to merge 22 commits into
mainfrom
port/network-device-mocking-mr183

Conversation

@jojung1

@jojung1 jojung1 commented Jun 6, 2026

Copy link
Copy Markdown
Collaborator

Description

Mock Device Sandbox for Local DHCP/ZTP Development

Mock Device Server (development/mock_devices/)

  • New Python package implementing FastAPI servers that emulate Cumulus NVUE and Arista EAPI device APIs, serving version-pinned fixture responses for use in local sandbox testing
  • Per-device fixture overrides (interface.json, platform_inventory.json) so each mock device returns its correct serial number and interface data via the API
  • Fixture generator CLI (generate-fixtures) that reads device topology JSONs and produces version-specific and per-device fixture files automatically
  • Nautobot wiring tool (wire CLI / make mock-wire-devices) that resolves each mock device's Kubernetes ClusterIP and updates Nautobot's primary_ip4, enabling Temporal workflows to reach mock devices

DHCP / ZTP Validation Tooling

  • DHCP validation client (validate CLI / make mock-dhcp-validate) that queries the Kea API through the DHCP service and checks for a matching reservation by hw-address or client-id, with no raw sockets required
  • DHCP discover client (dhcp CLI / make mock-dhcp-discover) that sends real DHCP DISCOVER/REQUEST UDP packets via a relay agent (giaddr), simulating a real switch booting for the first time
  • ZTP validation client (ztp-validate CLI / make mock-ztp-validate) that walks the full ZTP provisioning chain: DHCP reservation → boot script → serial validation → config retrieval
  • All three validation targets dynamically fetch the device's eth0 MAC from Nautobot at runtime so reservation matching uses hw-address (matching production switch behavior) and falls back to client-id/serial for devices without a MAC

Superpod Topology — DHCP/ZTP Support

  • Added two new config contexts to superpod/locations.yaml:
    • TEST-SITE Sandbox DHCP Subnet — registers the Kind pod network (10.244.0.0/16) as a Kea static subnet
    • Superpod-dhcp-options — sets reservations-global: true on eth0 interfaces and injects ZTP boot-file-name / cumulus-provision-url options into reservations

Kubernetes Manifests

  • Deployment manifest for 10 mock device pods (8 Cumulus switches, 2 UFM/NVOS) with per-pod serial environment variables
  • Job manifests for mock-wire-devices, mock-dhcp-validate, mock-dhcp-discover, and mock-ztp-validate, all parameterized via envsubst
  • DHCP dev service manifest exposing the Kea DHCP port inside the cluster for mock device jobs

Makefile Targets

  • mock-devices — deploys all mock device pods into the Kind cluster
  • mock-wire-devices — wires mock device ClusterIPs into Nautobot
  • mock-dhcp-validate / mock-dhcp-discover / mock-ztp-validate — end-to-end sandbox validation targets with configurable device/serial overrides
  • mock-status — shows pod and service state for all mock devices
  • sandbox-up and kind-up updated to use the superpod topology and deploy mock devices as part of the standard local dev setup

Helm / Deploy Config

  • Added local-superpod-sandbox.yaml deploy config and updated local Helm values to enable the DHCP dev service and wire the superpod topology

Breakdown of changes in this PR

Scope Files Additions % of total
development/mock_devices/fixtures/ 44 13,762 74.7%
Rest of development/mock_devices/ 21 4,166 22.6%
Everything outside mock_devices/ 13 499 2.7%
Total 78 18,427 100%

Though the PR looks daunting at first, most of the changes (almost 75%) are just from generated fixtures for mock_devices. Other mock_devices/ manifests/cli code makes up an additional 22.6%. Changes outside of the new mock_devices/ dir make up 2.7% of the entire PR (including boilerplate from local-superpod-sandbox.yaml). Meaningful files to look at outside of development/ should be Makefile (260 lines), topology YAML context additions (~62 lines), and the kea_dhcp_confgen.py (5 lines).

Validation

  • Standard CI passes.
  • Kind integration passes, or this PR explains why it was not run.

The kind integration test is manual due to taking ~30 min to complete. When the PR is ready for review,
run Actions -> Kind Integration -> Run workflow against the copy-pr-bot generated
pull-request/<PR_NUMBER> branch. Use the default test_path for the full suite,
or narrow it only while debugging.

Passing Kind Integration run:

Checklist

  • I am familiar with the contributing guidelines in CONTRIBUTING.md.
  • Commits are signed off for DCO compliance.
  • New or existing tests cover these changes, or the PR explains why tests are not needed.
  • Documentation is updated for user-facing behavior changes.
  • Generated artifacts are updated when applicable, such as OpenAPI specs,
    docs screenshots, or Helm/rendered outputs.

Summary by CodeRabbit

  • New Features

    • Local mock-device sandbox: build/deploy mock device pods, run DHCP/ZTP validation and wiring Jobs, wire devices into test IPAM, and trigger backup/cable workflows via Makefile targets; status/teardown commands included.
    • Packaged mock-device image/CLI: serve device APIs, run DHCP/ZTP transactions, generate fixtures, and perform wiring.
  • Configuration

    • New local-superpod-sandbox environment and optional DHCP socket-type (udp/raw) for local configs.
  • Documentation

    • Added detailed mock-devices README and updated local development quick-start.

@copy-pr-bot

copy-pr-bot Bot commented Jun 6, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented Jun 6, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a Kind-based sandbox: new local-superpod config, Makefile targets to build/load/deploy mock-device image and run Kubernetes Jobs, a mock-device Python package (CLI, FastAPI APIs, DHCP/ZTP clients, fixture generator, Nautobot wiring), container/pyproject, manifests and Jobs, a large fixture corpus, Helm DHCP socket wiring, and docs.

Changes

Mock Device Sandbox Testing System

Layer / File(s) Summary
Sandbox environment config and DHCP Helm wiring
deploy/configs/local-superpod-sandbox.yaml, deploy/helm/values.yaml, deploy/helm/values-local*.yaml, deploy/helm/templates/dhcp.yaml
Adds a local superpod sandbox config (mock_devices disabled), Kubernetes secret/feature flags, bootstrap job hook for MockTopologyDesign, and Helm values/templates to optionally set Kea DHCP dhcpSocketType (raw default vs udp override).
Makefile sandbox targets and orchestration flow
Makefile
Introduces KIND_CONTEXT/KUBECTL_KIND, updates kind-up to switch context, and adds targets to build/load the mock-device:local image, deploy/remove/mock-status for mock devices and DHCP dev service, run mock DHCP/ZTP validation/discover Jobs, wire devices in Nautobot, trigger Temporal workflows, and composite sandbox-up.
Multi-stage Dockerfile and packaging
development/mock_devices/Dockerfile, development/mock_devices/pyproject.toml
Adds multi-stage build: builder installs libpcap/openssl, generates TLS assets, builds venv; distroless runtime copies artifacts, runs as non-root, and sets console script mock-device.
Mock-device package: config, fixture loader, and CLI
development/mock_devices/mock_device/config.py, development/mock_devices/mock_device/device_api/fixtures.py, development/mock_devices/mock_device/cli.py, development/mock_devices/mock_device/__init__.py
Adds DeviceConfig Pydantic model (MAC/client-id derivation/from_env), FixtureLoader for device/platform/version-aware fixtures, and a Click CLI with serve, dhcp, validate, ztp-validate, wire, and generate-fixtures commands.
Mock-device API servers (NVUE & EAPI) and server runner
development/mock_devices/mock_device/device_api/nvue.py, development/mock_devices/mock_device/device_api/eapi.py, development/mock_devices/mock_device/device_api/server.py, development/mock_devices/mock_device/device_api/__init__.py
Implements NVUE REST and Arista EAPI JSON-RPC mock APIs with fixture-driven responses, revision endpoints, LLDP/ARP/bridge endpoints, session handling, and server creation/startup with optional TLS.
DHCP client, validation, ZTP client, fixture generator, and Nautobot wiring
development/mock_devices/mock_device/dhcp_client.py, development/mock_devices/mock_device/ztp_client.py, development/mock_devices/mock_device/fixture_generator.py, development/mock_devices/mock_device/wire_nautobot.py
Adds Scapy-based DHCP DISCOVER/REQUEST client and Kea reservation validator, ZTP end-to-end validator, fixture generator from topology JSON, and Nautobot wiring helpers to assign service ClusterIPs to mock devices.
Kubernetes manifests and Jobs for sandbox
development/mock_devices/manifests/*.yaml, development/mock_devices/manifests/dhcp-dev-service.yaml, development/mock_devices/manifests/mock-devices.yaml
Adds ClusterIP Kea DHCP dev service, Deployments and Services for 8 mock devices, and Jobs: mock-dhcp-discover, mock-dhcp-validate, mock-ztp-validate, mock-wire-devices with templated envsubst usage and hardened pod securityContexts.
Fixture corpus: device interfaces/platform/inventory and API fixtures
development/mock_devices/fixtures/devices/*, development/mock_devices/fixtures/eapi/4.29.5M/*, development/mock_devices/fixtures/nvue/5.*/*
Adds a large set of device interface, platform, and inventory JSON fixtures plus EAPI and NVUE versioned fixtures used by the mock APIs and generator.
Topology contexts and template updates
development/mock_topology/context/superpod/*, development/mock_topology/jobs/designs/config_contexts.yaml.j2
Updates a few device serials, adds sandbox DHCP config_contexts entries (site-scoped DHCP subnet and role-scoped DHCP options), and makes the design template emit config_context_schema__name when cc.schema is set.
Documentation: README and Quick Start
development/mock_devices/README.md, docs/getting-started/local-development-quick-start.mdx
Adds README documenting mock-device architecture, CLI usage, fixture generation, and operational steps; rewrites local quick-start to include make kind-up (render preview) and make sandbox-up (full mock sandbox) workflows.
Kea config generation wiring
src/nv_config_manager/dhcp/kea_dhcp_confgen.py
Injects dhcp-socket-type into generated Kea interfaces-config when NV_CONFIG_MANAGER_DHCP_SOCKET_TYPE is set in the environment.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Suggested reviewers

  • spidercensus
  • ryanheffernan
  • susanhooks
  • dmathur0

Poem

🐰 I stitched a sandbox from fixtures and code,
Mock devices hum along a Kind-built road,
DHCP offers, ZTP checks pass through,
Nautobot wires ClusterIPs true —
The rabbit hops, the tests all glow!

✨ 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 port/network-device-mocking-mr183

@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: 14

🤖 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 `@deploy/configs/local-dgxc-sandbox.yaml`:
- Line 8: The header comment in local-dgxc-sandbox.yaml incorrectly states "Used
by: make sandbox-up"; update that header to reference the correct make target or
usage (or remove the misleading line). Specifically, change the header so it no
longer claims it's used by the Makefile target sandbox-up (which actually points
to deploy/configs/local-superpod-sandbox.yaml in the Makefile), and optionally
add the correct usage note if this file is referenced by a different target or
script; check references to local-dgxc-sandbox.yaml and
local-superpod-sandbox.yaml in the Makefile to confirm the right target name to
put in the header.

In `@development/mock_devices/Dockerfile`:
- Line 26: The Dockerfile currently sets both files to 644 making the private
key world-readable; change the permission so /app/tls.key is owner-readable (and
writable) only (i.e., 600) while keeping /app/tls.crt as 644, by replacing the
existing chmod line that references /app/tls.key and /app/tls.crt with two
permission changes: one for the key (owner-only) and one for the cert
(public-readable).
- Around line 37-57: The Dockerfile runtime stage runs as root because there is
no USER directive; change it to create and use an unprivileged user/group (e.g.,
add a non-root UID/GID and chown runtime files) and set USER to that account so
ENTRYPOINT ["python", "-m", "mock_device.cli"] and CMD ["serve"] run
unprivileged; ensure you chown /app, /app/.venv, /app/mock_device, /app/fixtures
and copied TLS files to the same UID/GID so ownership matches at runtime.

In `@development/mock_devices/fixtures/nvue/5.13.1/platform_inventory.json`:
- Around line 2-3: The fallback inventory fixture currently has an empty
"serial" value for the entry with "model": "MSN2201", which breaks
serial-validation in ZTP paths; update the "serial" key to a deterministic
non-empty mock value (e.g., a consistent test serial like "MSN2201-MOCK-0001" or
similar) so downstream serial-required flows can validate against it, and ensure
only this JSON entry (the object containing "model": "MSN2201") is modified.

In `@development/mock_devices/manifests/mock-devices.yaml`:
- Around line 37-61: The mock device containers (container name "device-api")
lack a securityContext and run with default privileges and writable rootfs;
update each Deployment's pod/container spec for every device-api container to
add a securityContext that enforces non-root execution and minimal privileges:
set runAsNonRoot: true (and a non-root runAsUser if present in your
environment), set allowPrivilegeEscalation: false, drop all capabilities
(capabilities.drop: ["ALL"]), set readOnlyRootFilesystem: true, and add a
seccompProfile (e.g., type: RuntimeDefault) if supported; apply the same changes
to every device-api container instance referenced in the manifest.

In `@development/mock_devices/manifests/mock-dhcp-discover.yaml`:
- Around line 31-50: Add a restrictive securityContext to the dhcp-client
container: under the container named "dhcp-client" add a securityContext that
enforces non-root (runAsNonRoot: true and set runAsUser to a non-zero UID such
as 1000), disables privilege escalation (allowPrivilegeEscalation: false), drops
all Linux capabilities (capabilities: drop: ["ALL"]), and makes the root
filesystem read-only (readOnlyRootFilesystem: true); ensure these fields are
added to the container spec so the dhcp job runs as a non-root, non-privileged,
read-only process.

In `@development/mock_devices/manifests/mock-dhcp-validate.yaml`:
- Around line 24-42: The dhcp-validator container runs with default privileges;
update the pod spec for container name "dhcp-validator" to set a securityContext
that enforces runAsNonRoot: true, disable privilege escalation via
allowPrivilegeEscalation: false, set readOnlyRootFilesystem: true, and drop
unnecessary capabilities (e.g., add capabilityDrops: ["ALL"] or drop NET_RAW
etc. as appropriate); ensure any required file writes use an explicit writable
emptyDir volume mounted to a non-root writable path and set runAsUser/runAsGroup
if needed to match that volume.

In `@development/mock_devices/manifests/mock-wire-devices.yaml`:
- Around line 22-39: The wire container is a token-bearing workload (env
NAUTOBOT_TOKEN) and must get a restrictive securityContext; update the container
definition for the container named "wire" (image mock-device:local, args include
"wire") to enforce hardening: set runAsNonRoot: true and runAsUser to a non-root
UID (e.g. 1000), set readOnlyRootFilesystem: true, set allowPrivilegeEscalation:
false, drop all Linux capabilities (capabilities.drop: ["ALL"]), and add a
seccompProfile (runtime/default) and/or disable privilege escalation at pod
level if present. Apply these changes to the container's securityContext (or
pod.spec.securityContext) so the NAUTOBOT_TOKEN-bearing container runs with
least privilege.

In `@development/mock_devices/manifests/mock-ztp-validate.yaml`:
- Around line 38-57: The ztp-validator container currently runs with default
privileges; update the container spec for the container named "ztp-validator" to
enforce non-root and least-privilege settings by adding a securityContext: set
runAsNonRoot: true and runAsUser to a non-root UID (e.g. 1000), set
allowPrivilegeEscalation: false, drop all Linux capabilities (capabilities: {
drop: ["ALL"] }), and enable a readOnlyRootFilesystem: true (optionally set
runAsGroup and fsGroup if needed for writable volumes). Ensure these fields are
added under the "containers" -> name: ztp-validator block so the job runs
non-root, with no privilege escalation, no extra capabilities, and a read-only
root filesystem.

In `@development/mock_devices/mock_device/cli.py`:
- Line 150: The handlers dhcp, validate, and ztp_validate call os._exit(0 if
result.success else 1) which forcibly terminates the process; change these to
raise SystemExit(0 if result.success else 1) or call sys.exit(0 if
result.success else 1) so normal teardown runs. Locate the os._exit usage in the
functions named dhcp, validate, and ztp_validate in cli.py and replace it with a
SystemExit raise or sys.exit call, ensuring any imports (sys) are added if
needed.

In `@development/mock_devices/mock_device/device_api/eapi.py`:
- Around line 287-289: Loop over the incoming commands and validate each item
before calling .get(): if an item is a str use it as cmd_str, if it is a dict
extract cmd with cmd.get("cmd",""), otherwise treat it as an invalid param and
return a JSON-RPC error with code -32602 ("Invalid params") instead of calling
_dispatch_command; modify the block that currently iterates over commands and
calls _dispatch_command(cmd_str) so it performs isinstance checks on cmd and
short-circuits with the JSON-RPC -32602 response for non-str/non-dict items.

In `@development/mock_devices/README.md`:
- Around line 120-139: Add explicit language identifiers ("text") to the two
fenced code blocks in development/mock_devices/README.md that currently lack
them: the block starting with "fixtures/" (contains the nvue/eapi/devices tree)
and the block listing "make mock-topology ... make mock-workflow-*" (contains
make targets). Edit the opening triple-backtick lines for those blocks to be
```text so markdownlint MD040 is satisfied; do not alter the content inside the
blocks (look for the literal lines beginning with "fixtures/" and "make
mock-topology" to locate the exact blocks).

In `@Makefile`:
- Around line 964-987: The port-forward block launches a background process via
"kubectl port-forward" and assigns its PID to NB_PF but does not guarantee
cleanup if a command fails or the Make target is interrupted; add a trap to
always kill the NB_PF PID (and any other port-forward PIDs like T_PF) on
EXIT/ERR/INT to prevent stale port-forwards. Modify the section that starts the
background port-forward (the line using "kubectl port-forward -n $(NAMESPACE)
svc/nv-config-manager-nautobot 18080:80 &>/dev/null & \ NB_PF=$$!;") to register
a trap immediately after capturing $$! (e.g., trap 'kill $$NB_PF 2>/dev/null ||
true' EXIT INT TERM) and remove/reset the trap after the explicit kill is
performed later; apply the same pattern where T_PF is used in the other similar
blocks.
- Around line 932-939: The mock-devices-down target omits deleting the ZTP
validation job; update the mock-devices-down Makefile recipe to also remove the
mock-ztp-validate manifest by adding a kubectl delete -f
development/mock_devices/manifests/mock-ztp-validate.yaml --ignore-not-found
command so the job created by mock-ztp-validate is cleaned up; ensure this line
is added alongside the other kubectl delete invocations in the mock-devices-down
target.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 148ef1b5-4e78-4169-a40d-e3567940fbe4

📥 Commits

Reviewing files that changed from the base of the PR and between 48546c6 and 634b919.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (97)
  • Makefile
  • deploy/configs/local-dgxc-sandbox.yaml
  • deploy/configs/local-superpod-sandbox.yaml
  • deploy/helm/templates/dhcp.yaml
  • deploy/helm/values-local-medium.yaml
  • deploy/helm/values-local-small.yaml
  • deploy/helm/values-local.yaml
  • deploy/helm/values.yaml
  • development/mock_devices/Dockerfile
  • development/mock_devices/README.md
  • development/mock_devices/fixtures/devices/a04-u44-p01-tor-01/interface.json
  • development/mock_devices/fixtures/devices/a04-u44-p01-tor-01/platform.json
  • development/mock_devices/fixtures/devices/a04-u44-p01-tor-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/interface.json
  • development/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/platform.json
  • development/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/interface.json
  • development/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/platform.json
  • development/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/interface.json
  • development/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/platform.json
  • development/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/interface.json
  • development/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/platform.json
  • development/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/interface.json
  • development/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/platform.json
  • development/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a09-u36-p01-spine-01/interface.json
  • development/mock_devices/fixtures/devices/a09-u36-p01-spine-01/platform.json
  • development/mock_devices/fixtures/devices/a09-u36-p01-spine-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/interface.json
  • development/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/platform.json
  • development/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/bbr1-cp1-tan1-dc01/show_lldp_neighbors_detail.json
  • development/mock_devices/fixtures/devices/bbr2-cp1-tan1-dc01/show_lldp_neighbors_detail.json
  • development/mock_devices/fixtures/devices/core1-cg1-cp1-tan1-dc01/interface.json
  • development/mock_devices/fixtures/devices/core1-cg1-cp1-tan1-dc01/platform.json
  • development/mock_devices/fixtures/devices/leaf1-cno1-cp1-tan1-dc01/interface.json
  • development/mock_devices/fixtures/devices/leaf1-cno1-cp1-tan1-dc01/platform.json
  • development/mock_devices/fixtures/devices/leaf1-cp1-smn1-dc01/bridge_domain_mac_table.json
  • development/mock_devices/fixtures/devices/leaf1-cp1-smn1-dc01/interface.json
  • development/mock_devices/fixtures/devices/leaf1-cp1-smn1-dc01/platform.json
  • development/mock_devices/fixtures/devices/leaf2-cp1-smn1-dc01/bridge_domain_mac_table.json
  • development/mock_devices/fixtures/devices/leaf2-cp1-smn1-dc01/interface.json
  • development/mock_devices/fixtures/devices/leaf2-cp1-smn1-dc01/platform.json
  • development/mock_devices/fixtures/devices/spine1-cp1-smn1-dc01/interface.json
  • development/mock_devices/fixtures/devices/spine1-cp1-smn1-dc01/platform.json
  • development/mock_devices/fixtures/devices/spine2-cp1-smn1-dc01/interface.json
  • development/mock_devices/fixtures/devices/spine2-cp1-smn1-dc01/platform.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_hostname.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_interfaces_status.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_lldp_neighbors_detail.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_mac_address_table.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_mpls_interface.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_version.json
  • development/mock_devices/fixtures/nvue/5.11.0/bridge_domain_mac_table.json
  • development/mock_devices/fixtures/nvue/5.11.0/interface.json
  • development/mock_devices/fixtures/nvue/5.11.0/platform.json
  • development/mock_devices/fixtures/nvue/5.11.0/platform_inventory.json
  • development/mock_devices/fixtures/nvue/5.11.0/system.json
  • development/mock_devices/fixtures/nvue/5.13.1/interface.json
  • development/mock_devices/fixtures/nvue/5.13.1/platform.json
  • development/mock_devices/fixtures/nvue/5.13.1/platform_inventory.json
  • development/mock_devices/fixtures/nvue/5.13.1/system.json
  • development/mock_devices/fixtures/nvue/5.14.0/bridge_domain_mac_table.json
  • development/mock_devices/fixtures/nvue/5.14.0/interface.json
  • development/mock_devices/fixtures/nvue/5.14.0/platform.json
  • development/mock_devices/fixtures/nvue/5.14.0/platform_inventory.json
  • development/mock_devices/fixtures/nvue/5.14.0/system.json
  • development/mock_devices/manifests/dhcp-dev-service.yaml
  • development/mock_devices/manifests/mock-devices.yaml
  • development/mock_devices/manifests/mock-dhcp-discover.yaml
  • development/mock_devices/manifests/mock-dhcp-validate.yaml
  • development/mock_devices/manifests/mock-wire-devices.yaml
  • development/mock_devices/manifests/mock-ztp-validate.yaml
  • development/mock_devices/mock_device/__init__.py
  • development/mock_devices/mock_device/cli.py
  • development/mock_devices/mock_device/config.py
  • development/mock_devices/mock_device/device_api/__init__.py
  • development/mock_devices/mock_device/device_api/eapi.py
  • development/mock_devices/mock_device/device_api/fixtures.py
  • development/mock_devices/mock_device/device_api/nvue.py
  • development/mock_devices/mock_device/device_api/server.py
  • development/mock_devices/mock_device/dhcp_client.py
  • development/mock_devices/mock_device/fixture_generator.py
  • development/mock_devices/mock_device/wire_nautobot.py
  • development/mock_devices/mock_device/ztp_client.py
  • development/mock_devices/pyproject.toml
  • development/mock_devices/requirements.txt
  • development/mock_topology/context/dgx_cloud/locations.yaml
  • development/mock_topology/context/superpod/devices/a09-u23-p01-ufm-01.json
  • development/mock_topology/context/superpod/devices/b09-u23-p01-ufm-02.json
  • development/mock_topology/context/superpod/locations.yaml
  • development/mock_topology/jobs/designs/config_contexts.yaml.j2
  • pyproject.toml
  • src/nv_config_manager/dhcp/kea_dhcp_confgen.py

Comment thread deploy/configs/local-dgxc-sandbox.yaml Outdated
Comment thread development/mock_devices/Dockerfile Outdated
Comment thread development/mock_devices/Dockerfile
Comment thread development/mock_devices/fixtures/nvue/5.13.1/platform_inventory.json Outdated
Comment thread development/mock_devices/manifests/mock-devices.yaml
Comment thread development/mock_devices/manifests/mock-ztp-validate.yaml
Comment thread development/mock_devices/mock_device/cli.py Outdated
Comment thread development/mock_devices/mock_device/device_api/eapi.py
Comment thread development/mock_devices/README.md Outdated
Comment thread Makefile Outdated
@jojung1 jojung1 force-pushed the port/network-device-mocking-mr183 branch from 634b919 to 4f05f2b Compare June 6, 2026 22:35

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

🤖 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
`@development/mock_devices/fixtures/devices/leaf2-cp1-smn1-dc01/interface.json`:
- Around line 2-3: The VLAN fixtures use names like "Vlan1001" but
_nvue_iface_type in development/mock_devices/mock_device/fixture_generator.py
checks for "vlan" case-sensitively so VLANs are mis-typed as "swp"; update
_nvue_iface_type(name) to normalize the interface name (e.g., lowercase it) or
perform a case-insensitive prefix check (e.g., startswith("vlan")) so names like
"Vlan*" return "svi", then regenerate/verify the fixtures such as
development/mock_devices/fixtures/devices/leaf2-cp1-smn1-dc01/interface.json to
ensure Vlan1001/Vlan1002 have type "svi".

In `@development/mock_devices/README.md`:
- Line 195: Update the table cell text for "Config Deploy (diff)" to fix the
double-modal phrasing by replacing "Requires rendered config in Config Store"
with a clearer option such as "Requires a rendered config in Config Store" or
"Requires config to be rendered in Config Store" so the README reads naturally;
locate the table row labeled "Config Deploy (diff)" and edit that cell
accordingly.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 8f1f1475-edc9-4e3d-a740-ef32622572d4

📥 Commits

Reviewing files that changed from the base of the PR and between 634b919 and 4f05f2b.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (97)
  • Makefile
  • deploy/configs/local-dgxc-sandbox.yaml
  • deploy/configs/local-superpod-sandbox.yaml
  • deploy/helm/templates/dhcp.yaml
  • deploy/helm/values-local-medium.yaml
  • deploy/helm/values-local-small.yaml
  • deploy/helm/values-local.yaml
  • deploy/helm/values.yaml
  • development/mock_devices/Dockerfile
  • development/mock_devices/README.md
  • development/mock_devices/fixtures/devices/a04-u44-p01-tor-01/interface.json
  • development/mock_devices/fixtures/devices/a04-u44-p01-tor-01/platform.json
  • development/mock_devices/fixtures/devices/a04-u44-p01-tor-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/interface.json
  • development/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/platform.json
  • development/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/interface.json
  • development/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/platform.json
  • development/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/interface.json
  • development/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/platform.json
  • development/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/interface.json
  • development/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/platform.json
  • development/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/interface.json
  • development/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/platform.json
  • development/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a09-u36-p01-spine-01/interface.json
  • development/mock_devices/fixtures/devices/a09-u36-p01-spine-01/platform.json
  • development/mock_devices/fixtures/devices/a09-u36-p01-spine-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/interface.json
  • development/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/platform.json
  • development/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/bbr1-cp1-tan1-dc01/show_lldp_neighbors_detail.json
  • development/mock_devices/fixtures/devices/bbr2-cp1-tan1-dc01/show_lldp_neighbors_detail.json
  • development/mock_devices/fixtures/devices/core1-cg1-cp1-tan1-dc01/interface.json
  • development/mock_devices/fixtures/devices/core1-cg1-cp1-tan1-dc01/platform.json
  • development/mock_devices/fixtures/devices/leaf1-cno1-cp1-tan1-dc01/interface.json
  • development/mock_devices/fixtures/devices/leaf1-cno1-cp1-tan1-dc01/platform.json
  • development/mock_devices/fixtures/devices/leaf1-cp1-smn1-dc01/bridge_domain_mac_table.json
  • development/mock_devices/fixtures/devices/leaf1-cp1-smn1-dc01/interface.json
  • development/mock_devices/fixtures/devices/leaf1-cp1-smn1-dc01/platform.json
  • development/mock_devices/fixtures/devices/leaf2-cp1-smn1-dc01/bridge_domain_mac_table.json
  • development/mock_devices/fixtures/devices/leaf2-cp1-smn1-dc01/interface.json
  • development/mock_devices/fixtures/devices/leaf2-cp1-smn1-dc01/platform.json
  • development/mock_devices/fixtures/devices/spine1-cp1-smn1-dc01/interface.json
  • development/mock_devices/fixtures/devices/spine1-cp1-smn1-dc01/platform.json
  • development/mock_devices/fixtures/devices/spine2-cp1-smn1-dc01/interface.json
  • development/mock_devices/fixtures/devices/spine2-cp1-smn1-dc01/platform.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_hostname.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_interfaces_status.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_lldp_neighbors_detail.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_mac_address_table.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_mpls_interface.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_version.json
  • development/mock_devices/fixtures/nvue/5.11.0/bridge_domain_mac_table.json
  • development/mock_devices/fixtures/nvue/5.11.0/interface.json
  • development/mock_devices/fixtures/nvue/5.11.0/platform.json
  • development/mock_devices/fixtures/nvue/5.11.0/platform_inventory.json
  • development/mock_devices/fixtures/nvue/5.11.0/system.json
  • development/mock_devices/fixtures/nvue/5.13.1/interface.json
  • development/mock_devices/fixtures/nvue/5.13.1/platform.json
  • development/mock_devices/fixtures/nvue/5.13.1/platform_inventory.json
  • development/mock_devices/fixtures/nvue/5.13.1/system.json
  • development/mock_devices/fixtures/nvue/5.14.0/bridge_domain_mac_table.json
  • development/mock_devices/fixtures/nvue/5.14.0/interface.json
  • development/mock_devices/fixtures/nvue/5.14.0/platform.json
  • development/mock_devices/fixtures/nvue/5.14.0/platform_inventory.json
  • development/mock_devices/fixtures/nvue/5.14.0/system.json
  • development/mock_devices/manifests/dhcp-dev-service.yaml
  • development/mock_devices/manifests/mock-devices.yaml
  • development/mock_devices/manifests/mock-dhcp-discover.yaml
  • development/mock_devices/manifests/mock-dhcp-validate.yaml
  • development/mock_devices/manifests/mock-wire-devices.yaml
  • development/mock_devices/manifests/mock-ztp-validate.yaml
  • development/mock_devices/mock_device/__init__.py
  • development/mock_devices/mock_device/cli.py
  • development/mock_devices/mock_device/config.py
  • development/mock_devices/mock_device/device_api/__init__.py
  • development/mock_devices/mock_device/device_api/eapi.py
  • development/mock_devices/mock_device/device_api/fixtures.py
  • development/mock_devices/mock_device/device_api/nvue.py
  • development/mock_devices/mock_device/device_api/server.py
  • development/mock_devices/mock_device/dhcp_client.py
  • development/mock_devices/mock_device/fixture_generator.py
  • development/mock_devices/mock_device/wire_nautobot.py
  • development/mock_devices/mock_device/ztp_client.py
  • development/mock_devices/pyproject.toml
  • development/mock_devices/requirements.txt
  • development/mock_topology/context/dgx_cloud/locations.yaml
  • development/mock_topology/context/superpod/devices/a09-u23-p01-ufm-01.json
  • development/mock_topology/context/superpod/devices/b09-u23-p01-ufm-02.json
  • development/mock_topology/context/superpod/locations.yaml
  • development/mock_topology/jobs/designs/config_contexts.yaml.j2
  • pyproject.toml
  • src/nv_config_manager/dhcp/kea_dhcp_confgen.py
✅ Files skipped from review due to trivial changes (47)
  • development/mock_devices/mock_device/init.py
  • development/mock_devices/fixtures/eapi/4.29.5M/show_mac_address_table.json
  • development/mock_devices/fixtures/nvue/5.11.0/system.json
  • development/mock_devices/fixtures/nvue/5.11.0/platform.json
  • development/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/core1-cg1-cp1-tan1-dc01/platform.json
  • development/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/platform.json
  • development/mock_devices/fixtures/devices/spine1-cp1-smn1-dc01/platform.json
  • development/mock_devices/fixtures/nvue/5.14.0/platform_inventory.json
  • development/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/leaf1-cno1-cp1-tan1-dc01/platform.json
  • development/mock_devices/fixtures/devices/a04-u44-p01-tor-01/platform.json
  • development/mock_devices/fixtures/nvue/5.14.0/bridge_domain_mac_table.json
  • development/mock_devices/fixtures/nvue/5.14.0/system.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_hostname.json
  • development/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/platform.json
  • development/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a04-u44-p01-tor-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a09-u36-p01-spine-01/platform.json
  • development/mock_devices/fixtures/devices/leaf2-cp1-smn1-dc01/bridge_domain_mac_table.json
  • development/mock_devices/fixtures/nvue/5.13.1/platform.json
  • development/mock_devices/fixtures/nvue/5.11.0/bridge_domain_mac_table.json
  • development/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/platform.json
  • development/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_mpls_interface.json
  • development/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/platform_inventory.json
  • development/mock_devices/mock_device/device_api/init.py
  • development/mock_devices/fixtures/nvue/5.11.0/platform_inventory.json
  • development/mock_devices/fixtures/devices/a09-u36-p01-spine-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/leaf1-cp1-smn1-dc01/bridge_domain_mac_table.json
  • development/mock_devices/fixtures/devices/spine2-cp1-smn1-dc01/platform.json
  • development/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/interface.json
  • development/mock_devices/fixtures/devices/core1-cg1-cp1-tan1-dc01/interface.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_interfaces_status.json
  • development/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/interface.json
  • development/mock_devices/fixtures/devices/a09-u36-p01-spine-01/interface.json
  • development/mock_devices/fixtures/nvue/5.13.1/interface.json
  • development/mock_devices/fixtures/devices/leaf2-cp1-smn1-dc01/platform.json
  • development/mock_devices/fixtures/nvue/5.14.0/interface.json
  • development/mock_devices/fixtures/devices/leaf1-cno1-cp1-tan1-dc01/interface.json
  • development/mock_devices/fixtures/nvue/5.14.0/platform.json
  • development/mock_devices/fixtures/devices/leaf1-cp1-smn1-dc01/interface.json
  • development/mock_devices/fixtures/nvue/5.13.1/system.json
  • development/mock_devices/fixtures/devices/spine1-cp1-smn1-dc01/interface.json
  • development/mock_devices/fixtures/devices/bbr1-cp1-tan1-dc01/show_lldp_neighbors_detail.json
  • development/mock_devices/fixtures/devices/bbr2-cp1-tan1-dc01/show_lldp_neighbors_detail.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_lldp_neighbors_detail.json
🚧 Files skipped from review as they are similar to previous changes (25)
  • development/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/platform.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_version.json
  • development/mock_devices/fixtures/nvue/5.11.0/interface.json
  • deploy/helm/values-local-small.yaml
  • development/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/platform.json
  • development/mock_devices/fixtures/nvue/5.13.1/platform_inventory.json
  • development/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/platform.json
  • development/mock_devices/fixtures/devices/leaf1-cp1-smn1-dc01/platform.json
  • deploy/helm/values.yaml
  • development/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/platform_inventory.json
  • deploy/helm/values-local-medium.yaml
  • development/mock_devices/manifests/dhcp-dev-service.yaml
  • deploy/helm/values-local.yaml
  • deploy/configs/local-dgxc-sandbox.yaml
  • development/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/interface.json
  • development/mock_devices/fixtures/devices/a04-u44-p01-tor-01/interface.json
  • development/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/interface.json
  • deploy/helm/templates/dhcp.yaml
  • development/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/interface.json
  • development/mock_devices/mock_device/config.py
  • deploy/configs/local-superpod-sandbox.yaml
  • development/mock_devices/mock_device/device_api/fixtures.py
  • development/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/interface.json
  • development/mock_devices/mock_device/cli.py
  • development/mock_devices/mock_device/device_api/eapi.py

Comment thread development/mock_devices/fixtures/devices/leaf2-cp1-smn1-dc01/interface.json Outdated
Comment thread development/mock_devices/README.md Outdated

@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 `@deploy/configs/local-dgxc-sandbox.yaml`:
- Line 8: The header comment in deploy/configs/local-dgxc-sandbox.yaml
incorrectly states "Used by: make sandbox-up (dgx_cloud topology)"; update that
header to reflect the actual use (either remove the “Used by” line entirely or
change it to the correct target) — specifically replace the incorrect reference
with the real INSTALL_CONFIG used by make sandbox-up, e.g., "Used by: make
sandbox-up (deploy/configs/local-superpod-sandbox.yaml)" or delete the line if
this file is not referenced anywhere.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: f6a5aed6-b61e-4914-ac35-4230be63abb1

📥 Commits

Reviewing files that changed from the base of the PR and between 4f05f2b and 92bdb21.

📒 Files selected for processing (17)
  • Makefile
  • deploy/configs/local-dgxc-sandbox.yaml
  • development/mock_devices/Dockerfile
  • development/mock_devices/README.md
  • development/mock_devices/fixtures/nvue/5.13.1/platform_inventory.json
  • development/mock_devices/manifests/mock-devices.yaml
  • development/mock_devices/manifests/mock-dhcp-discover.yaml
  • development/mock_devices/manifests/mock-dhcp-validate.yaml
  • development/mock_devices/manifests/mock-wire-devices.yaml
  • development/mock_devices/manifests/mock-ztp-validate.yaml
  • development/mock_devices/mock_device/cli.py
  • development/mock_devices/mock_device/device_api/eapi.py
  • development/mock_devices/mock_device/device_api/fixtures.py
  • development/mock_devices/mock_device/dhcp_client.py
  • development/mock_devices/mock_device/fixture_generator.py
  • development/mock_devices/mock_device/wire_nautobot.py
  • development/mock_devices/mock_device/ztp_client.py
✅ Files skipped from review due to trivial changes (1)
  • development/mock_devices/README.md
🚧 Files skipped from review as they are similar to previous changes (6)
  • development/mock_devices/fixtures/nvue/5.13.1/platform_inventory.json
  • development/mock_devices/Dockerfile
  • development/mock_devices/manifests/mock-devices.yaml
  • development/mock_devices/mock_device/cli.py
  • development/mock_devices/mock_device/device_api/eapi.py
  • Makefile

Comment thread deploy/configs/local-dgxc-sandbox.yaml Outdated
@jojung1

jojung1 commented Jun 7, 2026

Copy link
Copy Markdown
Collaborator Author

/ok to test 92bdb21

Comment thread development/mock_devices/requirements.txt Outdated
Comment thread development/mock_devices/README.md Outdated
Comment thread development/mock_devices/README.md Outdated
Comment thread development/mock_devices/README.md Outdated
Comment thread pyproject.toml Outdated
@jojung1

jojung1 commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator Author

/ok to test c42861f

Comment thread docs/getting-started/local-development-quick-start.mdx Outdated
Comment thread docs/getting-started/local-development-quick-start.mdx Outdated
@jojung1 jojung1 force-pushed the port/network-device-mocking-mr183 branch from e6a83ae to 95b232b Compare June 9, 2026 20:25

@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 1063-1067: The Makefile targets mock-workflow-backup and
mock-workflow-cable-validate currently capture curl output into RESP but never
fail the recipe on HTTP errors; update the curl invocation to also capture the
HTTP status code and exit non‑zero for 4xx/5xx responses. Concretely, change the
curl call (the RESP assignment) to write the response body and HTTP status
separately (e.g., use curl -s -k -w "%{http_code}" to get the code or use
--fail/--fail-with-body where supported), set a RESP and RESP_CODE (or
equivalent), print the body, and if RESP_CODE >= 400 then echo an error and exit
1; otherwise print the success message. Target the RESP assignment and the
echo/exit flow in the mock-workflow-backup and mock-workflow-cable-validate
recipes.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: a1ca07be-6138-4343-8479-ab2ee72bf32a

📥 Commits

Reviewing files that changed from the base of the PR and between 0894770 and e6a83ae.

📒 Files selected for processing (2)
  • Makefile
  • docs/getting-started/local-development-quick-start.mdx

Comment thread Makefile Outdated

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

🧹 Nitpick comments (1)
development/mock_devices/fixtures/devices/spine2-cp1-smn1-dc01/interface.json (1)

9-10: 💤 Low value

Confirm empty eth0 IP address is intentional.

The eth0 interface has an empty address object, meaning no IP addresses are assigned. This is unusual for a management interface, especially since other devices in the fixture set (e.g., core1-cg1-cp1-tan1-dc01) have IPs assigned to eth0. Please confirm this is correct for spine2-cp1-smn1-dc01.

🤖 Prompt for 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.

In
`@development/mock_devices/fixtures/devices/spine2-cp1-smn1-dc01/interface.json`
around lines 9 - 10, The eth0 interface for device spine2-cp1-smn1-dc01
currently has an empty ip.address object; confirm whether this is intentional
for a management interface and either populate ip.address with the correct
management IP (matching the format used by other fixtures) or add a clear
comment/flag indicating it should be empty, or remove the eth0 ip block if eth0
is not meant to exist—locate the eth0 entry by the "eth0" interface name and the
"ip.address" property in the JSON and update accordingly.
🤖 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 1042-1045: The Makefile currently masks failures by appending "||
true" to kubectl wait, so change the kubectl wait invocations for the
mock-dhcp-validate job (and the analogous lines for mock-ztp-validate,
mock-wire-devices and downstream sandbox-up) to propagate failure instead of
swallowing it: remove the "|| true" fallback (or capture the kubectl wait exit
status and call "exit 1" on non-zero) so the make target fails when the Job
times out or fails; keep the subsequent kubectl logs call for diagnostics but
ensure the make recipe exits non-zero when kubectl wait does not succeed. Ensure
you update the three other blocks (lines referencing job/mock-ztp-validate,
job/mock-wire-devices and the sandbox-up flow) to use the same failure-handling
pattern.
- Around line 985-991: The Makefile targets (e.g., mock-devices-up) load images
into $(KIND_CLUSTER_NAME) but call kubectl without pinning context; update these
targets to use the existing $(KUBECTL_KIND) wrapper (or add --context
$(KIND_CLUSTER_NAME)) for all kubectl apply/delete/wait/logs/log calls so they
run against the Kind cluster; specifically replace instances of "kubectl" with
"$(KUBECTL_KIND)" in mock-devices-up and the other similar targets referenced
(the ranges around lines 1023-1045, 1048-1070, 1079-1101, 1104-1112) to ensure
commands target the Kind kubecontext.

---

Nitpick comments:
In
`@development/mock_devices/fixtures/devices/spine2-cp1-smn1-dc01/interface.json`:
- Around line 9-10: The eth0 interface for device spine2-cp1-smn1-dc01 currently
has an empty ip.address object; confirm whether this is intentional for a
management interface and either populate ip.address with the correct management
IP (matching the format used by other fixtures) or add a clear comment/flag
indicating it should be empty, or remove the eth0 ip block if eth0 is not meant
to exist—locate the eth0 entry by the "eth0" interface name and the "ip.address"
property in the JSON and update accordingly.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: a359c378-8e4e-4e68-894d-6bfdc8d85a2f

📥 Commits

Reviewing files that changed from the base of the PR and between e6a83ae and 95b232b.

📒 Files selected for processing (94)
  • Makefile
  • deploy/configs/local-superpod-sandbox.yaml
  • deploy/helm/templates/dhcp.yaml
  • deploy/helm/values-local-medium.yaml
  • deploy/helm/values-local-small.yaml
  • deploy/helm/values-local.yaml
  • deploy/helm/values.yaml
  • development/mock_devices/Dockerfile
  • development/mock_devices/README.md
  • development/mock_devices/fixtures/devices/a04-u44-p01-tor-01/interface.json
  • development/mock_devices/fixtures/devices/a04-u44-p01-tor-01/platform.json
  • development/mock_devices/fixtures/devices/a04-u44-p01-tor-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/interface.json
  • development/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/platform.json
  • development/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/interface.json
  • development/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/platform.json
  • development/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/interface.json
  • development/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/platform.json
  • development/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/interface.json
  • development/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/platform.json
  • development/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/interface.json
  • development/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/platform.json
  • development/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a09-u36-p01-spine-01/interface.json
  • development/mock_devices/fixtures/devices/a09-u36-p01-spine-01/platform.json
  • development/mock_devices/fixtures/devices/a09-u36-p01-spine-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/interface.json
  • development/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/platform.json
  • development/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/bbr1-cp1-tan1-dc01/show_lldp_neighbors_detail.json
  • development/mock_devices/fixtures/devices/bbr2-cp1-tan1-dc01/show_lldp_neighbors_detail.json
  • development/mock_devices/fixtures/devices/core1-cg1-cp1-tan1-dc01/interface.json
  • development/mock_devices/fixtures/devices/core1-cg1-cp1-tan1-dc01/platform.json
  • development/mock_devices/fixtures/devices/leaf1-cno1-cp1-tan1-dc01/interface.json
  • development/mock_devices/fixtures/devices/leaf1-cno1-cp1-tan1-dc01/platform.json
  • development/mock_devices/fixtures/devices/leaf1-cp1-smn1-dc01/bridge_domain_mac_table.json
  • development/mock_devices/fixtures/devices/leaf1-cp1-smn1-dc01/interface.json
  • development/mock_devices/fixtures/devices/leaf1-cp1-smn1-dc01/platform.json
  • development/mock_devices/fixtures/devices/leaf2-cp1-smn1-dc01/bridge_domain_mac_table.json
  • development/mock_devices/fixtures/devices/leaf2-cp1-smn1-dc01/interface.json
  • development/mock_devices/fixtures/devices/leaf2-cp1-smn1-dc01/platform.json
  • development/mock_devices/fixtures/devices/spine1-cp1-smn1-dc01/interface.json
  • development/mock_devices/fixtures/devices/spine1-cp1-smn1-dc01/platform.json
  • development/mock_devices/fixtures/devices/spine2-cp1-smn1-dc01/interface.json
  • development/mock_devices/fixtures/devices/spine2-cp1-smn1-dc01/platform.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_hostname.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_interfaces_status.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_lldp_neighbors_detail.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_mac_address_table.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_mpls_interface.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_version.json
  • development/mock_devices/fixtures/nvue/5.11.0/bridge_domain_mac_table.json
  • development/mock_devices/fixtures/nvue/5.11.0/interface.json
  • development/mock_devices/fixtures/nvue/5.11.0/platform.json
  • development/mock_devices/fixtures/nvue/5.11.0/platform_inventory.json
  • development/mock_devices/fixtures/nvue/5.11.0/system.json
  • development/mock_devices/fixtures/nvue/5.13.1/interface.json
  • development/mock_devices/fixtures/nvue/5.13.1/platform.json
  • development/mock_devices/fixtures/nvue/5.13.1/platform_inventory.json
  • development/mock_devices/fixtures/nvue/5.13.1/system.json
  • development/mock_devices/fixtures/nvue/5.14.0/bridge_domain_mac_table.json
  • development/mock_devices/fixtures/nvue/5.14.0/interface.json
  • development/mock_devices/fixtures/nvue/5.14.0/platform.json
  • development/mock_devices/fixtures/nvue/5.14.0/platform_inventory.json
  • development/mock_devices/fixtures/nvue/5.14.0/system.json
  • development/mock_devices/manifests/dhcp-dev-service.yaml
  • development/mock_devices/manifests/mock-devices.yaml
  • development/mock_devices/manifests/mock-dhcp-discover.yaml
  • development/mock_devices/manifests/mock-dhcp-validate.yaml
  • development/mock_devices/manifests/mock-wire-devices.yaml
  • development/mock_devices/manifests/mock-ztp-validate.yaml
  • development/mock_devices/mock_device/__init__.py
  • development/mock_devices/mock_device/cli.py
  • development/mock_devices/mock_device/config.py
  • development/mock_devices/mock_device/device_api/__init__.py
  • development/mock_devices/mock_device/device_api/eapi.py
  • development/mock_devices/mock_device/device_api/fixtures.py
  • development/mock_devices/mock_device/device_api/nvue.py
  • development/mock_devices/mock_device/device_api/server.py
  • development/mock_devices/mock_device/dhcp_client.py
  • development/mock_devices/mock_device/fixture_generator.py
  • development/mock_devices/mock_device/wire_nautobot.py
  • development/mock_devices/mock_device/ztp_client.py
  • development/mock_devices/pyproject.toml
  • development/mock_topology/context/superpod/devices/a09-u23-p01-ufm-01.json
  • development/mock_topology/context/superpod/devices/b09-u23-p01-ufm-02.json
  • development/mock_topology/context/superpod/locations.yaml
  • development/mock_topology/jobs/designs/config_contexts.yaml.j2
  • docs/getting-started/local-development-quick-start.mdx
  • src/nv_config_manager/dhcp/kea_dhcp_confgen.py
💤 Files with no reviewable changes (10)
  • development/mock_devices/mock_device/device_api/init.py
  • development/mock_devices/mock_device/init.py
  • development/mock_devices/manifests/mock-ztp-validate.yaml
  • development/mock_devices/manifests/mock-dhcp-validate.yaml
  • development/mock_devices/manifests/mock-dhcp-discover.yaml
  • development/mock_devices/manifests/mock-wire-devices.yaml
  • development/mock_devices/mock_device/config.py
  • development/mock_devices/mock_device/device_api/fixtures.py
  • development/mock_devices/mock_device/cli.py
  • development/mock_devices/mock_device/device_api/eapi.py
✅ Files skipped from review due to trivial changes (52)
  • development/mock_devices/fixtures/devices/spine1-cp1-smn1-dc01/platform.json
  • development/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/platform.json
  • development/mock_devices/fixtures/nvue/5.11.0/system.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_hostname.json
  • development/mock_devices/fixtures/devices/a04-u44-p01-tor-01/platform.json
  • development/mock_devices/fixtures/devices/leaf2-cp1-smn1-dc01/bridge_domain_mac_table.json
  • development/mock_devices/fixtures/nvue/5.11.0/interface.json
  • development/mock_devices/fixtures/nvue/5.11.0/bridge_domain_mac_table.json
  • development/mock_devices/fixtures/devices/a09-u36-p01-spine-01/platform.json
  • development/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a09-u36-p01-spine-01/platform_inventory.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_interfaces_status.json
  • development/mock_devices/fixtures/nvue/5.13.1/platform.json
  • development/mock_devices/fixtures/devices/leaf1-cno1-cp1-tan1-dc01/platform.json
  • development/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/platform.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_lldp_neighbors_detail.json
  • development/mock_devices/fixtures/nvue/5.14.0/interface.json
  • development/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/platform.json
  • development/mock_devices/fixtures/nvue/5.14.0/platform_inventory.json
  • development/mock_devices/fixtures/nvue/5.14.0/platform.json
  • development/mock_devices/fixtures/nvue/5.11.0/platform.json
  • development/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/platform.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_mpls_interface.json
  • development/mock_devices/fixtures/nvue/5.14.0/system.json
  • development/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/nvue/5.13.1/platform_inventory.json
  • development/mock_devices/fixtures/devices/core1-cg1-cp1-tan1-dc01/platform.json
  • development/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/interface.json
  • development/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/nvue/5.13.1/system.json
  • development/mock_devices/fixtures/devices/a04-u44-p01-tor-01/platform_inventory.json
  • development/mock_devices/fixtures/nvue/5.13.1/interface.json
  • development/mock_devices/fixtures/nvue/5.14.0/bridge_domain_mac_table.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_mac_address_table.json
  • development/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/platform.json
  • development/mock_devices/fixtures/devices/leaf2-cp1-smn1-dc01/interface.json
  • development/mock_devices/fixtures/devices/bbr1-cp1-tan1-dc01/show_lldp_neighbors_detail.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_version.json
  • development/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/interface.json
  • development/mock_devices/fixtures/devices/leaf1-cno1-cp1-tan1-dc01/interface.json
  • development/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/platform.json
  • development/mock_devices/fixtures/nvue/5.11.0/platform_inventory.json
  • development/mock_devices/fixtures/devices/bbr2-cp1-tan1-dc01/show_lldp_neighbors_detail.json
  • development/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/interface.json
  • deploy/helm/values-local-small.yaml
  • development/mock_devices/fixtures/devices/a04-u44-p01-tor-01/interface.json
  • development/mock_devices/fixtures/devices/spine1-cp1-smn1-dc01/interface.json
  • development/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/interface.json
  • development/mock_devices/fixtures/devices/leaf1-cp1-smn1-dc01/interface.json
🚧 Files skipped from review as they are similar to previous changes (14)
  • development/mock_devices/fixtures/devices/spine2-cp1-smn1-dc01/platform.json
  • development/mock_devices/fixtures/devices/leaf1-cp1-smn1-dc01/platform.json
  • development/mock_devices/fixtures/devices/leaf2-cp1-smn1-dc01/platform.json
  • deploy/helm/templates/dhcp.yaml
  • development/mock_devices/fixtures/devices/leaf1-cp1-smn1-dc01/bridge_domain_mac_table.json
  • deploy/helm/values-local-medium.yaml
  • deploy/helm/values.yaml
  • deploy/configs/local-superpod-sandbox.yaml
  • development/mock_devices/manifests/dhcp-dev-service.yaml
  • development/mock_devices/Dockerfile
  • development/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/interface.json
  • development/mock_devices/fixtures/devices/a09-u36-p01-spine-01/interface.json
  • development/mock_devices/README.md
  • development/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/interface.json

Comment thread Makefile Outdated
Comment thread Makefile Outdated

@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

Caution

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

⚠️ Outside diff range comments (2)
Makefile (2)

1144-1153: ⚠️ Potential issue | 🟠 Major

Fail workflow targets on curl transport errors
mock-workflow-backup and mock-workflow-cable-validate only fail when the parsed RESP_CODE is >= 400; DNS/TLS/connectivity failures let curl exit non-zero while %{http_code} typically becomes 000, so the recipes can still print the success banner even though the POST never reached the workflow API.

🤖 Prompt for 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.

In `@Makefile` around lines 1144 - 1153, The recipes (mock-workflow-backup and
mock-workflow-cable-validate) only check RESP_CODE >= 400 and thus succeed on
curl transport failures where http_code becomes 000; update the Makefile block
around RESP_AND_CODE/RESP/RESP_CODE to also detect failures by either enabling
curl's fail behavior (e.g., add -fS) or by capturing curl's exit status and
failing when curl returned non-zero or when RESP_CODE == "000", so the recipe
exits non-zero and prints an error instead of the success banner.

1029-1037: ⚠️ Potential issue | 🔴 Critical

Fail fast on Nautobot lookup/auth/parse errors instead of treating them as “MAC missing”.
In mock-dhcp-validate / mock-dhcp-discover / mock-ztp-validate, MOCK_*_MAC is derived from curl ... | python3 ... 2>/dev/null, and then empty MOCK_*_MAC triggers the “No eth0 MAC in Nautobot — falling back to client-id/serial matching” path. Without explicit handling for failed token retrieval, non-2xx responses, or JSON parse errors, broken Nautobot connectivity/auth looks identical to “no eth0 MAC stored”, masking dependency failures.

🤖 Prompt for 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.

In `@Makefile` around lines 1029 - 1037, The Nautobot lookup currently masks
failures by silencing errors and treating any empty MOCK_*_MAC as "missing MAC";
update the Makefile logic (the NB_TOKEN assignment and MOCK_DHCP_MAC computation
used by mock-dhcp-validate / mock-dhcp-discover / mock-ztp-validate) to fail
fast: verify NB_TOKEN is non-empty after the kubectl secret read and exit
non-zero with a clear error if it is missing, run curl with failure/error
reporting (do not redirect stderr to /dev/null and use curl -f or check its exit
code and HTTP status), and ensure the JSON parse step detects and propagates
parse errors (check python/json exit status) instead of suppressing them—on any
of these failures print an explicit error about Nautobot connectivity/auth/parse
and exit non-zero rather than falling back to client-id/serial matching.
🤖 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 14-15: The kind-up target currently hardcodes
"kind-$(KIND_CLUSTER_NAME)" instead of using the declared KIND_CONTEXT (and the
KUBECTL_KIND helper), so update the kind-up target to reference $(KIND_CONTEXT)
(or use the KUBECTL_KIND variable) wherever the hardcoded context string
"kind-$(KIND_CLUSTER_NAME)" appears (e.g., kubectl --context and context-setting
commands) so overrides of KIND_CONTEXT are honored; ensure all occurrences in
the kind-up recipe (and any related targets around it) are replaced.

---

Outside diff comments:
In `@Makefile`:
- Around line 1144-1153: The recipes (mock-workflow-backup and
mock-workflow-cable-validate) only check RESP_CODE >= 400 and thus succeed on
curl transport failures where http_code becomes 000; update the Makefile block
around RESP_AND_CODE/RESP/RESP_CODE to also detect failures by either enabling
curl's fail behavior (e.g., add -fS) or by capturing curl's exit status and
failing when curl returned non-zero or when RESP_CODE == "000", so the recipe
exits non-zero and prints an error instead of the success banner.
- Around line 1029-1037: The Nautobot lookup currently masks failures by
silencing errors and treating any empty MOCK_*_MAC as "missing MAC"; update the
Makefile logic (the NB_TOKEN assignment and MOCK_DHCP_MAC computation used by
mock-dhcp-validate / mock-dhcp-discover / mock-ztp-validate) to fail fast:
verify NB_TOKEN is non-empty after the kubectl secret read and exit non-zero
with a clear error if it is missing, run curl with failure/error reporting (do
not redirect stderr to /dev/null and use curl -f or check its exit code and HTTP
status), and ensure the JSON parse step detects and propagates parse errors
(check python/json exit status) instead of suppressing them—on any of these
failures print an explicit error about Nautobot connectivity/auth/parse and exit
non-zero rather than falling back to client-id/serial matching.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 85c9abc9-a12c-4f62-8c34-bbbba50c19c2

📥 Commits

Reviewing files that changed from the base of the PR and between c33738b and b2013d9.

📒 Files selected for processing (1)
  • Makefile

Comment thread Makefile
@jojung1

jojung1 commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator Author

/ok to test c18f79c

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

@jojung1 jojung1 requested a review from zsblevins June 9, 2026 22:51
@jojung1 jojung1 force-pushed the port/network-device-mocking-mr183 branch from c18f79c to 690d612 Compare June 10, 2026 17:43

@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.

♻️ Duplicate comments (1)
Makefile (1)

997-1004: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

mock-devices-down still misses ZTP validation job cleanup.

mock-ztp-validate creates the Job at line 1137, but its manifest is not deleted during teardown. This leaves stale job resources across runs.

Suggested fix
 mock-devices-down:
 	`@echo` "🗑️  Removing mock devices..."
 	$(KUBECTL_KIND) delete -f development/mock_devices/manifests/mock-devices.yaml --ignore-not-found
 	$(KUBECTL_KIND) delete -f development/mock_devices/manifests/mock-dhcp-discover.yaml --ignore-not-found
 	$(KUBECTL_KIND) delete -f development/mock_devices/manifests/mock-dhcp-validate.yaml --ignore-not-found
+	$(KUBECTL_KIND) delete -f development/mock_devices/manifests/mock-ztp-validate.yaml --ignore-not-found
 	$(KUBECTL_KIND) delete -f development/mock_devices/manifests/mock-wire-devices.yaml --ignore-not-found
 	$(KUBECTL_KIND) delete -f development/mock_devices/manifests/dhcp-dev-service.yaml --ignore-not-found
 	`@echo` "✅ Mock devices removed."
🤖 Prompt for 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.

In `@Makefile` around lines 997 - 1004, The mock-devices-down target fails to
delete the ZTP validation Job created by the mock-ztp-validate target; update
the mock-devices-down recipe (target name "mock-devices-down") to also delete
the ZTP validation manifest used by mock-ztp-validate (refer to the job
identifier "mock-ztp-validate" and its manifest file under
development/mock_devices/manifests) by adding a kubectl delete -f for that
manifest (with --ignore-not-found) so the Job is cleaned up during teardown.
🤖 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.

Duplicate comments:
In `@Makefile`:
- Around line 997-1004: The mock-devices-down target fails to delete the ZTP
validation Job created by the mock-ztp-validate target; update the
mock-devices-down recipe (target name "mock-devices-down") to also delete the
ZTP validation manifest used by mock-ztp-validate (refer to the job identifier
"mock-ztp-validate" and its manifest file under
development/mock_devices/manifests) by adding a kubectl delete -f for that
manifest (with --ignore-not-found) so the Job is cleaned up during teardown.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 782e3147-79be-4a66-ae33-53252e1affa6

📥 Commits

Reviewing files that changed from the base of the PR and between c18f79c and 690d612.

📒 Files selected for processing (94)
  • Makefile
  • deploy/configs/local-superpod-sandbox.yaml
  • deploy/helm/templates/dhcp.yaml
  • deploy/helm/values-local-medium.yaml
  • deploy/helm/values-local-small.yaml
  • deploy/helm/values-local.yaml
  • deploy/helm/values.yaml
  • development/mock_devices/Dockerfile
  • development/mock_devices/README.md
  • development/mock_devices/fixtures/devices/a04-u44-p01-tor-01/interface.json
  • development/mock_devices/fixtures/devices/a04-u44-p01-tor-01/platform.json
  • development/mock_devices/fixtures/devices/a04-u44-p01-tor-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/interface.json
  • development/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/platform.json
  • development/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/interface.json
  • development/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/platform.json
  • development/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/interface.json
  • development/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/platform.json
  • development/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/interface.json
  • development/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/platform.json
  • development/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/interface.json
  • development/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/platform.json
  • development/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a09-u36-p01-spine-01/interface.json
  • development/mock_devices/fixtures/devices/a09-u36-p01-spine-01/platform.json
  • development/mock_devices/fixtures/devices/a09-u36-p01-spine-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/interface.json
  • development/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/platform.json
  • development/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/bbr1-cp1-tan1-dc01/show_lldp_neighbors_detail.json
  • development/mock_devices/fixtures/devices/bbr2-cp1-tan1-dc01/show_lldp_neighbors_detail.json
  • development/mock_devices/fixtures/devices/core1-cg1-cp1-tan1-dc01/interface.json
  • development/mock_devices/fixtures/devices/core1-cg1-cp1-tan1-dc01/platform.json
  • development/mock_devices/fixtures/devices/leaf1-cno1-cp1-tan1-dc01/interface.json
  • development/mock_devices/fixtures/devices/leaf1-cno1-cp1-tan1-dc01/platform.json
  • development/mock_devices/fixtures/devices/leaf1-cp1-smn1-dc01/bridge_domain_mac_table.json
  • development/mock_devices/fixtures/devices/leaf1-cp1-smn1-dc01/interface.json
  • development/mock_devices/fixtures/devices/leaf1-cp1-smn1-dc01/platform.json
  • development/mock_devices/fixtures/devices/leaf2-cp1-smn1-dc01/bridge_domain_mac_table.json
  • development/mock_devices/fixtures/devices/leaf2-cp1-smn1-dc01/interface.json
  • development/mock_devices/fixtures/devices/leaf2-cp1-smn1-dc01/platform.json
  • development/mock_devices/fixtures/devices/spine1-cp1-smn1-dc01/interface.json
  • development/mock_devices/fixtures/devices/spine1-cp1-smn1-dc01/platform.json
  • development/mock_devices/fixtures/devices/spine2-cp1-smn1-dc01/interface.json
  • development/mock_devices/fixtures/devices/spine2-cp1-smn1-dc01/platform.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_hostname.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_interfaces_status.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_lldp_neighbors_detail.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_mac_address_table.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_mpls_interface.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_version.json
  • development/mock_devices/fixtures/nvue/5.11.0/bridge_domain_mac_table.json
  • development/mock_devices/fixtures/nvue/5.11.0/interface.json
  • development/mock_devices/fixtures/nvue/5.11.0/platform.json
  • development/mock_devices/fixtures/nvue/5.11.0/platform_inventory.json
  • development/mock_devices/fixtures/nvue/5.11.0/system.json
  • development/mock_devices/fixtures/nvue/5.13.1/interface.json
  • development/mock_devices/fixtures/nvue/5.13.1/platform.json
  • development/mock_devices/fixtures/nvue/5.13.1/platform_inventory.json
  • development/mock_devices/fixtures/nvue/5.13.1/system.json
  • development/mock_devices/fixtures/nvue/5.14.0/bridge_domain_mac_table.json
  • development/mock_devices/fixtures/nvue/5.14.0/interface.json
  • development/mock_devices/fixtures/nvue/5.14.0/platform.json
  • development/mock_devices/fixtures/nvue/5.14.0/platform_inventory.json
  • development/mock_devices/fixtures/nvue/5.14.0/system.json
  • development/mock_devices/manifests/dhcp-dev-service.yaml
  • development/mock_devices/manifests/mock-devices.yaml
  • development/mock_devices/manifests/mock-dhcp-discover.yaml
  • development/mock_devices/manifests/mock-dhcp-validate.yaml
  • development/mock_devices/manifests/mock-wire-devices.yaml
  • development/mock_devices/manifests/mock-ztp-validate.yaml
  • development/mock_devices/mock_device/__init__.py
  • development/mock_devices/mock_device/cli.py
  • development/mock_devices/mock_device/config.py
  • development/mock_devices/mock_device/device_api/__init__.py
  • development/mock_devices/mock_device/device_api/eapi.py
  • development/mock_devices/mock_device/device_api/fixtures.py
  • development/mock_devices/mock_device/device_api/nvue.py
  • development/mock_devices/mock_device/device_api/server.py
  • development/mock_devices/mock_device/dhcp_client.py
  • development/mock_devices/mock_device/fixture_generator.py
  • development/mock_devices/mock_device/wire_nautobot.py
  • development/mock_devices/mock_device/ztp_client.py
  • development/mock_devices/pyproject.toml
  • development/mock_topology/context/superpod/devices/a09-u23-p01-ufm-01.json
  • development/mock_topology/context/superpod/devices/b09-u23-p01-ufm-02.json
  • development/mock_topology/context/superpod/locations.yaml
  • development/mock_topology/jobs/designs/config_contexts.yaml.j2
  • docs/getting-started/local-development-quick-start.mdx
  • src/nv_config_manager/dhcp/kea_dhcp_confgen.py
✅ Files skipped from review due to trivial changes (55)
  • development/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/core1-cg1-cp1-tan1-dc01/platform.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_hostname.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_mac_address_table.json
  • development/mock_devices/fixtures/nvue/5.13.1/system.json
  • development/mock_devices/fixtures/devices/a09-u36-p01-spine-01/platform.json
  • development/mock_devices/fixtures/devices/a09-u36-p01-spine-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a04-u44-p01-tor-01/platform.json
  • development/mock_devices/mock_device/init.py
  • development/mock_devices/fixtures/devices/a04-u44-p01-tor-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/platform_inventory.json
  • development/mock_devices/fixtures/nvue/5.11.0/bridge_domain_mac_table.json
  • development/mock_devices/fixtures/nvue/5.11.0/system.json
  • development/mock_devices/fixtures/devices/leaf1-cno1-cp1-tan1-dc01/platform.json
  • development/mock_devices/fixtures/nvue/5.11.0/platform.json
  • development/mock_devices/fixtures/nvue/5.13.1/platform.json
  • development/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/nvue/5.14.0/interface.json
  • development/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/platform.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_mpls_interface.json
  • deploy/helm/values-local-medium.yaml
  • development/mock_devices/mock_device/device_api/init.py
  • development/mock_devices/fixtures/nvue/5.14.0/platform.json
  • development/mock_devices/fixtures/nvue/5.13.1/interface.json
  • development/mock_devices/fixtures/nvue/5.11.0/platform_inventory.json
  • development/mock_devices/fixtures/devices/core1-cg1-cp1-tan1-dc01/interface.json
  • development/mock_devices/fixtures/nvue/5.14.0/bridge_domain_mac_table.json
  • development/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/platform.json
  • deploy/helm/values-local-small.yaml
  • development/mock_devices/fixtures/nvue/5.14.0/platform_inventory.json
  • development/mock_devices/fixtures/devices/leaf1-cp1-smn1-dc01/platform.json
  • development/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/platform.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_interfaces_status.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_lldp_neighbors_detail.json
  • development/mock_devices/fixtures/devices/bbr1-cp1-tan1-dc01/show_lldp_neighbors_detail.json
  • development/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/platform.json
  • development/mock_devices/fixtures/devices/bbr2-cp1-tan1-dc01/show_lldp_neighbors_detail.json
  • development/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/interface.json
  • development/mock_devices/fixtures/devices/spine1-cp1-smn1-dc01/platform.json
  • development/mock_devices/fixtures/nvue/5.11.0/interface.json
  • development/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/interface.json
  • development/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/platform.json
  • development/mock_devices/fixtures/devices/spine2-cp1-smn1-dc01/platform.json
  • development/mock_devices/fixtures/devices/leaf1-cp1-smn1-dc01/interface.json
  • development/mock_devices/fixtures/devices/leaf2-cp1-smn1-dc01/platform.json
  • development/mock_devices/fixtures/devices/leaf2-cp1-smn1-dc01/bridge_domain_mac_table.json
  • development/mock_devices/fixtures/devices/a04-u44-p01-tor-01/interface.json
  • development/mock_devices/fixtures/devices/leaf2-cp1-smn1-dc01/interface.json
  • development/mock_devices/fixtures/devices/spine1-cp1-smn1-dc01/interface.json
  • development/mock_devices/fixtures/devices/leaf1-cno1-cp1-tan1-dc01/interface.json
  • development/mock_devices/README.md
  • development/mock_devices/fixtures/nvue/5.14.0/system.json
🚧 Files skipped from review as they are similar to previous changes (19)
  • development/mock_devices/fixtures/eapi/4.29.5M/show_version.json
  • deploy/helm/values-local.yaml
  • development/mock_devices/fixtures/nvue/5.13.1/platform_inventory.json
  • development/mock_devices/fixtures/devices/leaf1-cp1-smn1-dc01/bridge_domain_mac_table.json
  • development/mock_devices/fixtures/devices/spine2-cp1-smn1-dc01/interface.json
  • development/mock_devices/manifests/dhcp-dev-service.yaml
  • deploy/configs/local-superpod-sandbox.yaml
  • deploy/helm/templates/dhcp.yaml
  • deploy/helm/values.yaml
  • development/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/platform.json
  • development/mock_devices/Dockerfile
  • development/mock_devices/fixtures/devices/a09-u36-p01-spine-01/interface.json
  • development/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/interface.json
  • development/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/interface.json
  • development/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/interface.json
  • development/mock_devices/mock_device/cli.py
  • development/mock_devices/mock_device/config.py
  • development/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/interface.json
  • development/mock_devices/mock_device/device_api/eapi.py

@jojung1 jojung1 force-pushed the port/network-device-mocking-mr183 branch from 81e3ff0 to 5462168 Compare June 11, 2026 22:50

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

🤖 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
`@development/mock_devices/fixtures/devices/leaf1-cp1-smn1-dc01/interface.json`:
- Around line 2-3: Update the interface entries for Vlan1001 and Vlan1002 to use
the correct VLAN SVI type: change their "type" field from "swp" to "svi" so
these L3 VLAN interfaces are classified correctly (look for the "Vlan1001" and
"Vlan1002" JSON objects and modify the "type" property accordingly).

In `@development/mock_devices/manifests/mock-dhcp-discover.yaml`:
- Around line 50-56: The container hardening drops all capabilities so the DHCP
client in development/mock_devices/mock_device/dhcp_client.py cannot bind UDP
port 67; update the Pod spec's securityContext:capabilities to add
CAP_NET_BIND_SERVICE (i.e. add: - NET_BIND_SERVICE) alongside the existing drop:
- ALL so the process (while still non-root and readOnlyRootFilesystem) can bind
privileged port 67; ensure the changes are made under the securityContext →
capabilities block.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 3ff66ab9-e2e3-435a-8359-3cb485fe0be3

📥 Commits

Reviewing files that changed from the base of the PR and between 81e3ff0 and 5462168.

📒 Files selected for processing (94)
  • Makefile
  • deploy/configs/local-superpod-sandbox.yaml
  • deploy/helm/templates/dhcp.yaml
  • deploy/helm/values-local-medium.yaml
  • deploy/helm/values-local-small.yaml
  • deploy/helm/values-local.yaml
  • deploy/helm/values.yaml
  • development/mock_devices/Dockerfile
  • development/mock_devices/README.md
  • development/mock_devices/fixtures/devices/a04-u44-p01-tor-01/interface.json
  • development/mock_devices/fixtures/devices/a04-u44-p01-tor-01/platform.json
  • development/mock_devices/fixtures/devices/a04-u44-p01-tor-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/interface.json
  • development/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/platform.json
  • development/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/interface.json
  • development/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/platform.json
  • development/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/interface.json
  • development/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/platform.json
  • development/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/interface.json
  • development/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/platform.json
  • development/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/interface.json
  • development/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/platform.json
  • development/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a09-u36-p01-spine-01/interface.json
  • development/mock_devices/fixtures/devices/a09-u36-p01-spine-01/platform.json
  • development/mock_devices/fixtures/devices/a09-u36-p01-spine-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/interface.json
  • development/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/platform.json
  • development/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/bbr1-cp1-tan1-dc01/show_lldp_neighbors_detail.json
  • development/mock_devices/fixtures/devices/bbr2-cp1-tan1-dc01/show_lldp_neighbors_detail.json
  • development/mock_devices/fixtures/devices/core1-cg1-cp1-tan1-dc01/interface.json
  • development/mock_devices/fixtures/devices/core1-cg1-cp1-tan1-dc01/platform.json
  • development/mock_devices/fixtures/devices/leaf1-cno1-cp1-tan1-dc01/interface.json
  • development/mock_devices/fixtures/devices/leaf1-cno1-cp1-tan1-dc01/platform.json
  • development/mock_devices/fixtures/devices/leaf1-cp1-smn1-dc01/bridge_domain_mac_table.json
  • development/mock_devices/fixtures/devices/leaf1-cp1-smn1-dc01/interface.json
  • development/mock_devices/fixtures/devices/leaf1-cp1-smn1-dc01/platform.json
  • development/mock_devices/fixtures/devices/leaf2-cp1-smn1-dc01/bridge_domain_mac_table.json
  • development/mock_devices/fixtures/devices/leaf2-cp1-smn1-dc01/interface.json
  • development/mock_devices/fixtures/devices/leaf2-cp1-smn1-dc01/platform.json
  • development/mock_devices/fixtures/devices/spine1-cp1-smn1-dc01/interface.json
  • development/mock_devices/fixtures/devices/spine1-cp1-smn1-dc01/platform.json
  • development/mock_devices/fixtures/devices/spine2-cp1-smn1-dc01/interface.json
  • development/mock_devices/fixtures/devices/spine2-cp1-smn1-dc01/platform.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_hostname.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_interfaces_status.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_lldp_neighbors_detail.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_mac_address_table.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_mpls_interface.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_version.json
  • development/mock_devices/fixtures/nvue/5.11.0/bridge_domain_mac_table.json
  • development/mock_devices/fixtures/nvue/5.11.0/interface.json
  • development/mock_devices/fixtures/nvue/5.11.0/platform.json
  • development/mock_devices/fixtures/nvue/5.11.0/platform_inventory.json
  • development/mock_devices/fixtures/nvue/5.11.0/system.json
  • development/mock_devices/fixtures/nvue/5.13.1/interface.json
  • development/mock_devices/fixtures/nvue/5.13.1/platform.json
  • development/mock_devices/fixtures/nvue/5.13.1/platform_inventory.json
  • development/mock_devices/fixtures/nvue/5.13.1/system.json
  • development/mock_devices/fixtures/nvue/5.14.0/bridge_domain_mac_table.json
  • development/mock_devices/fixtures/nvue/5.14.0/interface.json
  • development/mock_devices/fixtures/nvue/5.14.0/platform.json
  • development/mock_devices/fixtures/nvue/5.14.0/platform_inventory.json
  • development/mock_devices/fixtures/nvue/5.14.0/system.json
  • development/mock_devices/manifests/dhcp-dev-service.yaml
  • development/mock_devices/manifests/mock-devices.yaml
  • development/mock_devices/manifests/mock-dhcp-discover.yaml
  • development/mock_devices/manifests/mock-dhcp-validate.yaml
  • development/mock_devices/manifests/mock-wire-devices.yaml
  • development/mock_devices/manifests/mock-ztp-validate.yaml
  • development/mock_devices/mock_device/__init__.py
  • development/mock_devices/mock_device/cli.py
  • development/mock_devices/mock_device/config.py
  • development/mock_devices/mock_device/device_api/__init__.py
  • development/mock_devices/mock_device/device_api/eapi.py
  • development/mock_devices/mock_device/device_api/fixtures.py
  • development/mock_devices/mock_device/device_api/nvue.py
  • development/mock_devices/mock_device/device_api/server.py
  • development/mock_devices/mock_device/dhcp_client.py
  • development/mock_devices/mock_device/fixture_generator.py
  • development/mock_devices/mock_device/wire_nautobot.py
  • development/mock_devices/mock_device/ztp_client.py
  • development/mock_devices/pyproject.toml
  • development/mock_topology/context/superpod/devices/a09-u23-p01-ufm-01.json
  • development/mock_topology/context/superpod/devices/b09-u23-p01-ufm-02.json
  • development/mock_topology/context/superpod/locations.yaml
  • development/mock_topology/jobs/designs/config_contexts.yaml.j2
  • docs/getting-started/local-development-quick-start.mdx
  • src/nv_config_manager/dhcp/kea_dhcp_confgen.py
💤 Files with no reviewable changes (8)
  • development/mock_devices/mock_device/init.py
  • development/mock_devices/mock_device/device_api/init.py
  • development/mock_devices/manifests/mock-ztp-validate.yaml
  • development/mock_devices/manifests/mock-wire-devices.yaml
  • development/mock_devices/manifests/mock-dhcp-validate.yaml
  • development/mock_devices/mock_device/config.py
  • development/mock_devices/mock_device/cli.py
  • development/mock_devices/mock_device/device_api/eapi.py
✅ Files skipped from review due to trivial changes (50)
  • development/mock_devices/fixtures/nvue/5.13.1/platform.json
  • development/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/nvue/5.14.0/platform_inventory.json
  • development/mock_devices/fixtures/nvue/5.11.0/system.json
  • development/mock_devices/fixtures/nvue/5.14.0/platform.json
  • development/mock_devices/fixtures/nvue/5.13.1/system.json
  • development/mock_devices/fixtures/nvue/5.14.0/bridge_domain_mac_table.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_version.json
  • development/mock_devices/fixtures/nvue/5.11.0/bridge_domain_mac_table.json
  • development/mock_devices/fixtures/devices/spine1-cp1-smn1-dc01/platform.json
  • development/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a09-u36-p01-spine-01/platform.json
  • development/mock_devices/fixtures/devices/spine2-cp1-smn1-dc01/platform.json
  • development/mock_devices/fixtures/devices/a04-u44-p01-tor-01/platform_inventory.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_hostname.json
  • development/mock_devices/fixtures/devices/core1-cg1-cp1-tan1-dc01/platform.json
  • development/mock_devices/fixtures/devices/a09-u36-p01-spine-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/leaf2-cp1-smn1-dc01/platform.json
  • development/mock_devices/fixtures/nvue/5.13.1/platform_inventory.json
  • development/mock_devices/fixtures/nvue/5.14.0/interface.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_interfaces_status.json
  • development/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/leaf1-cp1-smn1-dc01/platform.json
  • development/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/platform.json
  • development/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/platform.json
  • development/mock_devices/fixtures/nvue/5.11.0/platform.json
  • development/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/platform.json
  • development/mock_devices/fixtures/devices/a04-u44-p01-tor-01/platform.json
  • development/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/platform.json
  • development/mock_devices/fixtures/devices/bbr1-cp1-tan1-dc01/show_lldp_neighbors_detail.json
  • development/mock_devices/fixtures/devices/leaf2-cp1-smn1-dc01/interface.json
  • development/mock_devices/fixtures/devices/core1-cg1-cp1-tan1-dc01/interface.json
  • development/mock_devices/fixtures/devices/spine2-cp1-smn1-dc01/interface.json
  • development/mock_devices/fixtures/devices/leaf1-cno1-cp1-tan1-dc01/interface.json
  • development/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/interface.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_lldp_neighbors_detail.json
  • development/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/interface.json
  • development/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/platform.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_mpls_interface.json
  • development/mock_devices/fixtures/devices/bbr2-cp1-tan1-dc01/show_lldp_neighbors_detail.json
  • development/mock_devices/fixtures/nvue/5.13.1/interface.json
  • development/mock_devices/fixtures/devices/spine1-cp1-smn1-dc01/interface.json
  • development/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/interface.json
  • development/mock_devices/README.md
  • development/mock_devices/fixtures/nvue/5.14.0/system.json
  • development/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/interface.json
  • development/mock_devices/fixtures/devices/a04-u44-p01-tor-01/interface.json
  • development/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/interface.json
🚧 Files skipped from review as they are similar to previous changes (16)
  • deploy/helm/templates/dhcp.yaml
  • development/mock_devices/fixtures/nvue/5.11.0/platform_inventory.json
  • development/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/leaf1-cp1-smn1-dc01/bridge_domain_mac_table.json
  • development/mock_devices/fixtures/devices/leaf1-cno1-cp1-tan1-dc01/platform.json
  • deploy/helm/values-local.yaml
  • development/mock_devices/fixtures/eapi/4.29.5M/show_mac_address_table.json
  • deploy/helm/values-local-medium.yaml
  • development/mock_devices/fixtures/nvue/5.11.0/interface.json
  • development/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/platform.json
  • development/mock_devices/manifests/dhcp-dev-service.yaml
  • development/mock_devices/fixtures/devices/leaf2-cp1-smn1-dc01/bridge_domain_mac_table.json
  • deploy/helm/values-local-small.yaml
  • deploy/configs/local-superpod-sandbox.yaml
  • development/mock_devices/Dockerfile
  • development/mock_devices/fixtures/devices/a09-u36-p01-spine-01/interface.json

Comment thread development/mock_devices/fixtures/devices/leaf1-cp1-smn1-dc01/interface.json Outdated
Comment thread development/mock_devices/manifests/mock-dhcp-discover.yaml
@jojung1 jojung1 force-pushed the port/network-device-mocking-mr183 branch from 13b9f7e to 838208d Compare June 11, 2026 23:53

@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.

Caution

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

⚠️ Outside diff range comments (1)
development/mock_devices/manifests/mock-dhcp-discover.yaml (1)

50-58: ⚠️ Potential issue | 🟡 Minor

mock-device:local already runs as non-root (USER 65532), so runAsUser is only needed if the scanner requires it

mock-dhcp-discover.yaml sets a hardened container securityContext with runAsNonRoot: true, and the mock-device:local Dockerfile defines USER 65532:65532, so an explicit runAsUser isn’t necessary for runtime non-root enforcement. If KSV-0118 is still reported by the scanner, add runAsUser: 65532 (and optionally runAsGroup: 65532) in the container (or pod) securityContext to satisfy the rule.

🤖 Prompt for 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.

In `@development/mock_devices/manifests/mock-dhcp-discover.yaml` around lines 50 -
58, The manifest's container securityContext currently has runAsNonRoot: true
but no explicit UID; since the image mock-device:local sets USER 65532 you can
either leave it as-is or, to satisfy scanners reporting KSV-0118, add runAsUser:
65532 (and optionally runAsGroup: 65532) under the same securityContext for the
container (or pod) so the runtime UID is explicit; update the securityContext
block (which contains runAsNonRoot, allowPrivilegeEscalation,
readOnlyRootFilesystem, capabilities) to include runAsUser: 65532 (and
runAsGroup: 65532 if desired).
🤖 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.

Outside diff comments:
In `@development/mock_devices/manifests/mock-dhcp-discover.yaml`:
- Around line 50-58: The manifest's container securityContext currently has
runAsNonRoot: true but no explicit UID; since the image mock-device:local sets
USER 65532 you can either leave it as-is or, to satisfy scanners reporting
KSV-0118, add runAsUser: 65532 (and optionally runAsGroup: 65532) under the same
securityContext for the container (or pod) so the runtime UID is explicit;
update the securityContext block (which contains runAsNonRoot,
allowPrivilegeEscalation, readOnlyRootFilesystem, capabilities) to include
runAsUser: 65532 (and runAsGroup: 65532 if desired).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: d1f8dce3-d3de-4172-a075-58dfdddbeb03

📥 Commits

Reviewing files that changed from the base of the PR and between 5462168 and 13b9f7e.

📒 Files selected for processing (1)
  • development/mock_devices/manifests/mock-dhcp-discover.yaml

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

🧹 Nitpick comments (1)
development/mock_topology/context/superpod/locations.yaml (1)

78-94: 💤 Low value

Pool range format consistency.

The pool range "10.244.0.200 - 10.244.0.250" uses spaces around the dash, while auto-generated pools in kea_dhcp_confgen.py:639 use the format f"{first_ip}-{last_ip}" (no spaces). Both formats are likely accepted by Kea, but for consistency with the codebase's auto-generation pattern, consider using no spaces.

♻️ Suggested format for consistency
             pools:
-              - pool: "10.244.0.200 - 10.244.0.250"
+              - pool: "10.244.0.200-10.244.0.250"
🤖 Prompt for 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.

In `@development/mock_topology/context/superpod/locations.yaml` around lines 78 -
94, The pool range in the YAML uses spaces around the dash ("10.244.0.200 -
10.244.0.250") which is inconsistent with the auto-generated format used in
kea_dhcp_confgen.py (f"{first_ip}-{last_ip}"); update the pool value under the
subnet entry (the pools list in this file) to remove the spaces so it matches
the auto-generated pattern (e.g., "10.244.0.200-10.244.0.250") to keep
formatting consistent with kea_dhcp_confgen.py.
🤖 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 `@development/mock_devices/manifests/mock-dhcp-discover.yaml`:
- Line 40: Replace hardcoded "nv-config-manager" service namespace in endpoint
FQDNs with the templated ${NAMESPACE} variable: update the flag value
--dhcp-server=nv-config-manager-dhcp-dev.nv-config-manager.svc.cluster.local to
--dhcp-server=nv-config-manager-dhcp-dev.${NAMESPACE}.svc.cluster.local and make
the same substitution for the other hardcoded nv-config-manager FQDNs referenced
in the mock-dhcp-validate and mock-ztp-validate manifests (i.e., replace any
occurrence of ".nv-config-manager.svc.cluster.local" with
".${NAMESPACE}.svc.cluster.local" in the relevant command/arg strings).

In `@development/mock_devices/mock_device/device_api/fixtures.py`:
- Around line 98-102: The loop that returns self._read(path) for each candidate
currently lets a malformed JSON in FixtureLoader._read raise and abort the
request; wrap the call to self._read(path) in a try/except that catches JSON
parsing errors (e.g., json.JSONDecodeError or ValueError), log a warning with
the path and error, and continue to the next candidate so the loader falls back
to other fixtures or the hardcoded response when no valid JSON is found.

In `@development/mock_devices/mock_device/dhcp_client.py`:
- Around line 74-75: The DHCP client currently sets xid deterministically from
device.mac_bytes (xid = int.from_bytes(device.mac_bytes[:4], "big")), causing
reused transaction IDs; change xid to be generated fresh for each DHCP exchange
using a cryptographically-safe or sufficiently-random 32-bit value (e.g.,
secrets.randbits(32) or random.getrandbits(32)) at the point where xid is
assigned in dhcp_client.py so every send/transaction uses a new ID (ensure the
new xid is used for matching responses in the same helper functions that
reference xid).
- Around line 335-336: The call to response.json() (assigned to config) can
raise on non-JSON/error payloads and currently lets the exception escape; wrap
the JSON parse in a try/except around the line "config = response.json()" (and
any surrounding code in the same function, e.g., the DHCP API request handler)
and on exception return a structured DhcpResult failure with an appropriate
error message and status (instead of raising); ensure you catch
ValueError/JSONDecodeError and include the response.status_code/text in the
DhcpResult for debugging.

In `@development/mock_devices/mock_device/wire_nautobot.py`:
- Around line 334-352: The loop over device_map bypasses exceptions from
wire_device so a single failure aborts the batch; wrap the call to
wire_device(device_name, service_ip, namespace_id, status_id, client) in a
try/except, catch exceptions (Exception), create and append a failing WireResult
for that device with the exception string, log the error (logger.error including
device_name and exception), and continue the loop so subsequent devices are
processed; keep existing success/failure handling for normal return values from
wire_device.

In `@development/mock_devices/mock_device/ztp_client.py`:
- Around line 263-268: The ZtpStepResult currently includes a plaintext preview
of the boot/config payload (details["preview"]) which can leak sensitive data;
remove the preview field in both locations that construct ZtpStepResult (the one
using step="fetch-boot-script" and the similar return at lines ~351-356) and
keep only non-sensitive metadata such as details["size_bytes"] (or replace
preview with a redacted indicator like "preview": "<redacted>" if a flag is
required), updating any consumers that expect the preview accordingly.

In `@Makefile`:
- Around line 1170-1176: Validate the Nautobot token (NB_TOKEN) immediately
after reading it in the Makefile targets that set NB_TOKEN and DEVICE_ID (the
blocks using KUBECTL_KIND, NAMESPACE, HOSTNAME and MOCK_BACKUP_DEVICE); if
NB_TOKEN is empty or unset, print a clear error like "ERROR: Nautobot token
missing or secret not found" and exit non‑zero before attempting the
curl/DEVICE_ID lookup. Apply the same explicit check to the second occurrence of
this pattern (the block around the other NB_TOKEN read) so both targets fail
fast on missing credentials instead of later returning a misleading "device not
found" result.

---

Nitpick comments:
In `@development/mock_topology/context/superpod/locations.yaml`:
- Around line 78-94: The pool range in the YAML uses spaces around the dash
("10.244.0.200 - 10.244.0.250") which is inconsistent with the auto-generated
format used in kea_dhcp_confgen.py (f"{first_ip}-{last_ip}"); update the pool
value under the subnet entry (the pools list in this file) to remove the spaces
so it matches the auto-generated pattern (e.g., "10.244.0.200-10.244.0.250") to
keep formatting consistent with kea_dhcp_confgen.py.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: c0b5d009-34a9-4c5b-b934-79dfa4f46418

📥 Commits

Reviewing files that changed from the base of the PR and between 13b9f7e and 838208d.

📒 Files selected for processing (78)
  • Makefile
  • deploy/configs/local-superpod-sandbox.yaml
  • deploy/helm/templates/dhcp.yaml
  • deploy/helm/values-local-medium.yaml
  • deploy/helm/values-local-small.yaml
  • deploy/helm/values-local.yaml
  • deploy/helm/values.yaml
  • development/mock_devices/Dockerfile
  • development/mock_devices/README.md
  • development/mock_devices/fixtures/devices/a04-u44-p01-tor-01/interface.json
  • development/mock_devices/fixtures/devices/a04-u44-p01-tor-01/platform.json
  • development/mock_devices/fixtures/devices/a04-u44-p01-tor-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/interface.json
  • development/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/platform.json
  • development/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/interface.json
  • development/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/platform.json
  • development/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/interface.json
  • development/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/platform.json
  • development/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/interface.json
  • development/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/platform.json
  • development/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/interface.json
  • development/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/platform.json
  • development/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a09-u36-p01-spine-01/interface.json
  • development/mock_devices/fixtures/devices/a09-u36-p01-spine-01/platform.json
  • development/mock_devices/fixtures/devices/a09-u36-p01-spine-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/interface.json
  • development/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/platform.json
  • development/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_hostname.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_interfaces_status.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_lldp_neighbors_detail.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_mac_address_table.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_mpls_interface.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_version.json
  • development/mock_devices/fixtures/nvue/5.11.0/bridge_domain_mac_table.json
  • development/mock_devices/fixtures/nvue/5.11.0/interface.json
  • development/mock_devices/fixtures/nvue/5.11.0/platform.json
  • development/mock_devices/fixtures/nvue/5.11.0/platform_inventory.json
  • development/mock_devices/fixtures/nvue/5.11.0/system.json
  • development/mock_devices/fixtures/nvue/5.13.1/interface.json
  • development/mock_devices/fixtures/nvue/5.13.1/platform.json
  • development/mock_devices/fixtures/nvue/5.13.1/platform_inventory.json
  • development/mock_devices/fixtures/nvue/5.13.1/system.json
  • development/mock_devices/fixtures/nvue/5.14.0/bridge_domain_mac_table.json
  • development/mock_devices/fixtures/nvue/5.14.0/interface.json
  • development/mock_devices/fixtures/nvue/5.14.0/platform.json
  • development/mock_devices/fixtures/nvue/5.14.0/platform_inventory.json
  • development/mock_devices/fixtures/nvue/5.14.0/system.json
  • development/mock_devices/manifests/dhcp-dev-service.yaml
  • development/mock_devices/manifests/mock-devices.yaml
  • development/mock_devices/manifests/mock-dhcp-discover.yaml
  • development/mock_devices/manifests/mock-dhcp-validate.yaml
  • development/mock_devices/manifests/mock-wire-devices.yaml
  • development/mock_devices/manifests/mock-ztp-validate.yaml
  • development/mock_devices/mock_device/__init__.py
  • development/mock_devices/mock_device/cli.py
  • development/mock_devices/mock_device/config.py
  • development/mock_devices/mock_device/device_api/__init__.py
  • development/mock_devices/mock_device/device_api/eapi.py
  • development/mock_devices/mock_device/device_api/fixtures.py
  • development/mock_devices/mock_device/device_api/nvue.py
  • development/mock_devices/mock_device/device_api/server.py
  • development/mock_devices/mock_device/dhcp_client.py
  • development/mock_devices/mock_device/fixture_generator.py
  • development/mock_devices/mock_device/wire_nautobot.py
  • development/mock_devices/mock_device/ztp_client.py
  • development/mock_devices/pyproject.toml
  • development/mock_topology/context/superpod/devices/a09-u23-p01-ufm-01.json
  • development/mock_topology/context/superpod/devices/b09-u23-p01-ufm-02.json
  • development/mock_topology/context/superpod/locations.yaml
  • development/mock_topology/jobs/designs/config_contexts.yaml.j2
  • docs/getting-started/local-development-quick-start.mdx
  • src/nv_config_manager/dhcp/kea_dhcp_confgen.py
✅ Files skipped from review due to trivial changes (37)
  • development/mock_devices/fixtures/eapi/4.29.5M/show_hostname.json
  • development/mock_devices/fixtures/nvue/5.11.0/platform.json
  • development/mock_devices/fixtures/nvue/5.11.0/bridge_domain_mac_table.json
  • development/mock_devices/fixtures/nvue/5.14.0/interface.json
  • development/mock_topology/context/superpod/devices/a09-u23-p01-ufm-01.json
  • development/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/platform.json
  • development/mock_devices/mock_device/init.py
  • development/mock_devices/fixtures/nvue/5.11.0/interface.json
  • development/mock_devices/fixtures/nvue/5.14.0/bridge_domain_mac_table.json
  • development/mock_devices/fixtures/nvue/5.13.1/platform.json
  • development/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/nvue/5.13.1/system.json
  • development/mock_devices/fixtures/nvue/5.14.0/platform.json
  • development/mock_devices/fixtures/nvue/5.11.0/system.json
  • development/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/platform.json
  • development/mock_devices/fixtures/nvue/5.14.0/platform_inventory.json
  • development/mock_devices/fixtures/devices/a04-u44-p01-tor-01/platform_inventory.json
  • development/mock_devices/mock_device/device_api/init.py
  • development/mock_devices/fixtures/eapi/4.29.5M/show_interfaces_status.json
  • development/mock_topology/context/superpod/devices/b09-u23-p01-ufm-02.json
  • development/mock_devices/fixtures/devices/a09-u36-p01-spine-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/platform.json
  • development/mock_devices/fixtures/devices/a09-u36-p01-spine-01/platform.json
  • development/mock_devices/fixtures/nvue/5.11.0/platform_inventory.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_mac_address_table.json
  • development/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/platform.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_lldp_neighbors_detail.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_mpls_interface.json
  • development/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/interface.json
  • development/mock_devices/fixtures/devices/a04-u44-p01-tor-01/interface.json
  • development/mock_devices/fixtures/nvue/5.13.1/interface.json
  • development/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/interface.json
  • development/mock_devices/README.md
  • development/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/interface.json
🚧 Files skipped from review as they are similar to previous changes (21)
  • development/mock_devices/fixtures/nvue/5.14.0/system.json
  • deploy/helm/values-local.yaml
  • development/mock_devices/fixtures/nvue/5.13.1/platform_inventory.json
  • development/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/platform.json
  • development/mock_devices/fixtures/devices/a04-u44-p01-tor-01/platform.json
  • development/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/platform.json
  • deploy/helm/values-local-small.yaml
  • development/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/platform_inventory.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_version.json
  • deploy/helm/values.yaml
  • development/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/interface.json
  • development/mock_devices/manifests/dhcp-dev-service.yaml
  • development/mock_devices/fixtures/devices/a09-u36-p01-spine-01/interface.json
  • deploy/helm/values-local-medium.yaml
  • development/mock_devices/Dockerfile
  • deploy/configs/local-superpod-sandbox.yaml
  • deploy/helm/templates/dhcp.yaml
  • development/mock_devices/mock_device/device_api/eapi.py
  • development/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/interface.json
  • development/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/interface.json

Comment thread development/mock_devices/manifests/mock-dhcp-discover.yaml Outdated
Comment thread development/mock_devices/mock_device/device_api/fixtures.py
Comment thread development/mock_devices/mock_device/dhcp_client.py Outdated
Comment thread development/mock_devices/mock_device/dhcp_client.py Outdated
Comment thread development/mock_devices/mock_device/wire_nautobot.py
Comment thread development/mock_devices/mock_device/ztp_client.py
Comment thread Makefile
@jojung1

jojung1 commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator Author

/ok to test 4a829cd

jojung1 added 21 commits June 12, 2026 10:36
Signed-off-by: Joseph Jung <jojung@nvidia.com>
Signed-off-by: Joseph Jung <jojung@nvidia.com>
Signed-off-by: Joseph Jung <jojung@nvidia.com>
Signed-off-by: Joseph Jung <jojung@nvidia.com>
Signed-off-by: Joseph Jung <jojung@nvidia.com>
Signed-off-by: Joseph Jung <jojung@nvidia.com>
Signed-off-by: Joseph Jung <jojung@nvidia.com>
Signed-off-by: Joseph Jung <jojung@nvidia.com>
…'t be used

Signed-off-by: Joseph Jung <jojung@nvidia.com>
…ormation around mock device sandbox

Signed-off-by: Joseph Jung <jojung@nvidia.com>
…ward instructions

Signed-off-by: Joseph Jung <jojung@nvidia.com>
…ad of port-forwards

Signed-off-by: Joseph Jung <jojung@nvidia.com>
…rgets

Signed-off-by: Joseph Jung <jojung@nvidia.com>
…ng and kubectl context setting

Signed-off-by: Joseph Jung <jojung@nvidia.com>
Signed-off-by: Joseph Jung <jojung@nvidia.com>
Signed-off-by: Joseph Jung <jojung@nvidia.com>
Signed-off-by: Joseph Jung <jojung@nvidia.com>
Signed-off-by: Joseph Jung <jojung@nvidia.com>
Signed-off-by: Joseph Jung <jojung@nvidia.com>
Signed-off-by: Joseph Jung <jojung@nvidia.com>
Signed-off-by: Joseph Jung <jojung@nvidia.com>
@jojung1 jojung1 force-pushed the port/network-device-mocking-mr183 branch from 4a829cd to ce2bed0 Compare June 12, 2026 14:36

@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: 3

Caution

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

⚠️ Outside diff range comments (1)
docs/getting-started/local-development-quick-start.mdx (1)

59-77: ⚠️ Potential issue | 🔴 Critical

Fix installer CLI command naming in local preview docs

The docs use uv run nvcm-installer ..., but the referenced Makefile command name appears different (nv-config-manager-installer). A quick uv run ... --help from installer/ couldn’t find either CLI name in this environment, so the docs should align with however the project defines the installer entrypoint (per the Makefile/installer scripts).

🤖 Prompt for 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.

In `@docs/getting-started/local-development-quick-start.mdx` around lines 59 - 77,
The documentation shows the installer invocation as "uv run nvcm-installer ..."
but the actual project uses a different entrypoint name; update the command in
docs/getting-started/local-development-quick-start.mdx to match the project's
installer entrypoint as defined in the Makefile/installer scripts (for example
replace nvcm-installer with the actual CLI name such as
nv-config-manager-installer or the value used in the Makefile target), ensure
the example uses the exact CLI token used by the installer (and preserve the
same flags: deploy ../deploy/configs/local-superpod.yaml --image-source local
--build-images --load-kind --kind-cluster nv-config-manager
--install-envoy-gateway --install-cnpg-operator --install-cert-manager) so the
docs are accurate and runnable.
🧹 Nitpick comments (1)
development/mock_devices/mock_device/config.py (1)

48-50: 💤 Low value

Clarify that template syntax is limited string replacement, not full Jinja2.

The docstring at Line 49 states "Jinja2 template" but the implementation (lines 72-74) uses basic str.replace() for {{ serial | hex }} and {{ serial }} patterns only, not a Jinja2 engine. Update the docstring to avoid confusion.

📝 Suggested docstring update
     client_id_template: str = Field(
-        default="", description="Jinja2 template for client-id (e.g. '00:{{ serial | hex }}')"
+        default="", description="Template for client-id using {{ serial }} or {{ serial | hex }} markers (e.g. '00:{{ serial | hex }}')"
     )
🤖 Prompt for 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.

In `@development/mock_devices/mock_device/config.py` around lines 48 - 50, Update
the Field description for client_id_template to clarify that it is not a full
Jinja2 template engine but a limited string-replacement template: say it
supports only the two patterns "{{ serial }}" and "{{ serial | hex }}" via
simple str.replace-based substitution (refer to the replacement logic in the
client_id_template handling), so callers aren’t misled into using full Jinja2
features.
🤖 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 `@development/mock_devices/mock_device/config.py`:
- Around line 60-82: The client_id() method can raise ValueError when calling
bytes.fromhex(rendered.replace(":", "")) if the rendered string contains non-hex
characters; update client_id to catch that exception around the bytes.fromhex
call (or validate rendered first) and return None on failure, referencing the
client_id function, the rendered variable, and the bytes.fromhex call so the fix
encloses that conversion in a try/except that logs or ignores the ValueError and
returns None.
- Around line 89-106: The from_env() method currently calls
int(os.environ.get("MOCK_DEVICE_API_PORT", "0")) directly which will raise
ValueError on non-numeric values; update DeviceConfig.from_env to read the env
var into a local string (e.g., port_str = os.environ.get("MOCK_DEVICE_API_PORT",
"0")), attempt int(port_str) in a try/except, and on failure set api_port to 0
(or a safe default) — optionally emit a warning — and pass that safe integer
into the DeviceConfig(...) api_port field.

In `@docs/getting-started/local-development-quick-start.mdx`:
- Around line 86-99: Update the docs to accurately reflect the scope and
behavior of the make targets: change the `make mock-dhcp-validate` and `make
mock-ztp-validate` descriptions to state they validate only the single device
named by the environment variables `MOCK_DHCP_DEVICE` / `MOCK_ZTP_DEVICE`
(default `a04-u44-p01-tor-01`) rather than “all mock devices”, and change the
`make mock-workflow-backup` description to say it starts the Temporal workflow
(it does not wait for workflow completion) or alternatively update the `make
mock-workflow-backup` target to include a completion check if you want docs to
claim it waits for completion; ensure you reference the exact target names
(`make mock-dhcp-validate`, `make mock-ztp-validate`, `make
mock-workflow-backup`) and the env vars when editing the sentence text.

---

Outside diff comments:
In `@docs/getting-started/local-development-quick-start.mdx`:
- Around line 59-77: The documentation shows the installer invocation as "uv run
nvcm-installer ..." but the actual project uses a different entrypoint name;
update the command in docs/getting-started/local-development-quick-start.mdx to
match the project's installer entrypoint as defined in the Makefile/installer
scripts (for example replace nvcm-installer with the actual CLI name such as
nv-config-manager-installer or the value used in the Makefile target), ensure
the example uses the exact CLI token used by the installer (and preserve the
same flags: deploy ../deploy/configs/local-superpod.yaml --image-source local
--build-images --load-kind --kind-cluster nv-config-manager
--install-envoy-gateway --install-cnpg-operator --install-cert-manager) so the
docs are accurate and runnable.

---

Nitpick comments:
In `@development/mock_devices/mock_device/config.py`:
- Around line 48-50: Update the Field description for client_id_template to
clarify that it is not a full Jinja2 template engine but a limited
string-replacement template: say it supports only the two patterns "{{ serial
}}" and "{{ serial | hex }}" via simple str.replace-based substitution (refer to
the replacement logic in the client_id_template handling), so callers aren’t
misled into using full Jinja2 features.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 440fba0e-beab-41a1-bd9c-cbff8dd096aa

📥 Commits

Reviewing files that changed from the base of the PR and between 4a829cd and ce2bed0.

📒 Files selected for processing (78)
  • Makefile
  • deploy/configs/local-superpod-sandbox.yaml
  • deploy/helm/templates/dhcp.yaml
  • deploy/helm/values-local-medium.yaml
  • deploy/helm/values-local-small.yaml
  • deploy/helm/values-local.yaml
  • deploy/helm/values.yaml
  • development/mock_devices/Dockerfile
  • development/mock_devices/README.md
  • development/mock_devices/fixtures/devices/a04-u44-p01-tor-01/interface.json
  • development/mock_devices/fixtures/devices/a04-u44-p01-tor-01/platform.json
  • development/mock_devices/fixtures/devices/a04-u44-p01-tor-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/interface.json
  • development/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/platform.json
  • development/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/interface.json
  • development/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/platform.json
  • development/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/interface.json
  • development/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/platform.json
  • development/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/interface.json
  • development/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/platform.json
  • development/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/interface.json
  • development/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/platform.json
  • development/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a09-u36-p01-spine-01/interface.json
  • development/mock_devices/fixtures/devices/a09-u36-p01-spine-01/platform.json
  • development/mock_devices/fixtures/devices/a09-u36-p01-spine-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/interface.json
  • development/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/platform.json
  • development/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_hostname.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_interfaces_status.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_lldp_neighbors_detail.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_mac_address_table.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_mpls_interface.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_version.json
  • development/mock_devices/fixtures/nvue/5.11.0/bridge_domain_mac_table.json
  • development/mock_devices/fixtures/nvue/5.11.0/interface.json
  • development/mock_devices/fixtures/nvue/5.11.0/platform.json
  • development/mock_devices/fixtures/nvue/5.11.0/platform_inventory.json
  • development/mock_devices/fixtures/nvue/5.11.0/system.json
  • development/mock_devices/fixtures/nvue/5.13.1/interface.json
  • development/mock_devices/fixtures/nvue/5.13.1/platform.json
  • development/mock_devices/fixtures/nvue/5.13.1/platform_inventory.json
  • development/mock_devices/fixtures/nvue/5.13.1/system.json
  • development/mock_devices/fixtures/nvue/5.14.0/bridge_domain_mac_table.json
  • development/mock_devices/fixtures/nvue/5.14.0/interface.json
  • development/mock_devices/fixtures/nvue/5.14.0/platform.json
  • development/mock_devices/fixtures/nvue/5.14.0/platform_inventory.json
  • development/mock_devices/fixtures/nvue/5.14.0/system.json
  • development/mock_devices/manifests/dhcp-dev-service.yaml
  • development/mock_devices/manifests/mock-devices.yaml
  • development/mock_devices/manifests/mock-dhcp-discover.yaml
  • development/mock_devices/manifests/mock-dhcp-validate.yaml
  • development/mock_devices/manifests/mock-wire-devices.yaml
  • development/mock_devices/manifests/mock-ztp-validate.yaml
  • development/mock_devices/mock_device/__init__.py
  • development/mock_devices/mock_device/cli.py
  • development/mock_devices/mock_device/config.py
  • development/mock_devices/mock_device/device_api/__init__.py
  • development/mock_devices/mock_device/device_api/eapi.py
  • development/mock_devices/mock_device/device_api/fixtures.py
  • development/mock_devices/mock_device/device_api/nvue.py
  • development/mock_devices/mock_device/device_api/server.py
  • development/mock_devices/mock_device/dhcp_client.py
  • development/mock_devices/mock_device/fixture_generator.py
  • development/mock_devices/mock_device/wire_nautobot.py
  • development/mock_devices/mock_device/ztp_client.py
  • development/mock_devices/pyproject.toml
  • development/mock_topology/context/superpod/devices/a09-u23-p01-ufm-01.json
  • development/mock_topology/context/superpod/devices/b09-u23-p01-ufm-02.json
  • development/mock_topology/context/superpod/locations.yaml
  • development/mock_topology/jobs/designs/config_contexts.yaml.j2
  • docs/getting-started/local-development-quick-start.mdx
  • src/nv_config_manager/dhcp/kea_dhcp_confgen.py
✅ Files skipped from review due to trivial changes (35)
  • development/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/platform.json
  • development/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a09-u36-p01-spine-01/platform_inventory.json
  • development/mock_topology/context/superpod/devices/a09-u23-p01-ufm-01.json
  • development/mock_devices/fixtures/nvue/5.11.0/platform.json
  • development/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/platform_inventory.json
  • development/mock_devices/fixtures/nvue/5.14.0/interface.json
  • development/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/platform.json
  • development/mock_topology/context/superpod/devices/b09-u23-p01-ufm-02.json
  • development/mock_devices/fixtures/nvue/5.14.0/system.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_hostname.json
  • development/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/platform.json
  • development/mock_devices/fixtures/nvue/5.14.0/bridge_domain_mac_table.json
  • deploy/helm/values-local-small.yaml
  • development/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/interface.json
  • development/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/platform.json
  • development/mock_devices/fixtures/nvue/5.11.0/system.json
  • development/mock_devices/pyproject.toml
  • development/mock_devices/fixtures/nvue/5.13.1/system.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_mpls_interface.json
  • development/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/platform.json
  • development/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/nvue/5.13.1/platform_inventory.json
  • development/mock_devices/fixtures/devices/a04-u44-p01-tor-01/platform.json
  • development/mock_devices/fixtures/nvue/5.11.0/bridge_domain_mac_table.json
  • development/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/interface.json
  • development/mock_devices/mock_device/init.py
  • development/mock_devices/fixtures/nvue/5.11.0/platform_inventory.json
  • development/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_interfaces_status.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_lldp_neighbors_detail.json
  • development/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/nvue/5.14.0/platform_inventory.json
  • development/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/interface.json
🚧 Files skipped from review as they are similar to previous changes (33)
  • development/mock_devices/fixtures/devices/a04-u44-p01-tor-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/platform.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_version.json
  • development/mock_devices/manifests/mock-dhcp-validate.yaml
  • development/mock_devices/fixtures/eapi/4.29.5M/show_mac_address_table.json
  • development/mock_devices/fixtures/nvue/5.13.1/platform.json
  • development/mock_devices/fixtures/nvue/5.14.0/platform.json
  • src/nv_config_manager/dhcp/kea_dhcp_confgen.py
  • development/mock_devices/mock_device/device_api/init.py
  • development/mock_devices/fixtures/devices/a09-u36-p01-spine-01/platform.json
  • development/mock_devices/manifests/dhcp-dev-service.yaml
  • development/mock_devices/fixtures/nvue/5.11.0/interface.json
  • development/mock_topology/jobs/designs/config_contexts.yaml.j2
  • development/mock_devices/fixtures/devices/a04-u44-p01-tor-01/interface.json
  • development/mock_devices/manifests/mock-wire-devices.yaml
  • deploy/helm/templates/dhcp.yaml
  • development/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/interface.json
  • development/mock_devices/manifests/mock-dhcp-discover.yaml
  • deploy/helm/values.yaml
  • development/mock_devices/mock_device/device_api/server.py
  • deploy/helm/values-local.yaml
  • development/mock_devices/README.md
  • deploy/configs/local-superpod-sandbox.yaml
  • development/mock_devices/Dockerfile
  • development/mock_devices/manifests/mock-devices.yaml
  • development/mock_devices/fixtures/devices/a09-u36-p01-spine-01/interface.json
  • development/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/interface.json
  • development/mock_devices/mock_device/wire_nautobot.py
  • development/mock_devices/mock_device/dhcp_client.py
  • development/mock_devices/mock_device/device_api/nvue.py
  • development/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/interface.json
  • development/mock_topology/context/superpod/locations.yaml
  • development/mock_devices/mock_device/device_api/eapi.py

Comment thread development/mock_devices/mock_device/config.py Outdated
Comment thread development/mock_devices/mock_device/config.py
Comment thread docs/getting-started/local-development-quick-start.mdx
Signed-off-by: Joseph Jung <jojung@nvidia.com>
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.

2 participants