Skip to content

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

Open
jojung1 wants to merge 28 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 28 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

Release Notes

  • New Features

    • Added a Kind-based mock-device sandbox workflow for local testing, including mock device provisioning, DHCP/ZTP validation jobs, Nautobot wiring, and Temporal backup/cable-validation triggers.
    • Introduced sandbox-up plus new sandbox orchestration targets and improved Kind-context routing for related commands.
  • Configuration

    • Added optional Kea DHCP dhcpSocketType support, with "udp" enabled for local small/medium/local values.
  • Documentation

    • Updated the local development quick start with clear preview vs sandbox instructions.
    • Added end-to-end mock-device sandbox documentation.

@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

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: c833073d-8ade-469b-a666-dbed735a9982

📥 Commits

Reviewing files that changed from the base of the PR and between 13d0c28 and 987f9f9.

📒 Files selected for processing (2)
  • deploy/helm/templates/dhcp.yaml
  • deploy/helm/values.yaml
🚧 Files skipped from review as they are similar to previous changes (2)
  • deploy/helm/templates/dhcp.yaml
  • deploy/helm/values.yaml

📝 Walkthrough

Walkthrough

Adds a Kind-based mock-device sandbox, DHCP socket-type support, mock DHCP/ZTP/wiring workflows, fixture generation, and updated local development documentation.

Changes

Mock Device Sandbox Workflow

Layer / File(s) Summary
Sandbox config and DHCP wiring
deploy/configs/local-superpod-sandbox.yaml, deploy/helm/values.yaml, deploy/helm/values-local*.yaml, deploy/helm/templates/dhcp.yaml, development/mock_topology/context/superpod/*, development/mock_topology/jobs/designs/config_contexts.yaml.j2, src/nv_config_manager/dhcp/kea_dhcp_confgen.py
Adds the local sandbox config, DHCP socket-type Helm wiring, topology context updates, and DHCP generator support for the new socket-type value.
Container build and packaging
development/mock_devices/Dockerfile, development/mock_devices/pyproject.toml
Adds the mock-device Dockerfile and Python package metadata for the console script.
Mock-device config, CLI, and server routing
development/mock_devices/mock_device/config.py, development/mock_devices/mock_device/cli.py, development/mock_devices/mock_device/device_api/*
Adds DeviceConfig, the Click entrypoints, and platform-based mock device server routing.
Validation and wiring clients
development/mock_devices/mock_device/dhcp_client.py, development/mock_devices/mock_device/ztp_client.py, development/mock_devices/mock_device/wire_nautobot.py
Adds the DHCP client and validator, ZTP validation flow, and Nautobot wiring orchestration.
Fixture generation and fixture corpus
development/mock_devices/mock_device/fixture_generator.py, development/mock_devices/fixtures/*
Adds topology-driven fixture generation and the device/API fixture corpus used by the mock runtime.
Kubernetes manifests and Jobs
development/mock_devices/manifests/*
Adds the mock device deployments and services, the DHCP dev service, and the Kubernetes Jobs used for DHCP, ZTP, and wiring workflows.
Operational documentation
development/mock_devices/README.md, docs/getting-started/local-development-quick-start.mdx
Adds the mock-device README and updates the local development quick-start for render-only and sandbox modes.

Estimated code review effort: 4 (Complex) | ~45 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: local Kind sandbox support for mock device creation and testing.
Docstring Coverage ✅ Passed Docstring coverage is 82.67% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch port/network-device-mocking-mr183

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 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 added 25 commits July 2, 2026 10:47
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>
Signed-off-by: Joseph Jung <jojung@nvidia.com>
Signed-off-by: Joseph Jung <jojung@nvidia.com>
…n unintentionally when generating fixtures

Signed-off-by: Joseph Jung <jojung@nvidia.com>
…tures being clobbered

Signed-off-by: Joseph Jung <jojung@nvidia.com>
@jojung1 jojung1 force-pushed the port/network-device-mocking-mr183 branch from a0c511c to 41f214f Compare July 2, 2026 14:48

@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

♻️ Duplicate comments (2)
development/mock_devices/manifests/mock-wire-devices.yaml (1)

10-26: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Hardcoded namespace, including inside --nautobot-url.

Same issue flagged on mock-devices.yaml: metadata.namespace: nv-config-manager (line 11) and the in-cluster Nautobot FQDN nv-config-manager-nautobot.nv-config-manager.svc (line 26) both hardcode the namespace instead of ${NAMESPACE}. If NAMESPACE is overridden, this Job is created in the wrong namespace and/or points at the wrong Nautobot service, and Makefile's mock-devices-down/other -n $(NAMESPACE) operations will disagree with where the Job actually lives.

Template both occurrences with ${NAMESPACE} and route creation through envsubst, matching the pattern already used for the DHCP/ZTP job manifests.

🤖 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-wire-devices.yaml` around lines 10 -
26, The mock-wire-devices Job manifest hardcodes the namespace in both the
metadata namespace and the Nautobot service FQDN, which breaks deployments when
NAMESPACE is overridden. Update the manifest to use the same namespace
placeholder pattern as the other Job manifests, and ensure the rendered YAML
goes through envsubst so the Job is created in ${NAMESPACE} and the
--nautobot-url points to the matching in-cluster service for that namespace.
development/mock_devices/manifests/mock-devices.yaml (1)

19-23: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Hardcoded namespace: nv-config-manager breaks NAMESPACE overrides.

Every Deployment and Service in this file hardcodes namespace: nv-config-manager, while the Makefile's mock-devices-status and mock-devices-down targets operate against $(NAMESPACE) (default nv-config-manager, but overridable). If a developer runs make mock-devices-up NAMESPACE=<other>, resources land in nv-config-manager while mock-devices-status/other -n $(NAMESPACE) lookups target a different namespace, silently reporting "no mock devices found."

A very similar concern (mock-*.yaml hardcodes namespace: nv-config-manager vs. Makefile's $(NAMESPACE)) was raised previously and addressed for the DHCP/ZTP job manifests via ${NAMESPACE} + envsubst, but this Deployment/Service manifest and mock-wire-devices.yaml were left un-templated.

Template metadata.namespace: ${NAMESPACE} here and pipe through envsubst in the Makefile's mock-devices-up/mock-devices-down targets, consistent with the DHCP/ZTP job manifests.

Also applies to: 73-76, 128-131, 183-186, 238-241, 293-296, 348-351, 403-406, 458-461, 473-476, 488-491, 503-506, 518-521, 533-536, 548-551, 563-566

🤖 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-devices.yaml` around lines 19 - 23,
The mock device manifests hardcode metadata.namespace to nv-config-manager,
which bypasses the Makefile’s overridable NAMESPACE setting. Update the
Deployment/Service manifests in mock-devices.yaml to use ${NAMESPACE} instead of
a fixed namespace, and ensure the mock-devices-up and mock-devices-down targets
pipe the manifests through envsubst so the applied namespace matches
$(NAMESPACE). Use the existing mock device manifest structure and the symbols
mock-devices-up, mock-devices-down, and metadata.namespace to locate the change.
🧹 Nitpick comments (4)
development/mock_devices/manifests/mock-dhcp-discover.yaml (1)

17-25: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

No ttlSecondsAfterFinished for this one-shot Job.

Unlike mock-wire-devices.yaml (ttlSecondsAfterFinished: 300), this Job (and mock-dhcp-validate.yaml) has no TTL, so completed/failed Jobs and their Pods persist until explicitly deleted. The Makefile does delete the Job before re-running, but repeated ad-hoc kubectl apply/manual testing outside the Makefile flow will accumulate stale Job/Pod objects.

🤖 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 17 -
25, The one-shot Job defined by mock-dhcp-discover (and similarly
mock-dhcp-validate) is missing ttlSecondsAfterFinished, so completed or failed
Job/Pod objects will linger. Add a TTL value consistent with
mock-wire-devices.yaml to the Job spec in these manifests so Kubernetes cleans
up finished resources automatically, and keep the existing backoffLimit behavior
unchanged.
Makefile (2)

1068-1273: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy lift

Significant duplicated shell logic across five mock targets.

mock-dhcp-validate, mock-dhcp-discover, mock-ztp-validate, mock-workflow-backup, and mock-workflow-cable-validate each re-implement the same ~15-20 line pattern: read NB_TOKEN from the nautobot-token secret, validate non-empty, curl Nautobot with -w "\n%{http_code}", split body/code, fail on 000/>=400, then parse JSON with python3. checkmake also flags each of these targets for excessive recipe length (37/37/37/29/29 lines vs. the 5-line guideline).

The prior review history shows several of these targets received the same fix (HTTP status checks, token validation) applied piecemeal at different times — a symptom of this duplication causing drift risk. Consider extracting the shared logic into a small script (e.g., development/mock_devices/scripts/nautobot_lookup.sh <query-path> <device-var>) invoked from each target, or a define/endef canned recipe.

🤖 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 1068 - 1273, The five mock targets repeat the same
Nautobot token fetch, HTTP status handling, and JSON parsing logic, which is
causing long recipes and drift risk. Extract that shared lookup flow from
mock-dhcp-validate, mock-dhcp-discover, mock-ztp-validate, mock-workflow-backup,
and mock-workflow-cable-validate into a single reusable helper (for example a
shell script or a canned Makefile recipe), then have each target call it and
keep only the target-specific apply/post steps.

Source: Linters/SAST tools


1077-1084: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

External curl calls lack a timeout.

None of the Nautobot/workflow curl invocations set --max-time/--connect-timeout. If the target host hangs, the make target blocks indefinitely instead of failing fast.

Suggested pattern (apply to each curl invocation)
-	NB_RESP=$$(curl -sk -w "\n%{http_code}" -H "Authorization: Token $$NB_TOKEN" \
+	NB_RESP=$$(curl -sk --max-time 10 -w "\n%{http_code}" -H "Authorization: Token $$NB_TOKEN" \
 		"https://nautobot.$(HOSTNAME)/api/dcim/interfaces/?device=$(MOCK_DHCP_DEVICE)&name=eth0&limit=1"); \

Also applies to: 1117-1124, 1163-1170, 1217-1218, 1231-1233, 1250-1251, 1264-1266

🤖 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 1077 - 1084, The Nautobot/workflow curl calls in the
Makefile can hang indefinitely because they do not set any timeout options.
Update each curl invocation in this target family to include both a connection
timeout and an overall max time so failures return promptly; make sure the fix
is applied consistently to the interface lookup block and the other referenced
curl call sites in the same Makefile section.
development/mock_devices/manifests/mock-devices.yaml (1)

15-575: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚖️ Poor tradeoff

Eight near-identical Deployment/Service blocks.

Each of the 8 device blocks (and matching Services) differs only in name, serial, and a couple of labels. Since this is a raw manifest (no Kustomize/Helm templating), any future change to resources, security context, or ports must be repeated 8 times — as evidenced by the prior review requiring the same securityContext patch applied "also applies to" 7 other blocks.

Consider generating this file from a small template (Kustomize components/patchesStrategicMerge, or extending the existing fixture_generator.py) driven by the device list, to keep future edits single-sourced.

🤖 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-devices.yaml` around lines 15 - 575,
The manifest is still hand-duplicating eight near-identical Deployment/Service
pairs, which makes future updates error-prone. Refactor the mock-device manifest
generation so the repeated blocks for mock-sp-tor-01 through mock-sp-pleaf-01
come from a single template or generator input (for example via
fixture_generator.py or Kustomize), with only per-device values like
MOCK_DEVICE_NAME, MOCK_DEVICE_SERIAL, mock-device-role, and service selectors
varying. Keep shared fields like resources, securityContext, ports, and
container image defined once in the generator/template so all device blocks stay
single-sourced.
🤖 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 1029-1037: The mock-devices-up target uses the static
mock-device:local tag, so reapplying the manifests does not force Kubernetes to
restart existing pods after a rebuild. Update the deployment flow in the
Makefile target and the mock-devices manifest(s) so that each rebuild results in
a rollout, either by changing the pod template with a fresh image reference or
by explicitly triggering a rollout restart after kind load docker-image. Use the
mock-devices-up target and the mock-devices.yaml deployment definition as the
main places to apply the fix.

---

Duplicate comments:
In `@development/mock_devices/manifests/mock-devices.yaml`:
- Around line 19-23: The mock device manifests hardcode metadata.namespace to
nv-config-manager, which bypasses the Makefile’s overridable NAMESPACE setting.
Update the Deployment/Service manifests in mock-devices.yaml to use ${NAMESPACE}
instead of a fixed namespace, and ensure the mock-devices-up and
mock-devices-down targets pipe the manifests through envsubst so the applied
namespace matches $(NAMESPACE). Use the existing mock device manifest structure
and the symbols mock-devices-up, mock-devices-down, and metadata.namespace to
locate the change.

In `@development/mock_devices/manifests/mock-wire-devices.yaml`:
- Around line 10-26: The mock-wire-devices Job manifest hardcodes the namespace
in both the metadata namespace and the Nautobot service FQDN, which breaks
deployments when NAMESPACE is overridden. Update the manifest to use the same
namespace placeholder pattern as the other Job manifests, and ensure the
rendered YAML goes through envsubst so the Job is created in ${NAMESPACE} and
the --nautobot-url points to the matching in-cluster service for that namespace.

---

Nitpick comments:
In `@development/mock_devices/manifests/mock-devices.yaml`:
- Around line 15-575: The manifest is still hand-duplicating eight
near-identical Deployment/Service pairs, which makes future updates error-prone.
Refactor the mock-device manifest generation so the repeated blocks for
mock-sp-tor-01 through mock-sp-pleaf-01 come from a single template or generator
input (for example via fixture_generator.py or Kustomize), with only per-device
values like MOCK_DEVICE_NAME, MOCK_DEVICE_SERIAL, mock-device-role, and service
selectors varying. Keep shared fields like resources, securityContext, ports,
and container image defined once in the generator/template so all device blocks
stay single-sourced.

In `@development/mock_devices/manifests/mock-dhcp-discover.yaml`:
- Around line 17-25: The one-shot Job defined by mock-dhcp-discover (and
similarly mock-dhcp-validate) is missing ttlSecondsAfterFinished, so completed
or failed Job/Pod objects will linger. Add a TTL value consistent with
mock-wire-devices.yaml to the Job spec in these manifests so Kubernetes cleans
up finished resources automatically, and keep the existing backoffLimit behavior
unchanged.

In `@Makefile`:
- Around line 1068-1273: The five mock targets repeat the same Nautobot token
fetch, HTTP status handling, and JSON parsing logic, which is causing long
recipes and drift risk. Extract that shared lookup flow from mock-dhcp-validate,
mock-dhcp-discover, mock-ztp-validate, mock-workflow-backup, and
mock-workflow-cable-validate into a single reusable helper (for example a shell
script or a canned Makefile recipe), then have each target call it and keep only
the target-specific apply/post steps.
- Around line 1077-1084: The Nautobot/workflow curl calls in the Makefile can
hang indefinitely because they do not set any timeout options. Update each curl
invocation in this target family to include both a connection timeout and an
overall max time so failures return promptly; make sure the fix is applied
consistently to the interface lookup block and the other referenced curl call
sites in the same Makefile section.
🪄 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: aa915489-3e77-4a32-afb6-c1bdadcc88c9

📥 Commits

Reviewing files that changed from the base of the PR and between a0c511c and 41f214f.

📒 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 (46)
  • development/mock_devices/fixtures/eapi/4.29.5M/show_hostname.json
  • development/mock_devices/fixtures/devices/a09-u36-p01-spine-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/devices/a04-u44-p01-tor-01/platform.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_mac_address_table.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.11.0/bridge_domain_mac_table.json
  • development/mock_devices/fixtures/nvue/5.13.1/system.json
  • development/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/platform.json
  • development/mock_topology/context/superpod/devices/b09-u23-p01-ufm-02.json
  • development/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/nvue/5.11.0/system.json
  • development/mock_devices/fixtures/nvue/5.14.0/system.json
  • development/mock_devices/fixtures/nvue/5.13.1/interface.json
  • development/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/platform_inventory.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_lldp_neighbors_detail.json
  • development/mock_devices/mock_device/init.py
  • development/mock_devices/fixtures/nvue/5.14.0/platform.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_interfaces_status.json
  • development/mock_devices/fixtures/nvue/5.13.1/platform_inventory.json
  • development/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/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/platform_inventory.json
  • development/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/platform_inventory.json
  • deploy/helm/values.yaml
  • development/mock_devices/fixtures/nvue/5.14.0/bridge_domain_mac_table.json
  • development/mock_devices/fixtures/nvue/5.11.0/platform.json
  • development/mock_devices/fixtures/devices/a04-u44-p01-tor-01/platform_inventory.json
  • development/mock_devices/fixtures/nvue/5.13.1/platform.json
  • development/mock_devices/fixtures/nvue/5.14.0/interface.json
  • development/mock_devices/fixtures/nvue/5.14.0/platform_inventory.json
  • deploy/helm/values-local.yaml
  • development/mock_devices/fixtures/nvue/5.11.0/interface.json
  • development/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/platform.json
  • development/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/platform.json
  • development/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/interface.json
  • development/mock_devices/fixtures/eapi/4.29.5M/show_version.json
  • deploy/helm/values-local-medium.yaml
  • development/mock_devices/fixtures/devices/a09-u36-p01-spine-01/platform.json
  • development/mock_devices/mock_device/device_api/init.py
  • development/mock_devices/README.md
  • development/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/platform.json
  • development/mock_devices/fixtures/devices/a09-u36-p01-spine-01/interface.json
  • development/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/interface.json
  • development/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/interface.json
🚧 Files skipped from review as they are similar to previous changes (20)
  • development/mock_topology/context/superpod/devices/a09-u23-p01-ufm-01.json
  • development/mock_topology/jobs/designs/config_contexts.yaml.j2
  • development/mock_devices/manifests/dhcp-dev-service.yaml
  • development/mock_devices/fixtures/nvue/5.11.0/platform_inventory.json
  • deploy/helm/values-local-small.yaml
  • src/nv_config_manager/dhcp/kea_dhcp_confgen.py
  • deploy/helm/templates/dhcp.yaml
  • development/mock_topology/context/superpod/locations.yaml
  • development/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/interface.json
  • development/mock_devices/mock_device/device_api/fixtures.py
  • development/mock_devices/mock_device/device_api/server.py
  • development/mock_devices/Dockerfile
  • development/mock_devices/pyproject.toml
  • development/mock_devices/fixtures/devices/a04-u44-p01-tor-01/interface.json
  • deploy/configs/local-superpod-sandbox.yaml
  • development/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/interface.json
  • development/mock_devices/mock_device/wire_nautobot.py
  • development/mock_devices/mock_device/device_api/nvue.py
  • development/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/interface.json
  • development/mock_devices/mock_device/device_api/eapi.py

Comment thread Makefile
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