fixing srql #2685
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!2685
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "refs/pull/2685/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: #2326
Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2326
Original created: 2026-01-18T00:15:03Z
Original updated: 2026-01-18T07:02:28Z
Original head: carverauto/serviceradar:bug/srql-broken
Original base: staging
Original merged: 2026-01-18T07:02:11Z 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, Enhancement
Description
Fix SRQL query engine by adding proper LIKE operator support with case-insensitive substring matching
Implement dynamic array field detection to route array filters through correct PostgreSQL operators
Add
in:devicesentity token prefix to device quick filter URLs for parser complianceRefactor filter application to separate scalar and array field handling logic
Add
require Ash.Querydirective for proper Ash query compilationDiagram Walkthrough
File Walkthrough
ash_adapter.ex
Add array field detection and LIKE operator supportweb-ng/lib/serviceradar_web_ng/srql/ash_adapter.ex
require Ash.Querydirective for proper query compilationarray_field?/2function to dynamically detect array-typedfields via Ash resource introspection
apply_filter_op/5to acceptresourceparameter and route tospecialized handlers
apply_array_filter/3to handle array fields usinghas_anyoperator for containment checks
apply_scalar_filter/3to handle scalar fields with support forLIKE, not_like, not_in operators
ilikefilter and wildcardstripping
index.ex
Add entity token prefix to quick filter URLsweb-ng/lib/serviceradar_web_ng_web/live/device_live/index.ex
in:devicesentity token prefixis_available:truefilter fromq=is_available:truetoq=in:devices is_available:trueis_available:falsefilter fromq=is_available:falsetoq=in:devices is_available:falsediscovery_sourcesfilter fromq=discovery_sources:sweeptoq=in:devices discovery_sources:(sweep)design.md
Design document for SRQL query engine fixesopenspec/changes/fix-srql-query-engine/design.md
and filtering
handling, array field detection, and TimeFilterSpec serialization
hardcoded array detection
testing
proposal.md
Change proposal for SRQL query engine fixesopenspec/changes/fix-srql-query-engine/proposal.md
tokens, broken LIKE queries, array field errors, TimeFilterSpec
serialization, and stale tenant code
support, array field handling, and Rust serialization
spec.md
SRQL specification updates for query engine fixesopenspec/changes/fix-srql-query-engine/specs/srql/spec.md
not_like, and not_in operators
case-insensitive matching
errors
incorrect query formats
and RelativeDays variants
removal
tasks.md
Implementation tasks for SRQL query engine fixesopenspec/changes/fix-srql-query-engine/tasks.md
filter URL updates, LIKE operator implementation, array field
handling, tenant code removal, testing, and cleanup
and test scenarios
queries
related GitHub issues
Imported GitHub PR comment.
Original author: @qodo-code-review[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/2326#issuecomment-3764516157
Original created: 2026-01-18T00:16:00Z
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.🎫 No ticket provided
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: 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
Generic: Robust Error Handling and Edge Case Management
Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation
Status:
Silent error swallowing: Multiple broad
rescue _ -> query/falseblocks silently ignore failures (includinginvalid filter construction/introspection) without logging or actionable context, making
debugging and edge-case diagnosis difficult.
Referred Code
Generic: Secure Error Handling
Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.
Status:
Exception message exposure:
build_query/4returnsException.message(e)in the error tuple which may propagate internalimplementation details to user-facing surfaces depending on upstream handling.
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/2326#issuecomment-3764517078
Original created: 2026-01-18T00:17:05Z
PR Code Suggestions ✨
Explore these optional code suggestions:
✅
Import Ash.Query macrosSuggestion Impact:
The commit did not add `import Ash.Query`, but it refactored filter construction to use `Ash.Query.filter_input/2` with map-based predicates (e.g., `contains`, `not_contains`, `not_in`) instead of the `ref/1` and `ilike/2` macros. This removes the need for importing `Ash.Query` macros, addressing the underlying compilation risk the suggestion raised.code diff:
Add
import Ash.Queryto make theref,ilike, andhas_anymacros available andprevent a compilation error.
web-ng/lib/serviceradar_web_ng/srql/ash_adapter.ex [59-525]
[To ensure code accuracy, apply this suggestion manually]Suggestion importance[1-10]: 9
__
Why: The suggestion correctly identifies a missing
import Ash.Querythat will cause a compilation failure, making it a critical fix for the code to work as intended.Log errors in array filter
In
apply_array_filter/4, log any rescued exceptions instead of silently ignoringthem to improve debuggability when a filter fails.
web-ng/lib/serviceradar_web_ng/srql/ash_adapter.ex [469-489]
Suggestion importance[1-10]: 7
__
Why: The suggestion correctly points out that swallowing errors silently is bad practice and proposes adding logging, which significantly improves debuggability without changing the function's behavior.
Log errors in scalar filter
In
apply_scalar_filter/4, log any rescued exceptions instead of silentlyignoring them to improve debuggability when a filter fails.
web-ng/lib/serviceradar_web_ng/srql/ash_adapter.ex [492-539]
[To ensure code accuracy, apply this suggestion manually]Suggestion importance[1-10]: 7
__
Why: The suggestion correctly points out that swallowing errors silently is bad practice and proposes adding logging, which significantly improves debuggability without changing the function's behavior.
Imported GitHub PR comment.
Original author: @qodo-code-review[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/2326#issuecomment-3764977663
Original created: 2026-01-18T06:36:32Z
CI Feedback 🧐
A test triggered by this PR failed. Here is an AI-generated analysis of the failure:
Action: build
Failed stage: Setup Rust [❌]
Failed test name: ""
Failure summary:
The action failed during the step
install rustup if neededbecause the runner could not download theRust installer.
-
curlfailed withOpenSSL SSL_read: Connection reset by peer (errno 104)whilefetching
https://static.rust-lang.org/.../rustup-init(log lines 347-349).- This network/TLS
connection reset caused the
downloadercommand to fail, and the job exited with code1(line 350).Relevant error logs: