adding dropdown for agent selection #2845
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!2845
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "refs/pull/2845/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: #2691
Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2691
Original created: 2026-02-03T23:49:45Z
Original updated: 2026-02-04T15:41:56Z
Original head: carverauto/serviceradar:2651-bug-interfaces-for-switches-not-showing-up-in-device-details
Original base: staging
Original merged: 2026-02-04T15:41:54Z 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
Enhancement, Bug fix
Description
Add server-side validation for discovery job agent assignments against registered agents
Implement dropdown selector for agent assignment in discovery job editor UI
Add run-now action to trigger discovery jobs immediately from the jobs table
Validate agent exists in correct partition and reject invalid assignments
Diagram Walkthrough
File Walkthrough
4 files
New change module to trigger mapper job runsAdd agent validation and run_now actionNew validation for agent assignment eligibilityAdd agent dropdown and run-now button to UI2 files
Tests for agent assignment validation logicTests for agent selector and run-now action5 files
Design document for interface visibility fixProposal for interface tab and discovery UX improvementsUI requirements for interface tab visibilityAPI requirements for agent validation and run-nowImplementation tasks and progress trackingImported GitHub PR comment.
Original author: @qodo-code-review[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/2691#issuecomment-3844429945
Original created: 2026-02-03T23:50:25Z
PR Compliance Guide 🔍
Below is a summary of compliance checks for this PR:
Authorization bypass
Description: The new LiveView event
run_mapper_joband the new agent loading path (load_agents/1) mayallow any user who can access the page to enumerate registered agents and trigger
discovery jobs without an explicit role/authorization check in the LiveView layer, which
could enable unauthorized job execution or infrastructure information disclosure if
upstream authorization is misconfigured.
index.ex [361-2797]
Referred Code
🎫 #2651
interfaces in device details (i.e., why interfaces are not being picked up/returned for
the device query example provided).
Codebase context is not defined
Follow the guide to enable codebase context checks.
Generic: Meaningful Naming and Self-Documenting Code
Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting
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
Generic: Secure Error Handling
Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.
Status:
Leaky user error: The new flash message interpolates
format_error(reason)into a user-facing error, whichcan expose internal/system details depending on how
format_error/1renders exceptions.Referred Code
Generic: Comprehensive Audit Trails
Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.
Status:
Missing audit logging: The new "run now" discovery-job trigger path does not emit an audit log entry
capturing user identity, timestamp, action, and outcome, so event reconstruction may rely
on unseen infrastructure.
Referred Code
Generic: Robust Error Handling and Edge Case Management
Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation
Status:
Swallowed lookup errors: Agent lookup failures return a generic validation error (
"agent lookup failed")without logging the underlying reason, which may hinder production diagnosis unless
upstream telemetry exists.
Referred Code
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:
Logs inspect(reason): The new warning log line uses
inspect(reason), which may include internal details orsensitive fields depending on the error payload returned by
Ash.read/2.Referred Code
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/2691#issuecomment-3844433161
Original created: 2026-02-03T23:51:36Z
PR Code Suggestions ✨
Explore these optional code suggestions:
✅
Prevent crashes from non-stringifiable agent capabilitiesSuggestion Impact:
agent_supports_mapper?/1 was updated to Enum.filter capabilities for binaries/atoms before mapping to_string/1, preventing crashes on malformed capability entries.code diff:
In
agent_supports_mapper?/1, filter theagent.capabilitieslist to include onlybinaries and atoms before calling
to_string/1to prevent potential crashes frommalformed data.
web-ng/lib/serviceradar_web_ng_web/live/settings/networks_live/index.ex [2753-2757]
[Suggestion processed]Suggestion importance[1-10]: 6
__
Why: The suggestion correctly identifies a potential crash due to unexpected data types in
agent.capabilitiesand provides a robust fix, improving the code's resilience.✅
Log the reason for agent lookup failuresSuggestion Impact:
Added Logger requirement and updated the {:error, reason} match arm to log the failure reason before returning the validation error.code diff:
In
validate/3, log the error reason when theAsh.read_onecall fails to improveobservability and aid in debugging system-level issues.
elixir/serviceradar_core/lib/serviceradar/network_discovery/validations/agent_assignment.ex [50-52]
[To ensure code accuracy, apply this suggestion manually]Suggestion importance[1-10]: 5
__
Why: The suggestion correctly identifies that an error reason is being ignored and proposes logging it, which improves debuggability but does not fix a functional bug.