feat(sandbox): Add support for mock device creation + testing for local Kind cluster#35
feat(sandbox): Add support for mock device creation + testing for local Kind cluster#35jojung1 wants to merge 22 commits into
Conversation
📝 WalkthroughWalkthroughAdds a Kind-based sandbox: new local-superpod config, Makefile targets to build/load/deploy mock-device image and run Kubernetes Jobs, a mock-device Python package (CLI, FastAPI APIs, DHCP/ZTP clients, fixture generator, Nautobot wiring), container/pyproject, manifests and Jobs, a large fixture corpus, Helm DHCP socket wiring, and docs. ChangesMock Device Sandbox Testing System
Estimated code review effort 🎯 4 (Complex) | ⏱️ ~45 minutes Suggested reviewers
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
|
There was a problem hiding this comment.
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
⛔ Files ignored due to path filters (1)
uv.lockis excluded by!**/*.lock
📒 Files selected for processing (97)
Makefiledeploy/configs/local-dgxc-sandbox.yamldeploy/configs/local-superpod-sandbox.yamldeploy/helm/templates/dhcp.yamldeploy/helm/values-local-medium.yamldeploy/helm/values-local-small.yamldeploy/helm/values-local.yamldeploy/helm/values.yamldevelopment/mock_devices/Dockerfiledevelopment/mock_devices/README.mddevelopment/mock_devices/fixtures/devices/a04-u44-p01-tor-01/interface.jsondevelopment/mock_devices/fixtures/devices/a04-u44-p01-tor-01/platform.jsondevelopment/mock_devices/fixtures/devices/a04-u44-p01-tor-01/platform_inventory.jsondevelopment/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/interface.jsondevelopment/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/platform.jsondevelopment/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/platform_inventory.jsondevelopment/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/interface.jsondevelopment/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/platform.jsondevelopment/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/platform_inventory.jsondevelopment/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/interface.jsondevelopment/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/platform.jsondevelopment/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/platform_inventory.jsondevelopment/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/interface.jsondevelopment/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/platform.jsondevelopment/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/platform_inventory.jsondevelopment/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/interface.jsondevelopment/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/platform.jsondevelopment/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/platform_inventory.jsondevelopment/mock_devices/fixtures/devices/a09-u36-p01-spine-01/interface.jsondevelopment/mock_devices/fixtures/devices/a09-u36-p01-spine-01/platform.jsondevelopment/mock_devices/fixtures/devices/a09-u36-p01-spine-01/platform_inventory.jsondevelopment/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/interface.jsondevelopment/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/platform.jsondevelopment/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/platform_inventory.jsondevelopment/mock_devices/fixtures/devices/bbr1-cp1-tan1-dc01/show_lldp_neighbors_detail.jsondevelopment/mock_devices/fixtures/devices/bbr2-cp1-tan1-dc01/show_lldp_neighbors_detail.jsondevelopment/mock_devices/fixtures/devices/core1-cg1-cp1-tan1-dc01/interface.jsondevelopment/mock_devices/fixtures/devices/core1-cg1-cp1-tan1-dc01/platform.jsondevelopment/mock_devices/fixtures/devices/leaf1-cno1-cp1-tan1-dc01/interface.jsondevelopment/mock_devices/fixtures/devices/leaf1-cno1-cp1-tan1-dc01/platform.jsondevelopment/mock_devices/fixtures/devices/leaf1-cp1-smn1-dc01/bridge_domain_mac_table.jsondevelopment/mock_devices/fixtures/devices/leaf1-cp1-smn1-dc01/interface.jsondevelopment/mock_devices/fixtures/devices/leaf1-cp1-smn1-dc01/platform.jsondevelopment/mock_devices/fixtures/devices/leaf2-cp1-smn1-dc01/bridge_domain_mac_table.jsondevelopment/mock_devices/fixtures/devices/leaf2-cp1-smn1-dc01/interface.jsondevelopment/mock_devices/fixtures/devices/leaf2-cp1-smn1-dc01/platform.jsondevelopment/mock_devices/fixtures/devices/spine1-cp1-smn1-dc01/interface.jsondevelopment/mock_devices/fixtures/devices/spine1-cp1-smn1-dc01/platform.jsondevelopment/mock_devices/fixtures/devices/spine2-cp1-smn1-dc01/interface.jsondevelopment/mock_devices/fixtures/devices/spine2-cp1-smn1-dc01/platform.jsondevelopment/mock_devices/fixtures/eapi/4.29.5M/show_hostname.jsondevelopment/mock_devices/fixtures/eapi/4.29.5M/show_interfaces_status.jsondevelopment/mock_devices/fixtures/eapi/4.29.5M/show_lldp_neighbors_detail.jsondevelopment/mock_devices/fixtures/eapi/4.29.5M/show_mac_address_table.jsondevelopment/mock_devices/fixtures/eapi/4.29.5M/show_mpls_interface.jsondevelopment/mock_devices/fixtures/eapi/4.29.5M/show_version.jsondevelopment/mock_devices/fixtures/nvue/5.11.0/bridge_domain_mac_table.jsondevelopment/mock_devices/fixtures/nvue/5.11.0/interface.jsondevelopment/mock_devices/fixtures/nvue/5.11.0/platform.jsondevelopment/mock_devices/fixtures/nvue/5.11.0/platform_inventory.jsondevelopment/mock_devices/fixtures/nvue/5.11.0/system.jsondevelopment/mock_devices/fixtures/nvue/5.13.1/interface.jsondevelopment/mock_devices/fixtures/nvue/5.13.1/platform.jsondevelopment/mock_devices/fixtures/nvue/5.13.1/platform_inventory.jsondevelopment/mock_devices/fixtures/nvue/5.13.1/system.jsondevelopment/mock_devices/fixtures/nvue/5.14.0/bridge_domain_mac_table.jsondevelopment/mock_devices/fixtures/nvue/5.14.0/interface.jsondevelopment/mock_devices/fixtures/nvue/5.14.0/platform.jsondevelopment/mock_devices/fixtures/nvue/5.14.0/platform_inventory.jsondevelopment/mock_devices/fixtures/nvue/5.14.0/system.jsondevelopment/mock_devices/manifests/dhcp-dev-service.yamldevelopment/mock_devices/manifests/mock-devices.yamldevelopment/mock_devices/manifests/mock-dhcp-discover.yamldevelopment/mock_devices/manifests/mock-dhcp-validate.yamldevelopment/mock_devices/manifests/mock-wire-devices.yamldevelopment/mock_devices/manifests/mock-ztp-validate.yamldevelopment/mock_devices/mock_device/__init__.pydevelopment/mock_devices/mock_device/cli.pydevelopment/mock_devices/mock_device/config.pydevelopment/mock_devices/mock_device/device_api/__init__.pydevelopment/mock_devices/mock_device/device_api/eapi.pydevelopment/mock_devices/mock_device/device_api/fixtures.pydevelopment/mock_devices/mock_device/device_api/nvue.pydevelopment/mock_devices/mock_device/device_api/server.pydevelopment/mock_devices/mock_device/dhcp_client.pydevelopment/mock_devices/mock_device/fixture_generator.pydevelopment/mock_devices/mock_device/wire_nautobot.pydevelopment/mock_devices/mock_device/ztp_client.pydevelopment/mock_devices/pyproject.tomldevelopment/mock_devices/requirements.txtdevelopment/mock_topology/context/dgx_cloud/locations.yamldevelopment/mock_topology/context/superpod/devices/a09-u23-p01-ufm-01.jsondevelopment/mock_topology/context/superpod/devices/b09-u23-p01-ufm-02.jsondevelopment/mock_topology/context/superpod/locations.yamldevelopment/mock_topology/jobs/designs/config_contexts.yaml.j2pyproject.tomlsrc/nv_config_manager/dhcp/kea_dhcp_confgen.py
634b919 to
4f05f2b
Compare
There was a problem hiding this comment.
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
⛔ Files ignored due to path filters (1)
uv.lockis excluded by!**/*.lock
📒 Files selected for processing (97)
Makefiledeploy/configs/local-dgxc-sandbox.yamldeploy/configs/local-superpod-sandbox.yamldeploy/helm/templates/dhcp.yamldeploy/helm/values-local-medium.yamldeploy/helm/values-local-small.yamldeploy/helm/values-local.yamldeploy/helm/values.yamldevelopment/mock_devices/Dockerfiledevelopment/mock_devices/README.mddevelopment/mock_devices/fixtures/devices/a04-u44-p01-tor-01/interface.jsondevelopment/mock_devices/fixtures/devices/a04-u44-p01-tor-01/platform.jsondevelopment/mock_devices/fixtures/devices/a04-u44-p01-tor-01/platform_inventory.jsondevelopment/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/interface.jsondevelopment/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/platform.jsondevelopment/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/platform_inventory.jsondevelopment/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/interface.jsondevelopment/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/platform.jsondevelopment/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/platform_inventory.jsondevelopment/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/interface.jsondevelopment/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/platform.jsondevelopment/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/platform_inventory.jsondevelopment/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/interface.jsondevelopment/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/platform.jsondevelopment/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/platform_inventory.jsondevelopment/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/interface.jsondevelopment/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/platform.jsondevelopment/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/platform_inventory.jsondevelopment/mock_devices/fixtures/devices/a09-u36-p01-spine-01/interface.jsondevelopment/mock_devices/fixtures/devices/a09-u36-p01-spine-01/platform.jsondevelopment/mock_devices/fixtures/devices/a09-u36-p01-spine-01/platform_inventory.jsondevelopment/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/interface.jsondevelopment/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/platform.jsondevelopment/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/platform_inventory.jsondevelopment/mock_devices/fixtures/devices/bbr1-cp1-tan1-dc01/show_lldp_neighbors_detail.jsondevelopment/mock_devices/fixtures/devices/bbr2-cp1-tan1-dc01/show_lldp_neighbors_detail.jsondevelopment/mock_devices/fixtures/devices/core1-cg1-cp1-tan1-dc01/interface.jsondevelopment/mock_devices/fixtures/devices/core1-cg1-cp1-tan1-dc01/platform.jsondevelopment/mock_devices/fixtures/devices/leaf1-cno1-cp1-tan1-dc01/interface.jsondevelopment/mock_devices/fixtures/devices/leaf1-cno1-cp1-tan1-dc01/platform.jsondevelopment/mock_devices/fixtures/devices/leaf1-cp1-smn1-dc01/bridge_domain_mac_table.jsondevelopment/mock_devices/fixtures/devices/leaf1-cp1-smn1-dc01/interface.jsondevelopment/mock_devices/fixtures/devices/leaf1-cp1-smn1-dc01/platform.jsondevelopment/mock_devices/fixtures/devices/leaf2-cp1-smn1-dc01/bridge_domain_mac_table.jsondevelopment/mock_devices/fixtures/devices/leaf2-cp1-smn1-dc01/interface.jsondevelopment/mock_devices/fixtures/devices/leaf2-cp1-smn1-dc01/platform.jsondevelopment/mock_devices/fixtures/devices/spine1-cp1-smn1-dc01/interface.jsondevelopment/mock_devices/fixtures/devices/spine1-cp1-smn1-dc01/platform.jsondevelopment/mock_devices/fixtures/devices/spine2-cp1-smn1-dc01/interface.jsondevelopment/mock_devices/fixtures/devices/spine2-cp1-smn1-dc01/platform.jsondevelopment/mock_devices/fixtures/eapi/4.29.5M/show_hostname.jsondevelopment/mock_devices/fixtures/eapi/4.29.5M/show_interfaces_status.jsondevelopment/mock_devices/fixtures/eapi/4.29.5M/show_lldp_neighbors_detail.jsondevelopment/mock_devices/fixtures/eapi/4.29.5M/show_mac_address_table.jsondevelopment/mock_devices/fixtures/eapi/4.29.5M/show_mpls_interface.jsondevelopment/mock_devices/fixtures/eapi/4.29.5M/show_version.jsondevelopment/mock_devices/fixtures/nvue/5.11.0/bridge_domain_mac_table.jsondevelopment/mock_devices/fixtures/nvue/5.11.0/interface.jsondevelopment/mock_devices/fixtures/nvue/5.11.0/platform.jsondevelopment/mock_devices/fixtures/nvue/5.11.0/platform_inventory.jsondevelopment/mock_devices/fixtures/nvue/5.11.0/system.jsondevelopment/mock_devices/fixtures/nvue/5.13.1/interface.jsondevelopment/mock_devices/fixtures/nvue/5.13.1/platform.jsondevelopment/mock_devices/fixtures/nvue/5.13.1/platform_inventory.jsondevelopment/mock_devices/fixtures/nvue/5.13.1/system.jsondevelopment/mock_devices/fixtures/nvue/5.14.0/bridge_domain_mac_table.jsondevelopment/mock_devices/fixtures/nvue/5.14.0/interface.jsondevelopment/mock_devices/fixtures/nvue/5.14.0/platform.jsondevelopment/mock_devices/fixtures/nvue/5.14.0/platform_inventory.jsondevelopment/mock_devices/fixtures/nvue/5.14.0/system.jsondevelopment/mock_devices/manifests/dhcp-dev-service.yamldevelopment/mock_devices/manifests/mock-devices.yamldevelopment/mock_devices/manifests/mock-dhcp-discover.yamldevelopment/mock_devices/manifests/mock-dhcp-validate.yamldevelopment/mock_devices/manifests/mock-wire-devices.yamldevelopment/mock_devices/manifests/mock-ztp-validate.yamldevelopment/mock_devices/mock_device/__init__.pydevelopment/mock_devices/mock_device/cli.pydevelopment/mock_devices/mock_device/config.pydevelopment/mock_devices/mock_device/device_api/__init__.pydevelopment/mock_devices/mock_device/device_api/eapi.pydevelopment/mock_devices/mock_device/device_api/fixtures.pydevelopment/mock_devices/mock_device/device_api/nvue.pydevelopment/mock_devices/mock_device/device_api/server.pydevelopment/mock_devices/mock_device/dhcp_client.pydevelopment/mock_devices/mock_device/fixture_generator.pydevelopment/mock_devices/mock_device/wire_nautobot.pydevelopment/mock_devices/mock_device/ztp_client.pydevelopment/mock_devices/pyproject.tomldevelopment/mock_devices/requirements.txtdevelopment/mock_topology/context/dgx_cloud/locations.yamldevelopment/mock_topology/context/superpod/devices/a09-u23-p01-ufm-01.jsondevelopment/mock_topology/context/superpod/devices/b09-u23-p01-ufm-02.jsondevelopment/mock_topology/context/superpod/locations.yamldevelopment/mock_topology/jobs/designs/config_contexts.yaml.j2pyproject.tomlsrc/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
There was a problem hiding this comment.
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
📒 Files selected for processing (17)
Makefiledeploy/configs/local-dgxc-sandbox.yamldevelopment/mock_devices/Dockerfiledevelopment/mock_devices/README.mddevelopment/mock_devices/fixtures/nvue/5.13.1/platform_inventory.jsondevelopment/mock_devices/manifests/mock-devices.yamldevelopment/mock_devices/manifests/mock-dhcp-discover.yamldevelopment/mock_devices/manifests/mock-dhcp-validate.yamldevelopment/mock_devices/manifests/mock-wire-devices.yamldevelopment/mock_devices/manifests/mock-ztp-validate.yamldevelopment/mock_devices/mock_device/cli.pydevelopment/mock_devices/mock_device/device_api/eapi.pydevelopment/mock_devices/mock_device/device_api/fixtures.pydevelopment/mock_devices/mock_device/dhcp_client.pydevelopment/mock_devices/mock_device/fixture_generator.pydevelopment/mock_devices/mock_device/wire_nautobot.pydevelopment/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
|
/ok to test 92bdb21 |
|
/ok to test c42861f |
e6a83ae to
95b232b
Compare
There was a problem hiding this comment.
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
📒 Files selected for processing (2)
Makefiledocs/getting-started/local-development-quick-start.mdx
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
development/mock_devices/fixtures/devices/spine2-cp1-smn1-dc01/interface.json (1)
9-10: 💤 Low valueConfirm empty eth0 IP address is intentional.
The
eth0interface has an emptyaddressobject, 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 forspine2-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
📒 Files selected for processing (94)
Makefiledeploy/configs/local-superpod-sandbox.yamldeploy/helm/templates/dhcp.yamldeploy/helm/values-local-medium.yamldeploy/helm/values-local-small.yamldeploy/helm/values-local.yamldeploy/helm/values.yamldevelopment/mock_devices/Dockerfiledevelopment/mock_devices/README.mddevelopment/mock_devices/fixtures/devices/a04-u44-p01-tor-01/interface.jsondevelopment/mock_devices/fixtures/devices/a04-u44-p01-tor-01/platform.jsondevelopment/mock_devices/fixtures/devices/a04-u44-p01-tor-01/platform_inventory.jsondevelopment/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/interface.jsondevelopment/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/platform.jsondevelopment/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/platform_inventory.jsondevelopment/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/interface.jsondevelopment/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/platform.jsondevelopment/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/platform_inventory.jsondevelopment/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/interface.jsondevelopment/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/platform.jsondevelopment/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/platform_inventory.jsondevelopment/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/interface.jsondevelopment/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/platform.jsondevelopment/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/platform_inventory.jsondevelopment/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/interface.jsondevelopment/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/platform.jsondevelopment/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/platform_inventory.jsondevelopment/mock_devices/fixtures/devices/a09-u36-p01-spine-01/interface.jsondevelopment/mock_devices/fixtures/devices/a09-u36-p01-spine-01/platform.jsondevelopment/mock_devices/fixtures/devices/a09-u36-p01-spine-01/platform_inventory.jsondevelopment/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/interface.jsondevelopment/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/platform.jsondevelopment/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/platform_inventory.jsondevelopment/mock_devices/fixtures/devices/bbr1-cp1-tan1-dc01/show_lldp_neighbors_detail.jsondevelopment/mock_devices/fixtures/devices/bbr2-cp1-tan1-dc01/show_lldp_neighbors_detail.jsondevelopment/mock_devices/fixtures/devices/core1-cg1-cp1-tan1-dc01/interface.jsondevelopment/mock_devices/fixtures/devices/core1-cg1-cp1-tan1-dc01/platform.jsondevelopment/mock_devices/fixtures/devices/leaf1-cno1-cp1-tan1-dc01/interface.jsondevelopment/mock_devices/fixtures/devices/leaf1-cno1-cp1-tan1-dc01/platform.jsondevelopment/mock_devices/fixtures/devices/leaf1-cp1-smn1-dc01/bridge_domain_mac_table.jsondevelopment/mock_devices/fixtures/devices/leaf1-cp1-smn1-dc01/interface.jsondevelopment/mock_devices/fixtures/devices/leaf1-cp1-smn1-dc01/platform.jsondevelopment/mock_devices/fixtures/devices/leaf2-cp1-smn1-dc01/bridge_domain_mac_table.jsondevelopment/mock_devices/fixtures/devices/leaf2-cp1-smn1-dc01/interface.jsondevelopment/mock_devices/fixtures/devices/leaf2-cp1-smn1-dc01/platform.jsondevelopment/mock_devices/fixtures/devices/spine1-cp1-smn1-dc01/interface.jsondevelopment/mock_devices/fixtures/devices/spine1-cp1-smn1-dc01/platform.jsondevelopment/mock_devices/fixtures/devices/spine2-cp1-smn1-dc01/interface.jsondevelopment/mock_devices/fixtures/devices/spine2-cp1-smn1-dc01/platform.jsondevelopment/mock_devices/fixtures/eapi/4.29.5M/show_hostname.jsondevelopment/mock_devices/fixtures/eapi/4.29.5M/show_interfaces_status.jsondevelopment/mock_devices/fixtures/eapi/4.29.5M/show_lldp_neighbors_detail.jsondevelopment/mock_devices/fixtures/eapi/4.29.5M/show_mac_address_table.jsondevelopment/mock_devices/fixtures/eapi/4.29.5M/show_mpls_interface.jsondevelopment/mock_devices/fixtures/eapi/4.29.5M/show_version.jsondevelopment/mock_devices/fixtures/nvue/5.11.0/bridge_domain_mac_table.jsondevelopment/mock_devices/fixtures/nvue/5.11.0/interface.jsondevelopment/mock_devices/fixtures/nvue/5.11.0/platform.jsondevelopment/mock_devices/fixtures/nvue/5.11.0/platform_inventory.jsondevelopment/mock_devices/fixtures/nvue/5.11.0/system.jsondevelopment/mock_devices/fixtures/nvue/5.13.1/interface.jsondevelopment/mock_devices/fixtures/nvue/5.13.1/platform.jsondevelopment/mock_devices/fixtures/nvue/5.13.1/platform_inventory.jsondevelopment/mock_devices/fixtures/nvue/5.13.1/system.jsondevelopment/mock_devices/fixtures/nvue/5.14.0/bridge_domain_mac_table.jsondevelopment/mock_devices/fixtures/nvue/5.14.0/interface.jsondevelopment/mock_devices/fixtures/nvue/5.14.0/platform.jsondevelopment/mock_devices/fixtures/nvue/5.14.0/platform_inventory.jsondevelopment/mock_devices/fixtures/nvue/5.14.0/system.jsondevelopment/mock_devices/manifests/dhcp-dev-service.yamldevelopment/mock_devices/manifests/mock-devices.yamldevelopment/mock_devices/manifests/mock-dhcp-discover.yamldevelopment/mock_devices/manifests/mock-dhcp-validate.yamldevelopment/mock_devices/manifests/mock-wire-devices.yamldevelopment/mock_devices/manifests/mock-ztp-validate.yamldevelopment/mock_devices/mock_device/__init__.pydevelopment/mock_devices/mock_device/cli.pydevelopment/mock_devices/mock_device/config.pydevelopment/mock_devices/mock_device/device_api/__init__.pydevelopment/mock_devices/mock_device/device_api/eapi.pydevelopment/mock_devices/mock_device/device_api/fixtures.pydevelopment/mock_devices/mock_device/device_api/nvue.pydevelopment/mock_devices/mock_device/device_api/server.pydevelopment/mock_devices/mock_device/dhcp_client.pydevelopment/mock_devices/mock_device/fixture_generator.pydevelopment/mock_devices/mock_device/wire_nautobot.pydevelopment/mock_devices/mock_device/ztp_client.pydevelopment/mock_devices/pyproject.tomldevelopment/mock_topology/context/superpod/devices/a09-u23-p01-ufm-01.jsondevelopment/mock_topology/context/superpod/devices/b09-u23-p01-ufm-02.jsondevelopment/mock_topology/context/superpod/locations.yamldevelopment/mock_topology/jobs/designs/config_contexts.yaml.j2docs/getting-started/local-development-quick-start.mdxsrc/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
There was a problem hiding this comment.
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 | 🟠 MajorFail workflow targets on curl transport errors
mock-workflow-backupandmock-workflow-cable-validateonly fail when the parsedRESP_CODEis>= 400; DNS/TLS/connectivity failures letcurlexit non-zero while%{http_code}typically becomes000, 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 | 🔴 CriticalFail fast on Nautobot lookup/auth/parse errors instead of treating them as “MAC missing”.
Inmock-dhcp-validate/mock-dhcp-discover/mock-ztp-validate,MOCK_*_MACis derived fromcurl ... | python3 ... 2>/dev/null, and then emptyMOCK_*_MACtriggers 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
📒 Files selected for processing (1)
Makefile
|
/ok to test c18f79c |
c18f79c to
690d612
Compare
There was a problem hiding this comment.
♻️ Duplicate comments (1)
Makefile (1)
997-1004:⚠️ Potential issue | 🟡 Minor | ⚡ Quick win
mock-devices-downstill misses ZTP validation job cleanup.
mock-ztp-validatecreates 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
📒 Files selected for processing (94)
Makefiledeploy/configs/local-superpod-sandbox.yamldeploy/helm/templates/dhcp.yamldeploy/helm/values-local-medium.yamldeploy/helm/values-local-small.yamldeploy/helm/values-local.yamldeploy/helm/values.yamldevelopment/mock_devices/Dockerfiledevelopment/mock_devices/README.mddevelopment/mock_devices/fixtures/devices/a04-u44-p01-tor-01/interface.jsondevelopment/mock_devices/fixtures/devices/a04-u44-p01-tor-01/platform.jsondevelopment/mock_devices/fixtures/devices/a04-u44-p01-tor-01/platform_inventory.jsondevelopment/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/interface.jsondevelopment/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/platform.jsondevelopment/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/platform_inventory.jsondevelopment/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/interface.jsondevelopment/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/platform.jsondevelopment/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/platform_inventory.jsondevelopment/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/interface.jsondevelopment/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/platform.jsondevelopment/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/platform_inventory.jsondevelopment/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/interface.jsondevelopment/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/platform.jsondevelopment/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/platform_inventory.jsondevelopment/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/interface.jsondevelopment/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/platform.jsondevelopment/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/platform_inventory.jsondevelopment/mock_devices/fixtures/devices/a09-u36-p01-spine-01/interface.jsondevelopment/mock_devices/fixtures/devices/a09-u36-p01-spine-01/platform.jsondevelopment/mock_devices/fixtures/devices/a09-u36-p01-spine-01/platform_inventory.jsondevelopment/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/interface.jsondevelopment/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/platform.jsondevelopment/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/platform_inventory.jsondevelopment/mock_devices/fixtures/devices/bbr1-cp1-tan1-dc01/show_lldp_neighbors_detail.jsondevelopment/mock_devices/fixtures/devices/bbr2-cp1-tan1-dc01/show_lldp_neighbors_detail.jsondevelopment/mock_devices/fixtures/devices/core1-cg1-cp1-tan1-dc01/interface.jsondevelopment/mock_devices/fixtures/devices/core1-cg1-cp1-tan1-dc01/platform.jsondevelopment/mock_devices/fixtures/devices/leaf1-cno1-cp1-tan1-dc01/interface.jsondevelopment/mock_devices/fixtures/devices/leaf1-cno1-cp1-tan1-dc01/platform.jsondevelopment/mock_devices/fixtures/devices/leaf1-cp1-smn1-dc01/bridge_domain_mac_table.jsondevelopment/mock_devices/fixtures/devices/leaf1-cp1-smn1-dc01/interface.jsondevelopment/mock_devices/fixtures/devices/leaf1-cp1-smn1-dc01/platform.jsondevelopment/mock_devices/fixtures/devices/leaf2-cp1-smn1-dc01/bridge_domain_mac_table.jsondevelopment/mock_devices/fixtures/devices/leaf2-cp1-smn1-dc01/interface.jsondevelopment/mock_devices/fixtures/devices/leaf2-cp1-smn1-dc01/platform.jsondevelopment/mock_devices/fixtures/devices/spine1-cp1-smn1-dc01/interface.jsondevelopment/mock_devices/fixtures/devices/spine1-cp1-smn1-dc01/platform.jsondevelopment/mock_devices/fixtures/devices/spine2-cp1-smn1-dc01/interface.jsondevelopment/mock_devices/fixtures/devices/spine2-cp1-smn1-dc01/platform.jsondevelopment/mock_devices/fixtures/eapi/4.29.5M/show_hostname.jsondevelopment/mock_devices/fixtures/eapi/4.29.5M/show_interfaces_status.jsondevelopment/mock_devices/fixtures/eapi/4.29.5M/show_lldp_neighbors_detail.jsondevelopment/mock_devices/fixtures/eapi/4.29.5M/show_mac_address_table.jsondevelopment/mock_devices/fixtures/eapi/4.29.5M/show_mpls_interface.jsondevelopment/mock_devices/fixtures/eapi/4.29.5M/show_version.jsondevelopment/mock_devices/fixtures/nvue/5.11.0/bridge_domain_mac_table.jsondevelopment/mock_devices/fixtures/nvue/5.11.0/interface.jsondevelopment/mock_devices/fixtures/nvue/5.11.0/platform.jsondevelopment/mock_devices/fixtures/nvue/5.11.0/platform_inventory.jsondevelopment/mock_devices/fixtures/nvue/5.11.0/system.jsondevelopment/mock_devices/fixtures/nvue/5.13.1/interface.jsondevelopment/mock_devices/fixtures/nvue/5.13.1/platform.jsondevelopment/mock_devices/fixtures/nvue/5.13.1/platform_inventory.jsondevelopment/mock_devices/fixtures/nvue/5.13.1/system.jsondevelopment/mock_devices/fixtures/nvue/5.14.0/bridge_domain_mac_table.jsondevelopment/mock_devices/fixtures/nvue/5.14.0/interface.jsondevelopment/mock_devices/fixtures/nvue/5.14.0/platform.jsondevelopment/mock_devices/fixtures/nvue/5.14.0/platform_inventory.jsondevelopment/mock_devices/fixtures/nvue/5.14.0/system.jsondevelopment/mock_devices/manifests/dhcp-dev-service.yamldevelopment/mock_devices/manifests/mock-devices.yamldevelopment/mock_devices/manifests/mock-dhcp-discover.yamldevelopment/mock_devices/manifests/mock-dhcp-validate.yamldevelopment/mock_devices/manifests/mock-wire-devices.yamldevelopment/mock_devices/manifests/mock-ztp-validate.yamldevelopment/mock_devices/mock_device/__init__.pydevelopment/mock_devices/mock_device/cli.pydevelopment/mock_devices/mock_device/config.pydevelopment/mock_devices/mock_device/device_api/__init__.pydevelopment/mock_devices/mock_device/device_api/eapi.pydevelopment/mock_devices/mock_device/device_api/fixtures.pydevelopment/mock_devices/mock_device/device_api/nvue.pydevelopment/mock_devices/mock_device/device_api/server.pydevelopment/mock_devices/mock_device/dhcp_client.pydevelopment/mock_devices/mock_device/fixture_generator.pydevelopment/mock_devices/mock_device/wire_nautobot.pydevelopment/mock_devices/mock_device/ztp_client.pydevelopment/mock_devices/pyproject.tomldevelopment/mock_topology/context/superpod/devices/a09-u23-p01-ufm-01.jsondevelopment/mock_topology/context/superpod/devices/b09-u23-p01-ufm-02.jsondevelopment/mock_topology/context/superpod/locations.yamldevelopment/mock_topology/jobs/designs/config_contexts.yaml.j2docs/getting-started/local-development-quick-start.mdxsrc/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
81e3ff0 to
5462168
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@development/mock_devices/fixtures/devices/leaf1-cp1-smn1-dc01/interface.json`:
- Around line 2-3: Update the interface entries for Vlan1001 and Vlan1002 to use
the correct VLAN SVI type: change their "type" field from "swp" to "svi" so
these L3 VLAN interfaces are classified correctly (look for the "Vlan1001" and
"Vlan1002" JSON objects and modify the "type" property accordingly).
In `@development/mock_devices/manifests/mock-dhcp-discover.yaml`:
- Around line 50-56: The container hardening drops all capabilities so the DHCP
client in development/mock_devices/mock_device/dhcp_client.py cannot bind UDP
port 67; update the Pod spec's securityContext:capabilities to add
CAP_NET_BIND_SERVICE (i.e. add: - NET_BIND_SERVICE) alongside the existing drop:
- ALL so the process (while still non-root and readOnlyRootFilesystem) can bind
privileged port 67; ensure the changes are made under the securityContext →
capabilities block.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 3ff66ab9-e2e3-435a-8359-3cb485fe0be3
📒 Files selected for processing (94)
Makefiledeploy/configs/local-superpod-sandbox.yamldeploy/helm/templates/dhcp.yamldeploy/helm/values-local-medium.yamldeploy/helm/values-local-small.yamldeploy/helm/values-local.yamldeploy/helm/values.yamldevelopment/mock_devices/Dockerfiledevelopment/mock_devices/README.mddevelopment/mock_devices/fixtures/devices/a04-u44-p01-tor-01/interface.jsondevelopment/mock_devices/fixtures/devices/a04-u44-p01-tor-01/platform.jsondevelopment/mock_devices/fixtures/devices/a04-u44-p01-tor-01/platform_inventory.jsondevelopment/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/interface.jsondevelopment/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/platform.jsondevelopment/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/platform_inventory.jsondevelopment/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/interface.jsondevelopment/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/platform.jsondevelopment/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/platform_inventory.jsondevelopment/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/interface.jsondevelopment/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/platform.jsondevelopment/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/platform_inventory.jsondevelopment/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/interface.jsondevelopment/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/platform.jsondevelopment/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/platform_inventory.jsondevelopment/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/interface.jsondevelopment/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/platform.jsondevelopment/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/platform_inventory.jsondevelopment/mock_devices/fixtures/devices/a09-u36-p01-spine-01/interface.jsondevelopment/mock_devices/fixtures/devices/a09-u36-p01-spine-01/platform.jsondevelopment/mock_devices/fixtures/devices/a09-u36-p01-spine-01/platform_inventory.jsondevelopment/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/interface.jsondevelopment/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/platform.jsondevelopment/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/platform_inventory.jsondevelopment/mock_devices/fixtures/devices/bbr1-cp1-tan1-dc01/show_lldp_neighbors_detail.jsondevelopment/mock_devices/fixtures/devices/bbr2-cp1-tan1-dc01/show_lldp_neighbors_detail.jsondevelopment/mock_devices/fixtures/devices/core1-cg1-cp1-tan1-dc01/interface.jsondevelopment/mock_devices/fixtures/devices/core1-cg1-cp1-tan1-dc01/platform.jsondevelopment/mock_devices/fixtures/devices/leaf1-cno1-cp1-tan1-dc01/interface.jsondevelopment/mock_devices/fixtures/devices/leaf1-cno1-cp1-tan1-dc01/platform.jsondevelopment/mock_devices/fixtures/devices/leaf1-cp1-smn1-dc01/bridge_domain_mac_table.jsondevelopment/mock_devices/fixtures/devices/leaf1-cp1-smn1-dc01/interface.jsondevelopment/mock_devices/fixtures/devices/leaf1-cp1-smn1-dc01/platform.jsondevelopment/mock_devices/fixtures/devices/leaf2-cp1-smn1-dc01/bridge_domain_mac_table.jsondevelopment/mock_devices/fixtures/devices/leaf2-cp1-smn1-dc01/interface.jsondevelopment/mock_devices/fixtures/devices/leaf2-cp1-smn1-dc01/platform.jsondevelopment/mock_devices/fixtures/devices/spine1-cp1-smn1-dc01/interface.jsondevelopment/mock_devices/fixtures/devices/spine1-cp1-smn1-dc01/platform.jsondevelopment/mock_devices/fixtures/devices/spine2-cp1-smn1-dc01/interface.jsondevelopment/mock_devices/fixtures/devices/spine2-cp1-smn1-dc01/platform.jsondevelopment/mock_devices/fixtures/eapi/4.29.5M/show_hostname.jsondevelopment/mock_devices/fixtures/eapi/4.29.5M/show_interfaces_status.jsondevelopment/mock_devices/fixtures/eapi/4.29.5M/show_lldp_neighbors_detail.jsondevelopment/mock_devices/fixtures/eapi/4.29.5M/show_mac_address_table.jsondevelopment/mock_devices/fixtures/eapi/4.29.5M/show_mpls_interface.jsondevelopment/mock_devices/fixtures/eapi/4.29.5M/show_version.jsondevelopment/mock_devices/fixtures/nvue/5.11.0/bridge_domain_mac_table.jsondevelopment/mock_devices/fixtures/nvue/5.11.0/interface.jsondevelopment/mock_devices/fixtures/nvue/5.11.0/platform.jsondevelopment/mock_devices/fixtures/nvue/5.11.0/platform_inventory.jsondevelopment/mock_devices/fixtures/nvue/5.11.0/system.jsondevelopment/mock_devices/fixtures/nvue/5.13.1/interface.jsondevelopment/mock_devices/fixtures/nvue/5.13.1/platform.jsondevelopment/mock_devices/fixtures/nvue/5.13.1/platform_inventory.jsondevelopment/mock_devices/fixtures/nvue/5.13.1/system.jsondevelopment/mock_devices/fixtures/nvue/5.14.0/bridge_domain_mac_table.jsondevelopment/mock_devices/fixtures/nvue/5.14.0/interface.jsondevelopment/mock_devices/fixtures/nvue/5.14.0/platform.jsondevelopment/mock_devices/fixtures/nvue/5.14.0/platform_inventory.jsondevelopment/mock_devices/fixtures/nvue/5.14.0/system.jsondevelopment/mock_devices/manifests/dhcp-dev-service.yamldevelopment/mock_devices/manifests/mock-devices.yamldevelopment/mock_devices/manifests/mock-dhcp-discover.yamldevelopment/mock_devices/manifests/mock-dhcp-validate.yamldevelopment/mock_devices/manifests/mock-wire-devices.yamldevelopment/mock_devices/manifests/mock-ztp-validate.yamldevelopment/mock_devices/mock_device/__init__.pydevelopment/mock_devices/mock_device/cli.pydevelopment/mock_devices/mock_device/config.pydevelopment/mock_devices/mock_device/device_api/__init__.pydevelopment/mock_devices/mock_device/device_api/eapi.pydevelopment/mock_devices/mock_device/device_api/fixtures.pydevelopment/mock_devices/mock_device/device_api/nvue.pydevelopment/mock_devices/mock_device/device_api/server.pydevelopment/mock_devices/mock_device/dhcp_client.pydevelopment/mock_devices/mock_device/fixture_generator.pydevelopment/mock_devices/mock_device/wire_nautobot.pydevelopment/mock_devices/mock_device/ztp_client.pydevelopment/mock_devices/pyproject.tomldevelopment/mock_topology/context/superpod/devices/a09-u23-p01-ufm-01.jsondevelopment/mock_topology/context/superpod/devices/b09-u23-p01-ufm-02.jsondevelopment/mock_topology/context/superpod/locations.yamldevelopment/mock_topology/jobs/designs/config_contexts.yaml.j2docs/getting-started/local-development-quick-start.mdxsrc/nv_config_manager/dhcp/kea_dhcp_confgen.py
💤 Files with no reviewable changes (8)
- development/mock_devices/mock_device/init.py
- development/mock_devices/mock_device/device_api/init.py
- development/mock_devices/manifests/mock-ztp-validate.yaml
- development/mock_devices/manifests/mock-wire-devices.yaml
- development/mock_devices/manifests/mock-dhcp-validate.yaml
- development/mock_devices/mock_device/config.py
- development/mock_devices/mock_device/cli.py
- development/mock_devices/mock_device/device_api/eapi.py
✅ Files skipped from review due to trivial changes (50)
- development/mock_devices/fixtures/nvue/5.13.1/platform.json
- development/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/platform_inventory.json
- development/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/platform_inventory.json
- development/mock_devices/fixtures/nvue/5.14.0/platform_inventory.json
- development/mock_devices/fixtures/nvue/5.11.0/system.json
- development/mock_devices/fixtures/nvue/5.14.0/platform.json
- development/mock_devices/fixtures/nvue/5.13.1/system.json
- development/mock_devices/fixtures/nvue/5.14.0/bridge_domain_mac_table.json
- development/mock_devices/fixtures/eapi/4.29.5M/show_version.json
- development/mock_devices/fixtures/nvue/5.11.0/bridge_domain_mac_table.json
- development/mock_devices/fixtures/devices/spine1-cp1-smn1-dc01/platform.json
- development/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/platform_inventory.json
- development/mock_devices/fixtures/devices/a09-u36-p01-spine-01/platform.json
- development/mock_devices/fixtures/devices/spine2-cp1-smn1-dc01/platform.json
- development/mock_devices/fixtures/devices/a04-u44-p01-tor-01/platform_inventory.json
- development/mock_devices/fixtures/eapi/4.29.5M/show_hostname.json
- development/mock_devices/fixtures/devices/core1-cg1-cp1-tan1-dc01/platform.json
- development/mock_devices/fixtures/devices/a09-u36-p01-spine-01/platform_inventory.json
- development/mock_devices/fixtures/devices/leaf2-cp1-smn1-dc01/platform.json
- development/mock_devices/fixtures/nvue/5.13.1/platform_inventory.json
- development/mock_devices/fixtures/nvue/5.14.0/interface.json
- development/mock_devices/fixtures/eapi/4.29.5M/show_interfaces_status.json
- development/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/platform_inventory.json
- development/mock_devices/fixtures/devices/leaf1-cp1-smn1-dc01/platform.json
- development/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/platform_inventory.json
- development/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/platform.json
- development/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/platform.json
- development/mock_devices/fixtures/nvue/5.11.0/platform.json
- development/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/platform.json
- development/mock_devices/fixtures/devices/a04-u44-p01-tor-01/platform.json
- development/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/platform.json
- development/mock_devices/fixtures/devices/bbr1-cp1-tan1-dc01/show_lldp_neighbors_detail.json
- development/mock_devices/fixtures/devices/leaf2-cp1-smn1-dc01/interface.json
- development/mock_devices/fixtures/devices/core1-cg1-cp1-tan1-dc01/interface.json
- development/mock_devices/fixtures/devices/spine2-cp1-smn1-dc01/interface.json
- development/mock_devices/fixtures/devices/leaf1-cno1-cp1-tan1-dc01/interface.json
- development/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/interface.json
- development/mock_devices/fixtures/eapi/4.29.5M/show_lldp_neighbors_detail.json
- development/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/interface.json
- development/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/platform.json
- development/mock_devices/fixtures/eapi/4.29.5M/show_mpls_interface.json
- development/mock_devices/fixtures/devices/bbr2-cp1-tan1-dc01/show_lldp_neighbors_detail.json
- development/mock_devices/fixtures/nvue/5.13.1/interface.json
- development/mock_devices/fixtures/devices/spine1-cp1-smn1-dc01/interface.json
- development/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/interface.json
- development/mock_devices/README.md
- development/mock_devices/fixtures/nvue/5.14.0/system.json
- development/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/interface.json
- development/mock_devices/fixtures/devices/a04-u44-p01-tor-01/interface.json
- development/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/interface.json
🚧 Files skipped from review as they are similar to previous changes (16)
- deploy/helm/templates/dhcp.yaml
- development/mock_devices/fixtures/nvue/5.11.0/platform_inventory.json
- development/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/platform_inventory.json
- development/mock_devices/fixtures/devices/leaf1-cp1-smn1-dc01/bridge_domain_mac_table.json
- development/mock_devices/fixtures/devices/leaf1-cno1-cp1-tan1-dc01/platform.json
- deploy/helm/values-local.yaml
- development/mock_devices/fixtures/eapi/4.29.5M/show_mac_address_table.json
- deploy/helm/values-local-medium.yaml
- development/mock_devices/fixtures/nvue/5.11.0/interface.json
- development/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/platform.json
- development/mock_devices/manifests/dhcp-dev-service.yaml
- development/mock_devices/fixtures/devices/leaf2-cp1-smn1-dc01/bridge_domain_mac_table.json
- deploy/helm/values-local-small.yaml
- deploy/configs/local-superpod-sandbox.yaml
- development/mock_devices/Dockerfile
- development/mock_devices/fixtures/devices/a09-u36-p01-spine-01/interface.json
13b9f7e to
838208d
Compare
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
development/mock_devices/manifests/mock-dhcp-discover.yaml (1)
50-58:⚠️ Potential issue | 🟡 Minormock-device:local already runs as non-root (USER 65532), so
runAsUseris only needed if the scanner requires it
mock-dhcp-discover.yamlsets a hardened containersecurityContextwithrunAsNonRoot: true, and themock-device:localDockerfile definesUSER 65532:65532, so an explicitrunAsUserisn’t necessary for runtime non-root enforcement. If KSV-0118 is still reported by the scanner, addrunAsUser: 65532(and optionallyrunAsGroup: 65532) in the container (or pod)securityContextto satisfy the rule.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@development/mock_devices/manifests/mock-dhcp-discover.yaml` around lines 50 - 58, The manifest's container securityContext currently has runAsNonRoot: true but no explicit UID; since the image mock-device:local sets USER 65532 you can either leave it as-is or, to satisfy scanners reporting KSV-0118, add runAsUser: 65532 (and optionally runAsGroup: 65532) under the same securityContext for the container (or pod) so the runtime UID is explicit; update the securityContext block (which contains runAsNonRoot, allowPrivilegeEscalation, readOnlyRootFilesystem, capabilities) to include runAsUser: 65532 (and runAsGroup: 65532 if desired).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@development/mock_devices/manifests/mock-dhcp-discover.yaml`:
- Around line 50-58: The manifest's container securityContext currently has
runAsNonRoot: true but no explicit UID; since the image mock-device:local sets
USER 65532 you can either leave it as-is or, to satisfy scanners reporting
KSV-0118, add runAsUser: 65532 (and optionally runAsGroup: 65532) under the same
securityContext for the container (or pod) so the runtime UID is explicit;
update the securityContext block (which contains runAsNonRoot,
allowPrivilegeEscalation, readOnlyRootFilesystem, capabilities) to include
runAsUser: 65532 (and runAsGroup: 65532 if desired).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: d1f8dce3-d3de-4172-a075-58dfdddbeb03
📒 Files selected for processing (1)
development/mock_devices/manifests/mock-dhcp-discover.yaml
There was a problem hiding this comment.
Actionable comments posted: 7
🧹 Nitpick comments (1)
development/mock_topology/context/superpod/locations.yaml (1)
78-94: 💤 Low valuePool range format consistency.
The pool range
"10.244.0.200 - 10.244.0.250"uses spaces around the dash, while auto-generated pools inkea_dhcp_confgen.py:639use the formatf"{first_ip}-{last_ip}"(no spaces). Both formats are likely accepted by Kea, but for consistency with the codebase's auto-generation pattern, consider using no spaces.♻️ Suggested format for consistency
pools: - - pool: "10.244.0.200 - 10.244.0.250" + - pool: "10.244.0.200-10.244.0.250"🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@development/mock_topology/context/superpod/locations.yaml` around lines 78 - 94, The pool range in the YAML uses spaces around the dash ("10.244.0.200 - 10.244.0.250") which is inconsistent with the auto-generated format used in kea_dhcp_confgen.py (f"{first_ip}-{last_ip}"); update the pool value under the subnet entry (the pools list in this file) to remove the spaces so it matches the auto-generated pattern (e.g., "10.244.0.200-10.244.0.250") to keep formatting consistent with kea_dhcp_confgen.py.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@development/mock_devices/manifests/mock-dhcp-discover.yaml`:
- Line 40: Replace hardcoded "nv-config-manager" service namespace in endpoint
FQDNs with the templated ${NAMESPACE} variable: update the flag value
--dhcp-server=nv-config-manager-dhcp-dev.nv-config-manager.svc.cluster.local to
--dhcp-server=nv-config-manager-dhcp-dev.${NAMESPACE}.svc.cluster.local and make
the same substitution for the other hardcoded nv-config-manager FQDNs referenced
in the mock-dhcp-validate and mock-ztp-validate manifests (i.e., replace any
occurrence of ".nv-config-manager.svc.cluster.local" with
".${NAMESPACE}.svc.cluster.local" in the relevant command/arg strings).
In `@development/mock_devices/mock_device/device_api/fixtures.py`:
- Around line 98-102: The loop that returns self._read(path) for each candidate
currently lets a malformed JSON in FixtureLoader._read raise and abort the
request; wrap the call to self._read(path) in a try/except that catches JSON
parsing errors (e.g., json.JSONDecodeError or ValueError), log a warning with
the path and error, and continue to the next candidate so the loader falls back
to other fixtures or the hardcoded response when no valid JSON is found.
In `@development/mock_devices/mock_device/dhcp_client.py`:
- Around line 74-75: The DHCP client currently sets xid deterministically from
device.mac_bytes (xid = int.from_bytes(device.mac_bytes[:4], "big")), causing
reused transaction IDs; change xid to be generated fresh for each DHCP exchange
using a cryptographically-safe or sufficiently-random 32-bit value (e.g.,
secrets.randbits(32) or random.getrandbits(32)) at the point where xid is
assigned in dhcp_client.py so every send/transaction uses a new ID (ensure the
new xid is used for matching responses in the same helper functions that
reference xid).
- Around line 335-336: The call to response.json() (assigned to config) can
raise on non-JSON/error payloads and currently lets the exception escape; wrap
the JSON parse in a try/except around the line "config = response.json()" (and
any surrounding code in the same function, e.g., the DHCP API request handler)
and on exception return a structured DhcpResult failure with an appropriate
error message and status (instead of raising); ensure you catch
ValueError/JSONDecodeError and include the response.status_code/text in the
DhcpResult for debugging.
In `@development/mock_devices/mock_device/wire_nautobot.py`:
- Around line 334-352: The loop over device_map bypasses exceptions from
wire_device so a single failure aborts the batch; wrap the call to
wire_device(device_name, service_ip, namespace_id, status_id, client) in a
try/except, catch exceptions (Exception), create and append a failing WireResult
for that device with the exception string, log the error (logger.error including
device_name and exception), and continue the loop so subsequent devices are
processed; keep existing success/failure handling for normal return values from
wire_device.
In `@development/mock_devices/mock_device/ztp_client.py`:
- Around line 263-268: The ZtpStepResult currently includes a plaintext preview
of the boot/config payload (details["preview"]) which can leak sensitive data;
remove the preview field in both locations that construct ZtpStepResult (the one
using step="fetch-boot-script" and the similar return at lines ~351-356) and
keep only non-sensitive metadata such as details["size_bytes"] (or replace
preview with a redacted indicator like "preview": "<redacted>" if a flag is
required), updating any consumers that expect the preview accordingly.
In `@Makefile`:
- Around line 1170-1176: Validate the Nautobot token (NB_TOKEN) immediately
after reading it in the Makefile targets that set NB_TOKEN and DEVICE_ID (the
blocks using KUBECTL_KIND, NAMESPACE, HOSTNAME and MOCK_BACKUP_DEVICE); if
NB_TOKEN is empty or unset, print a clear error like "ERROR: Nautobot token
missing or secret not found" and exit non‑zero before attempting the
curl/DEVICE_ID lookup. Apply the same explicit check to the second occurrence of
this pattern (the block around the other NB_TOKEN read) so both targets fail
fast on missing credentials instead of later returning a misleading "device not
found" result.
---
Nitpick comments:
In `@development/mock_topology/context/superpod/locations.yaml`:
- Around line 78-94: The pool range in the YAML uses spaces around the dash
("10.244.0.200 - 10.244.0.250") which is inconsistent with the auto-generated
format used in kea_dhcp_confgen.py (f"{first_ip}-{last_ip}"); update the pool
value under the subnet entry (the pools list in this file) to remove the spaces
so it matches the auto-generated pattern (e.g., "10.244.0.200-10.244.0.250") to
keep formatting consistent with kea_dhcp_confgen.py.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: c0b5d009-34a9-4c5b-b934-79dfa4f46418
📒 Files selected for processing (78)
Makefiledeploy/configs/local-superpod-sandbox.yamldeploy/helm/templates/dhcp.yamldeploy/helm/values-local-medium.yamldeploy/helm/values-local-small.yamldeploy/helm/values-local.yamldeploy/helm/values.yamldevelopment/mock_devices/Dockerfiledevelopment/mock_devices/README.mddevelopment/mock_devices/fixtures/devices/a04-u44-p01-tor-01/interface.jsondevelopment/mock_devices/fixtures/devices/a04-u44-p01-tor-01/platform.jsondevelopment/mock_devices/fixtures/devices/a04-u44-p01-tor-01/platform_inventory.jsondevelopment/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/interface.jsondevelopment/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/platform.jsondevelopment/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/platform_inventory.jsondevelopment/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/interface.jsondevelopment/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/platform.jsondevelopment/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/platform_inventory.jsondevelopment/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/interface.jsondevelopment/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/platform.jsondevelopment/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/platform_inventory.jsondevelopment/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/interface.jsondevelopment/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/platform.jsondevelopment/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/platform_inventory.jsondevelopment/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/interface.jsondevelopment/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/platform.jsondevelopment/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/platform_inventory.jsondevelopment/mock_devices/fixtures/devices/a09-u36-p01-spine-01/interface.jsondevelopment/mock_devices/fixtures/devices/a09-u36-p01-spine-01/platform.jsondevelopment/mock_devices/fixtures/devices/a09-u36-p01-spine-01/platform_inventory.jsondevelopment/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/interface.jsondevelopment/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/platform.jsondevelopment/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/platform_inventory.jsondevelopment/mock_devices/fixtures/eapi/4.29.5M/show_hostname.jsondevelopment/mock_devices/fixtures/eapi/4.29.5M/show_interfaces_status.jsondevelopment/mock_devices/fixtures/eapi/4.29.5M/show_lldp_neighbors_detail.jsondevelopment/mock_devices/fixtures/eapi/4.29.5M/show_mac_address_table.jsondevelopment/mock_devices/fixtures/eapi/4.29.5M/show_mpls_interface.jsondevelopment/mock_devices/fixtures/eapi/4.29.5M/show_version.jsondevelopment/mock_devices/fixtures/nvue/5.11.0/bridge_domain_mac_table.jsondevelopment/mock_devices/fixtures/nvue/5.11.0/interface.jsondevelopment/mock_devices/fixtures/nvue/5.11.0/platform.jsondevelopment/mock_devices/fixtures/nvue/5.11.0/platform_inventory.jsondevelopment/mock_devices/fixtures/nvue/5.11.0/system.jsondevelopment/mock_devices/fixtures/nvue/5.13.1/interface.jsondevelopment/mock_devices/fixtures/nvue/5.13.1/platform.jsondevelopment/mock_devices/fixtures/nvue/5.13.1/platform_inventory.jsondevelopment/mock_devices/fixtures/nvue/5.13.1/system.jsondevelopment/mock_devices/fixtures/nvue/5.14.0/bridge_domain_mac_table.jsondevelopment/mock_devices/fixtures/nvue/5.14.0/interface.jsondevelopment/mock_devices/fixtures/nvue/5.14.0/platform.jsondevelopment/mock_devices/fixtures/nvue/5.14.0/platform_inventory.jsondevelopment/mock_devices/fixtures/nvue/5.14.0/system.jsondevelopment/mock_devices/manifests/dhcp-dev-service.yamldevelopment/mock_devices/manifests/mock-devices.yamldevelopment/mock_devices/manifests/mock-dhcp-discover.yamldevelopment/mock_devices/manifests/mock-dhcp-validate.yamldevelopment/mock_devices/manifests/mock-wire-devices.yamldevelopment/mock_devices/manifests/mock-ztp-validate.yamldevelopment/mock_devices/mock_device/__init__.pydevelopment/mock_devices/mock_device/cli.pydevelopment/mock_devices/mock_device/config.pydevelopment/mock_devices/mock_device/device_api/__init__.pydevelopment/mock_devices/mock_device/device_api/eapi.pydevelopment/mock_devices/mock_device/device_api/fixtures.pydevelopment/mock_devices/mock_device/device_api/nvue.pydevelopment/mock_devices/mock_device/device_api/server.pydevelopment/mock_devices/mock_device/dhcp_client.pydevelopment/mock_devices/mock_device/fixture_generator.pydevelopment/mock_devices/mock_device/wire_nautobot.pydevelopment/mock_devices/mock_device/ztp_client.pydevelopment/mock_devices/pyproject.tomldevelopment/mock_topology/context/superpod/devices/a09-u23-p01-ufm-01.jsondevelopment/mock_topology/context/superpod/devices/b09-u23-p01-ufm-02.jsondevelopment/mock_topology/context/superpod/locations.yamldevelopment/mock_topology/jobs/designs/config_contexts.yaml.j2docs/getting-started/local-development-quick-start.mdxsrc/nv_config_manager/dhcp/kea_dhcp_confgen.py
✅ Files skipped from review due to trivial changes (37)
- development/mock_devices/fixtures/eapi/4.29.5M/show_hostname.json
- development/mock_devices/fixtures/nvue/5.11.0/platform.json
- development/mock_devices/fixtures/nvue/5.11.0/bridge_domain_mac_table.json
- development/mock_devices/fixtures/nvue/5.14.0/interface.json
- development/mock_topology/context/superpod/devices/a09-u23-p01-ufm-01.json
- development/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/platform.json
- development/mock_devices/mock_device/init.py
- development/mock_devices/fixtures/nvue/5.11.0/interface.json
- development/mock_devices/fixtures/nvue/5.14.0/bridge_domain_mac_table.json
- development/mock_devices/fixtures/nvue/5.13.1/platform.json
- development/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/platform_inventory.json
- development/mock_devices/fixtures/nvue/5.13.1/system.json
- development/mock_devices/fixtures/nvue/5.14.0/platform.json
- development/mock_devices/fixtures/nvue/5.11.0/system.json
- development/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/platform.json
- development/mock_devices/fixtures/nvue/5.14.0/platform_inventory.json
- development/mock_devices/fixtures/devices/a04-u44-p01-tor-01/platform_inventory.json
- development/mock_devices/mock_device/device_api/init.py
- development/mock_devices/fixtures/eapi/4.29.5M/show_interfaces_status.json
- development/mock_topology/context/superpod/devices/b09-u23-p01-ufm-02.json
- development/mock_devices/fixtures/devices/a09-u36-p01-spine-01/platform_inventory.json
- development/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/platform.json
- development/mock_devices/fixtures/devices/a09-u36-p01-spine-01/platform.json
- development/mock_devices/fixtures/nvue/5.11.0/platform_inventory.json
- development/mock_devices/fixtures/eapi/4.29.5M/show_mac_address_table.json
- development/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/platform_inventory.json
- development/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/platform_inventory.json
- development/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/platform_inventory.json
- development/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/platform.json
- development/mock_devices/fixtures/eapi/4.29.5M/show_lldp_neighbors_detail.json
- development/mock_devices/fixtures/eapi/4.29.5M/show_mpls_interface.json
- development/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/interface.json
- development/mock_devices/fixtures/devices/a04-u44-p01-tor-01/interface.json
- development/mock_devices/fixtures/nvue/5.13.1/interface.json
- development/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/interface.json
- development/mock_devices/README.md
- development/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/interface.json
🚧 Files skipped from review as they are similar to previous changes (21)
- development/mock_devices/fixtures/nvue/5.14.0/system.json
- deploy/helm/values-local.yaml
- development/mock_devices/fixtures/nvue/5.13.1/platform_inventory.json
- development/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/platform.json
- development/mock_devices/fixtures/devices/a04-u44-p01-tor-01/platform.json
- development/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/platform.json
- deploy/helm/values-local-small.yaml
- development/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/platform_inventory.json
- development/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/platform_inventory.json
- development/mock_devices/fixtures/eapi/4.29.5M/show_version.json
- deploy/helm/values.yaml
- development/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/interface.json
- development/mock_devices/manifests/dhcp-dev-service.yaml
- development/mock_devices/fixtures/devices/a09-u36-p01-spine-01/interface.json
- deploy/helm/values-local-medium.yaml
- development/mock_devices/Dockerfile
- deploy/configs/local-superpod-sandbox.yaml
- deploy/helm/templates/dhcp.yaml
- development/mock_devices/mock_device/device_api/eapi.py
- development/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/interface.json
- development/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/interface.json
|
/ok to test 4a829cd |
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>
4a829cd to
ce2bed0
Compare
There was a problem hiding this comment.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
docs/getting-started/local-development-quick-start.mdx (1)
59-77:⚠️ Potential issue | 🔴 CriticalFix installer CLI command naming in local preview docs
The docs use
uv run nvcm-installer ..., but the referenced Makefile command name appears different (nv-config-manager-installer). A quickuv run ... --helpfrominstaller/couldn’t find either CLI name in this environment, so the docs should align with however the project defines the installer entrypoint (per the Makefile/installer scripts).🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/getting-started/local-development-quick-start.mdx` around lines 59 - 77, The documentation shows the installer invocation as "uv run nvcm-installer ..." but the actual project uses a different entrypoint name; update the command in docs/getting-started/local-development-quick-start.mdx to match the project's installer entrypoint as defined in the Makefile/installer scripts (for example replace nvcm-installer with the actual CLI name such as nv-config-manager-installer or the value used in the Makefile target), ensure the example uses the exact CLI token used by the installer (and preserve the same flags: deploy ../deploy/configs/local-superpod.yaml --image-source local --build-images --load-kind --kind-cluster nv-config-manager --install-envoy-gateway --install-cnpg-operator --install-cert-manager) so the docs are accurate and runnable.
🧹 Nitpick comments (1)
development/mock_devices/mock_device/config.py (1)
48-50: 💤 Low valueClarify that template syntax is limited string replacement, not full Jinja2.
The docstring at Line 49 states "Jinja2 template" but the implementation (lines 72-74) uses basic
str.replace()for{{ serial | hex }}and{{ serial }}patterns only, not a Jinja2 engine. Update the docstring to avoid confusion.📝 Suggested docstring update
client_id_template: str = Field( - default="", description="Jinja2 template for client-id (e.g. '00:{{ serial | hex }}')" + default="", description="Template for client-id using {{ serial }} or {{ serial | hex }} markers (e.g. '00:{{ serial | hex }}')" )🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@development/mock_devices/mock_device/config.py` around lines 48 - 50, Update the Field description for client_id_template to clarify that it is not a full Jinja2 template engine but a limited string-replacement template: say it supports only the two patterns "{{ serial }}" and "{{ serial | hex }}" via simple str.replace-based substitution (refer to the replacement logic in the client_id_template handling), so callers aren’t misled into using full Jinja2 features.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@development/mock_devices/mock_device/config.py`:
- Around line 60-82: The client_id() method can raise ValueError when calling
bytes.fromhex(rendered.replace(":", "")) if the rendered string contains non-hex
characters; update client_id to catch that exception around the bytes.fromhex
call (or validate rendered first) and return None on failure, referencing the
client_id function, the rendered variable, and the bytes.fromhex call so the fix
encloses that conversion in a try/except that logs or ignores the ValueError and
returns None.
- Around line 89-106: The from_env() method currently calls
int(os.environ.get("MOCK_DEVICE_API_PORT", "0")) directly which will raise
ValueError on non-numeric values; update DeviceConfig.from_env to read the env
var into a local string (e.g., port_str = os.environ.get("MOCK_DEVICE_API_PORT",
"0")), attempt int(port_str) in a try/except, and on failure set api_port to 0
(or a safe default) — optionally emit a warning — and pass that safe integer
into the DeviceConfig(...) api_port field.
In `@docs/getting-started/local-development-quick-start.mdx`:
- Around line 86-99: Update the docs to accurately reflect the scope and
behavior of the make targets: change the `make mock-dhcp-validate` and `make
mock-ztp-validate` descriptions to state they validate only the single device
named by the environment variables `MOCK_DHCP_DEVICE` / `MOCK_ZTP_DEVICE`
(default `a04-u44-p01-tor-01`) rather than “all mock devices”, and change the
`make mock-workflow-backup` description to say it starts the Temporal workflow
(it does not wait for workflow completion) or alternatively update the `make
mock-workflow-backup` target to include a completion check if you want docs to
claim it waits for completion; ensure you reference the exact target names
(`make mock-dhcp-validate`, `make mock-ztp-validate`, `make
mock-workflow-backup`) and the env vars when editing the sentence text.
---
Outside diff comments:
In `@docs/getting-started/local-development-quick-start.mdx`:
- Around line 59-77: The documentation shows the installer invocation as "uv run
nvcm-installer ..." but the actual project uses a different entrypoint name;
update the command in docs/getting-started/local-development-quick-start.mdx to
match the project's installer entrypoint as defined in the Makefile/installer
scripts (for example replace nvcm-installer with the actual CLI name such as
nv-config-manager-installer or the value used in the Makefile target), ensure
the example uses the exact CLI token used by the installer (and preserve the
same flags: deploy ../deploy/configs/local-superpod.yaml --image-source local
--build-images --load-kind --kind-cluster nv-config-manager
--install-envoy-gateway --install-cnpg-operator --install-cert-manager) so the
docs are accurate and runnable.
---
Nitpick comments:
In `@development/mock_devices/mock_device/config.py`:
- Around line 48-50: Update the Field description for client_id_template to
clarify that it is not a full Jinja2 template engine but a limited
string-replacement template: say it supports only the two patterns "{{ serial
}}" and "{{ serial | hex }}" via simple str.replace-based substitution (refer to
the replacement logic in the client_id_template handling), so callers aren’t
misled into using full Jinja2 features.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 440fba0e-beab-41a1-bd9c-cbff8dd096aa
📒 Files selected for processing (78)
Makefiledeploy/configs/local-superpod-sandbox.yamldeploy/helm/templates/dhcp.yamldeploy/helm/values-local-medium.yamldeploy/helm/values-local-small.yamldeploy/helm/values-local.yamldeploy/helm/values.yamldevelopment/mock_devices/Dockerfiledevelopment/mock_devices/README.mddevelopment/mock_devices/fixtures/devices/a04-u44-p01-tor-01/interface.jsondevelopment/mock_devices/fixtures/devices/a04-u44-p01-tor-01/platform.jsondevelopment/mock_devices/fixtures/devices/a04-u44-p01-tor-01/platform_inventory.jsondevelopment/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/interface.jsondevelopment/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/platform.jsondevelopment/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/platform_inventory.jsondevelopment/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/interface.jsondevelopment/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/platform.jsondevelopment/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/platform_inventory.jsondevelopment/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/interface.jsondevelopment/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/platform.jsondevelopment/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/platform_inventory.jsondevelopment/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/interface.jsondevelopment/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/platform.jsondevelopment/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/platform_inventory.jsondevelopment/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/interface.jsondevelopment/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/platform.jsondevelopment/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/platform_inventory.jsondevelopment/mock_devices/fixtures/devices/a09-u36-p01-spine-01/interface.jsondevelopment/mock_devices/fixtures/devices/a09-u36-p01-spine-01/platform.jsondevelopment/mock_devices/fixtures/devices/a09-u36-p01-spine-01/platform_inventory.jsondevelopment/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/interface.jsondevelopment/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/platform.jsondevelopment/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/platform_inventory.jsondevelopment/mock_devices/fixtures/eapi/4.29.5M/show_hostname.jsondevelopment/mock_devices/fixtures/eapi/4.29.5M/show_interfaces_status.jsondevelopment/mock_devices/fixtures/eapi/4.29.5M/show_lldp_neighbors_detail.jsondevelopment/mock_devices/fixtures/eapi/4.29.5M/show_mac_address_table.jsondevelopment/mock_devices/fixtures/eapi/4.29.5M/show_mpls_interface.jsondevelopment/mock_devices/fixtures/eapi/4.29.5M/show_version.jsondevelopment/mock_devices/fixtures/nvue/5.11.0/bridge_domain_mac_table.jsondevelopment/mock_devices/fixtures/nvue/5.11.0/interface.jsondevelopment/mock_devices/fixtures/nvue/5.11.0/platform.jsondevelopment/mock_devices/fixtures/nvue/5.11.0/platform_inventory.jsondevelopment/mock_devices/fixtures/nvue/5.11.0/system.jsondevelopment/mock_devices/fixtures/nvue/5.13.1/interface.jsondevelopment/mock_devices/fixtures/nvue/5.13.1/platform.jsondevelopment/mock_devices/fixtures/nvue/5.13.1/platform_inventory.jsondevelopment/mock_devices/fixtures/nvue/5.13.1/system.jsondevelopment/mock_devices/fixtures/nvue/5.14.0/bridge_domain_mac_table.jsondevelopment/mock_devices/fixtures/nvue/5.14.0/interface.jsondevelopment/mock_devices/fixtures/nvue/5.14.0/platform.jsondevelopment/mock_devices/fixtures/nvue/5.14.0/platform_inventory.jsondevelopment/mock_devices/fixtures/nvue/5.14.0/system.jsondevelopment/mock_devices/manifests/dhcp-dev-service.yamldevelopment/mock_devices/manifests/mock-devices.yamldevelopment/mock_devices/manifests/mock-dhcp-discover.yamldevelopment/mock_devices/manifests/mock-dhcp-validate.yamldevelopment/mock_devices/manifests/mock-wire-devices.yamldevelopment/mock_devices/manifests/mock-ztp-validate.yamldevelopment/mock_devices/mock_device/__init__.pydevelopment/mock_devices/mock_device/cli.pydevelopment/mock_devices/mock_device/config.pydevelopment/mock_devices/mock_device/device_api/__init__.pydevelopment/mock_devices/mock_device/device_api/eapi.pydevelopment/mock_devices/mock_device/device_api/fixtures.pydevelopment/mock_devices/mock_device/device_api/nvue.pydevelopment/mock_devices/mock_device/device_api/server.pydevelopment/mock_devices/mock_device/dhcp_client.pydevelopment/mock_devices/mock_device/fixture_generator.pydevelopment/mock_devices/mock_device/wire_nautobot.pydevelopment/mock_devices/mock_device/ztp_client.pydevelopment/mock_devices/pyproject.tomldevelopment/mock_topology/context/superpod/devices/a09-u23-p01-ufm-01.jsondevelopment/mock_topology/context/superpod/devices/b09-u23-p01-ufm-02.jsondevelopment/mock_topology/context/superpod/locations.yamldevelopment/mock_topology/jobs/designs/config_contexts.yaml.j2docs/getting-started/local-development-quick-start.mdxsrc/nv_config_manager/dhcp/kea_dhcp_confgen.py
✅ Files skipped from review due to trivial changes (35)
- development/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/platform.json
- development/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/platform_inventory.json
- development/mock_devices/fixtures/devices/a09-u36-p01-spine-01/platform_inventory.json
- development/mock_topology/context/superpod/devices/a09-u23-p01-ufm-01.json
- development/mock_devices/fixtures/nvue/5.11.0/platform.json
- development/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/platform_inventory.json
- development/mock_devices/fixtures/nvue/5.14.0/interface.json
- development/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/platform.json
- development/mock_topology/context/superpod/devices/b09-u23-p01-ufm-02.json
- development/mock_devices/fixtures/nvue/5.14.0/system.json
- development/mock_devices/fixtures/eapi/4.29.5M/show_hostname.json
- development/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/platform.json
- development/mock_devices/fixtures/nvue/5.14.0/bridge_domain_mac_table.json
- deploy/helm/values-local-small.yaml
- development/mock_devices/fixtures/devices/a08-u28-p01-oobspine-01/interface.json
- development/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/platform.json
- development/mock_devices/fixtures/nvue/5.11.0/system.json
- development/mock_devices/pyproject.toml
- development/mock_devices/fixtures/nvue/5.13.1/system.json
- development/mock_devices/fixtures/eapi/4.29.5M/show_mpls_interface.json
- development/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/platform.json
- development/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/platform_inventory.json
- development/mock_devices/fixtures/nvue/5.13.1/platform_inventory.json
- development/mock_devices/fixtures/devices/a04-u44-p01-tor-01/platform.json
- development/mock_devices/fixtures/nvue/5.11.0/bridge_domain_mac_table.json
- development/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/interface.json
- development/mock_devices/mock_device/init.py
- development/mock_devices/fixtures/nvue/5.11.0/platform_inventory.json
- development/mock_devices/fixtures/devices/a09-u44-p01-pleaf-01/platform_inventory.json
- development/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/platform_inventory.json
- development/mock_devices/fixtures/eapi/4.29.5M/show_interfaces_status.json
- development/mock_devices/fixtures/eapi/4.29.5M/show_lldp_neighbors_detail.json
- development/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/platform_inventory.json
- development/mock_devices/fixtures/nvue/5.14.0/platform_inventory.json
- development/mock_devices/fixtures/devices/a09-u32-p01-sleaf-01/interface.json
🚧 Files skipped from review as they are similar to previous changes (33)
- development/mock_devices/fixtures/devices/a04-u44-p01-tor-01/platform_inventory.json
- development/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/platform.json
- development/mock_devices/fixtures/eapi/4.29.5M/show_version.json
- development/mock_devices/manifests/mock-dhcp-validate.yaml
- development/mock_devices/fixtures/eapi/4.29.5M/show_mac_address_table.json
- development/mock_devices/fixtures/nvue/5.13.1/platform.json
- development/mock_devices/fixtures/nvue/5.14.0/platform.json
- src/nv_config_manager/dhcp/kea_dhcp_confgen.py
- development/mock_devices/mock_device/device_api/init.py
- development/mock_devices/fixtures/devices/a09-u36-p01-spine-01/platform.json
- development/mock_devices/manifests/dhcp-dev-service.yaml
- development/mock_devices/fixtures/nvue/5.11.0/interface.json
- development/mock_topology/jobs/designs/config_contexts.yaml.j2
- development/mock_devices/fixtures/devices/a04-u44-p01-tor-01/interface.json
- development/mock_devices/manifests/mock-wire-devices.yaml
- deploy/helm/templates/dhcp.yaml
- development/mock_devices/fixtures/devices/a09-u28-p01-bleaf-01/interface.json
- development/mock_devices/manifests/mock-dhcp-discover.yaml
- deploy/helm/values.yaml
- development/mock_devices/mock_device/device_api/server.py
- deploy/helm/values-local.yaml
- development/mock_devices/README.md
- deploy/configs/local-superpod-sandbox.yaml
- development/mock_devices/Dockerfile
- development/mock_devices/manifests/mock-devices.yaml
- development/mock_devices/fixtures/devices/a09-u36-p01-spine-01/interface.json
- development/mock_devices/fixtures/devices/a08-u44-p01-mleaf-01/interface.json
- development/mock_devices/mock_device/wire_nautobot.py
- development/mock_devices/mock_device/dhcp_client.py
- development/mock_devices/mock_device/device_api/nvue.py
- development/mock_devices/fixtures/devices/a08-u32-p01-cleaf-01/interface.json
- development/mock_topology/context/superpod/locations.yaml
- development/mock_devices/mock_device/device_api/eapi.py
Signed-off-by: Joseph Jung <jojung@nvidia.com>
Description
Mock Device Sandbox for Local DHCP/ZTP Development
Mock Device Server (
development/mock_devices/)interface.json,platform_inventory.json) so each mock device returns its correct serial number and interface data via the APIgenerate-fixtures) that reads device topology JSONs and produces version-specific and per-device fixture files automaticallywireCLI /make mock-wire-devices) that resolves each mock device's Kubernetes ClusterIP and updates Nautobot'sprimary_ip4, enabling Temporal workflows to reach mock devicesDHCP / ZTP Validation Tooling
validateCLI /make mock-dhcp-validate) that queries the Kea API through the DHCP service and checks for a matching reservation byhw-addressorclient-id, with no raw sockets requireddhcpCLI /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 timeztp-validateCLI /make mock-ztp-validate) that walks the full ZTP provisioning chain: DHCP reservation → boot script → serial validation → config retrievalhw-address(matching production switch behavior) and falls back toclient-id/serial for devices without a MACSuperpod Topology — DHCP/ZTP Support
superpod/locations.yaml:TEST-SITE Sandbox DHCP Subnet— registers the Kind pod network (10.244.0.0/16) as a Kea static subnetSuperpod-dhcp-options— setsreservations-global: trueoneth0interfaces and injects ZTPboot-file-name/cumulus-provision-urloptions into reservationsKubernetes Manifests
mock-wire-devices,mock-dhcp-validate,mock-dhcp-discover, andmock-ztp-validate, all parameterized viaenvsubstMakefile Targets
mock-devices— deploys all mock device pods into the Kind clustermock-wire-devices— wires mock device ClusterIPs into Nautobotmock-dhcp-validate/mock-dhcp-discover/mock-ztp-validate— end-to-end sandbox validation targets with configurable device/serial overridesmock-status— shows pod and service state for all mock devicessandbox-upandkind-upupdated to use thesuperpodtopology and deploy mock devices as part of the standard local dev setupHelm / Deploy Config
local-superpod-sandbox.yamldeploy config and updated local Helm values to enable the DHCP dev service and wire thesuperpodtopologyBreakdown of changes in this PR
development/mock_devices/fixtures/development/mock_devices/mock_devices/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 ofdevelopment/should beMakefile(260 lines), topology YAML context additions (~62 lines), and thekea_dhcp_confgen.py(5 lines).Validation
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 defaulttest_pathfor the full suite,or narrow it only while debugging.
Passing Kind Integration run:
Checklist
CONTRIBUTING.md.docs screenshots, or Helm/rendered outputs.
Summary by CodeRabbit
New Features
Configuration
Documentation