zen build fixes #2296
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!2296
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "refs/pull/2296/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: #1725
Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/1725
Original created: 2025-10-06T20:04:25Z
Original updated: 2025-10-06T20:10:05Z
Original head: carverauto/serviceradar:k8s/zen_fixes
Original base: main
Original merged: 2025-10-06T20:10:01Z by @mfreeman451
PR Type
Bug fix, Enhancement
Description
Fix NATS stream subjects configuration for event handling
Add SNMP severity rule and improve rule installation
Code formatting and import organization improvements
Fix newline endings and remove extra whitespace
Diagram Walkthrough
File Walkthrough
1 files
Fix NATS stream subjects configuration12 files
Remove extra whitespace and fix importsFormat code and fix newline endingReorder imports and fix newline endingFormat code and improve readabilityOrganize imports and format codeFix newline endingFormat code and fix newline endingRemove whitespace and reorder importsFormat code and fix newline endingOrganize imports and format codeOrganize imports and format codeFormat match pattern for readability6 files
Add KV bucket creation fallbackAdd rule seeding functionalityRefactor rule installation with SNMP supportAdd SNMP severity rule configurationUpdate rules format and add SNMPAdd SNMP severity rule file3 files
Add SNMP severity rule exportInclude SNMP severity rule in packageAdd SNMP severity rule to packagingImported GitHub PR comment.
Original author: @qodo-code-review[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/1725#issuecomment-3373804763
Original created: 2025-10-06T20:05:32Z
PR Compliance Guide 🔍
Below is a summary of compliance checks for this PR:
Insecure default KV config
Description: The tool auto-creates a JetStream KV bucket with default settings if missing, which may
bypass intended server-side retention/replication policies and should be verified against
deployment security and data governance requirements.
put_rule.rs [85-99]
Referred Code
🎫 No ticket provided
Codebase context is not defined
Follow the guide to enable codebase context checks.
No custom compliance provided
Follow the guide to enable custom compliance check.
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/1725#issuecomment-3373811883
Original created: 2025-10-06T20:06:47Z
PR Code Suggestions ✨
Explore these optional code suggestions:
Document the significant rule engine format change
The PR changes the Zen rule engine format from a list of rules to a graph-based
structure. This is a major breaking change that should be documented in the PR
description.
Examples:
k8s/demo/base/serviceradar-zen-rules.yaml [7-36]
Solution Walkthrough:
Before:
After:
Suggestion importance[1-10]: 9
__
Why: The suggestion correctly identifies a major, undocumented breaking change in the Zen rule engine's data format, which is critical for understanding the PR's impact and future maintenance.
Remove bypass edge in rule
Remove the bypass edge with
id: "e3"from thesnmp_severity.jsonrule. This edgeincorrectly routes data directly from input to output, skipping the
setSeverityprocessing node.
cmd/consumers/zen/data/snmp_severity.json [20]
Suggestion importance[1-10]: 9
__
Why: This suggestion correctly identifies a logical bug in a new rule definition where a bypass edge (
e3) would cause thesetSeverityprocessing node to be skipped, defeating the purpose of the rule.Handle specific error for bucket creation
Refactor the error handling for
js.get_key_value. Instead of catching any error,specifically check for
StoreErrorKind::BucketNotFoundbefore attempting tocreate the key-value store, and propagate other errors.
cmd/consumers/zen/src/bin/put_rule.rs [89-99]
Suggestion importance[1-10]: 8
__
Why: The suggestion correctly points out that blanket error handling can mask underlying issues like network failures. Handling the specific
BucketNotFounderror makes the error handling more robust and prevents incorrect state transitions.Handle specific error for stream creation
Refactor the NATS stream creation logic. Specifically check for
jetstream.ErrStreamNotFoundbefore attempting to create a stream, and usejs.CreateStreaminstead ofjs.CreateOrUpdateStreamfor safer creation.pkg/natsutil/events.go [135-149]
[To ensure code accuracy, apply this suggestion manually]Suggestion importance[1-10]: 8
__
Why: The suggestion improves error handling by checking for a specific
ErrStreamNotFounderror instead of any error, which prevents masking other potential problems. It also correctly recommends usingCreateStreamoverCreateOrUpdateStreamfor safer, more explicit stream creation logic.