fixing silent filter errors in srql #2500
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!2500
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "refs/pull/2500/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: #2050
Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2050
Original created: 2025-12-03T06:54:02Z
Original updated: 2025-12-03T18:12:52Z
Original head: carverauto/serviceradar:2049-bugsrql-inconsistent-error-handling-for-filters
Original base: main
Original merged: 2025-12-03T18:12:49Z 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, Tests
Description
Replace silent filter field ignoring with explicit error returns across nine SRQL query modules
Add unit tests validating unknown filter fields return proper error messages
Update documentation with comprehensive supported filter fields reference per entity
Fix stats filter validation in logs and otel_metrics modules to reject unknown fields
Diagram Walkthrough
File Walkthrough
9 files
Replace silent filter catch-all with error returnReplace silent filter catch-all with error returnFix silent filter and stats filter error handlingReplace silent filter catch-all with error returnFix silent filter and stats filter error handlingReplace silent filter catch-all with error returnReplace silent filter catch-all with error returnReplace silent filter catch-all with error returnReplace silent filter catch-all with error return4 files
Add comprehensive supported filter fields documentationDocument fix rationale and implementation detailsDefine requirements and test scenarios for fixTrack implementation tasks and verification stepsImported GitHub PR comment.
Original author: @qodo-code-review[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/2050#issuecomment-3605363257
Original created: 2025-12-03T06:54:38Z
PR Compliance Guide 🔍
Below is a summary of compliance checks for this PR:
Breaking behavior change
Description: Changing stats filter handling from returning Ok(None) to explicit errors may break
clients relying on prior permissive behavior; confirm API versioning/compat guarantees and
error message stability to avoid denial-of-service from unexpected 400s.
logs.rs [429-444]
Referred Code
Information disclosure
Description: Stats filter clause now errors on unknown fields; if upstream inputs are partially
user-controlled, stricter errors could reveal entity names/field hints—review error
strings for information disclosure policies.
otel_metrics.rs [381-394]
Referred Code
🎫 #2049
explicit InvalidRequest errors for unknown fields.
silent data leakage/confusion).
contexts.
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: 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
Generic: Comprehensive Audit Trails
Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.
Status:
No audit logs: The changes focus on returning explicit InvalidRequest errors for unsupported filters and
adding unit tests/documentation, but there is no evidence in the new code that critical
actions are being logged with user, timestamp, action, and outcome.
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/2050#issuecomment-3605367178
Original created: 2025-12-03T06:56:01Z
PR Code Suggestions ✨
Explore these optional code suggestions:
Validate filter operation for boolean field
In
build_stats_filter_clause, add validation to ensure only the equalityoperator is used for the
is_slowfield, returning an error for other operatorsto prevent incorrect query behavior.
rust/srql/src/query/otel_metrics.rs [361-397]
[To ensure code accuracy, apply this suggestion manually]Suggestion importance[1-10]: 8
__
Why: This suggestion identifies a bug where an unsupported filter operation on the
is_slowfield would be silently accepted, leading to incorrect query logic. The fix prevents this by adding a necessary validation check.Improve test to handle all success cases
Improve the
unknown_stats_filter_field_returns_errortest by modifying the panicmessage in the
Okarm to include the unexpected success value, making testfailures more informative.
rust/srql/src/query/logs.rs [652-680]
Suggestion importance[1-10]: 3
__
Why: The suggestion correctly identifies that any
Okresult frombuild_stats_queryis a test failure, and improves the test's panic message to be more descriptive, which aids in debugging.