fix: KeyError not passing @agents #2856
No reviewers
Labels
No labels
1week
2weeks
Failed compliance check
IP cameras
NATS
Possible security concern
Review effort 1/5
Review effort 2/5
Review effort 3/5
Review effort 4/5
Review effort 5/5
UI
aardvark
accessibility
amd64
api
arm64
auth
back-end
bgp
blog
bug
build
checkers
ci-cd
cleanup
cnpg
codex
core
dependencies
device-management
documentation
duplicate
dusk
ebpf
enhancement
eta 1d
eta 1hr
eta 3d
eta 3hr
feature
fieldsurvey
github_actions
go
good first issue
help wanted
invalid
javascript
k8s
log-collector
mapper
mtr
needs-triage
netflow
network-sweep
observability
oracle
otel
plug-in
proton
python
question
reddit
redhat
research
rperf
rperf-checker
rust
sdk
security
serviceradar-agent
serviceradar-agent-gateway
serviceradar-web
serviceradar-web-ng
siem
snmp
sysmon
topology
ubiquiti
wasm
wontfix
zen-engine
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
carverauto/serviceradar!2856
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "refs/pull/2856/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from GitHub pull request.
Original GitHub pull request: #2707
Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2707
Original created: 2026-02-05T04:33:53Z
Original updated: 2026-02-05T05:42:29Z
Original head: carverauto/serviceradar:2704-bugweb-ng-mapper
Original base: staging
Original merged: 2026-02-05T05:42:27Z by @mfreeman451
User description
IMPORTANT: Please sign the Developer Certificate of Origin
Thank you for your contribution to ServiceRadar. Please note, when contributing, the developer must include
a DCO sign-off statement indicating the DCO acceptance in one commit message. Here
is an example DCO Signed-off-by line in a commit message:
Describe your changes
Issue ticket number and link
Code checklist before requesting a review
PR Type
Bug fix
Description
Add missing
agentsparameter to discovery panel componentPass
@agentsassign from parent to child componentDefine
agentsattribute in discovery_panel function componentDiagram Walkthrough
File Walkthrough
index.ex
Pass agents parameter to discovery panelweb-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/index.ex
agents={@agents}parameter when callingdiscovery_panelcomponent
attr :agents, :list, default: []attribute definition todiscovery_panel function component
Imported GitHub PR comment.
Original author: @qodo-code-review[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/2707#issuecomment-3851030617
Original created: 2026-02-05T04:34:11Z
PR Compliance Guide 🔍
Below is a summary of compliance checks for this PR:
No security concerns identified
No security vulnerabilities detected by AI analysis. Human verification advised for critical code.🎫 #2704
KeyErrorcrash caused by missing:agentsassign in the discoverypanel rendering path.
agentsvalue (or has a safedefault) so rendering does not require
@agentsto always be present.Codebase context is not defined
Follow the guide to enable codebase context checks.
Generic: Comprehensive Audit Trails
Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.
Status: Passed
Generic: Meaningful Naming and Self-Documenting Code
Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting
Status: Passed
Generic: Robust Error Handling and Edge Case Management
Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation
Status: Passed
Generic: Secure Error Handling
Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.
Status: Passed
Generic: Secure Logging Practices
Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.
Status: Passed
Generic: Security-First Input Validation and Data Handling
Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities
Status: Passed
Compliance status legend
🟢 - Fully Compliant🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label
Imported GitHub PR comment.
Original author: @qodo-code-review[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/2707#issuecomment-3851033359
Original created: 2026-02-05T04:35:10Z
PR Code Suggestions ✨
Explore these optional code suggestions:
Prevent a crash if agents is nil
To prevent a potential runtime error if
@agentsisnil, provide a fallback to anempty list when passing it to the
discovery_panelcomponent.web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/index.ex [952]
Suggestion importance[1-10]: 7
__
Why: The suggestion correctly identifies that if
@agentsisnil, passing it to the component will cause a runtimeArgumentErrordue to the:listtype constraint, and the proposed fix prevents this crash.Require agents attribute
Change the
agentsattribute from having a default value to being a requiredattribute to enforce its presence at compile time.
web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/index.ex [1069]
Suggestion importance[1-10]: 3
__
Why: This suggests a valid alternative design choice by making the
agentsattribute required, but it contradicts the PR's intent of providing a default and does not solve the potential runtime error ifnilis passed.