Vendor/k8s ocaml #2299
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!2299
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "refs/pull/2299/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: #1728
Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/1728
Original created: 2025-10-07T02:53:47Z
Original updated: 2025-10-07T03:30:43Z
Original head: carverauto/serviceradar:vendor/k8s_ocaml
Original base: main
Original merged: 2025-10-07T03:30:38Z by @mfreeman451
PR Type
Enhancement, Bug fix
Description
Add device identity canonicalization to prevent duplicate device IDs
Implement backfill CLI for historical data migration
Optimize logging to reduce noise and improve performance
Add BuildBuddy chart and OCaml stdlib vendoring
Diagram Walkthrough
File Walkthrough
9 files
Add backfill CLI flags and execution logicAdd record size limits and truncation logicOptimize sweep processing loggingReplace verbose service logging with summariesReduce debug logging noise in service processingImplement batch processing for discovered interfacesChange alternate IP storage to exact-match keysImplement device identity canonicalization systemChange device target scanning to primary IP only4 files
Fix JSON decoder and alternate IP metadata handlingFix logging field name consistencyRemove details field from service status queriesRemove alternate IP lookup from device queries5 files
Add mock expectations for canonicalization queriesAdd canonicalization query mocks to testsAdd canonicalization query mocks to registry testsAdd canonicalization query mocks to retraction testsUpdate tests for primary IP only scanning4 files
Add comments for legacy message columnAdd KV-backed canonical identity map implementation planDocument device identity canonicalization and backfillAdd OCaml stdlib vendoring documentation1 files
Add BuildBuddy Helm chart configurationImported GitHub PR comment.
Original author: @qodo-code-review[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/1728#issuecomment-3374979757
Original created: 2025-10-07T02:55:00Z
PR Compliance Guide 🔍
Below is a summary of compliance checks for this PR:
Identity resolution change
Description: Relaxing IP lookup to exclude alternate IP metadata may break existing identity resolution
paths and allow stale or orphaned device records to be missed, potentially affecting
authorization or visibility; verify that removing metadata-based IP matching is
intentional and won’t cause data exposure through mis-association.
unified_devices.go [241-248]
Referred Code
Unsafe JSON escaping
Description: Manual string escaping in JSON summary (
escapeForJSON) risks malformed JSON or injectionif edge cases are missed; safer to build an object and marshal via json.Marshal instead of
hand-escaping.
flush.go [289-316]
Referred Code
Secret in config
Description: BuildBuddy executor config includes an empty api_key field which, if populated insecurely
via values, could expose credentials in plain text; ensure secrets are sourced from
Kubernetes Secrets and not committed in values.yaml.
values.yaml [53-60]
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/1728#issuecomment-3374981473
Original created: 2025-10-07T02:56:26Z
PR Code Suggestions ✨
Explore these optional code suggestions:
Use standard JSON marshaling for safety
Replace the custom
escapeForJSONfunction with the standardjson.Marshaltoensure the generated preview string is always a valid JSON literal.
pkg/core/flush.go [289-316]
Suggestion importance[1-10]: 6
__
Why: The suggestion correctly identifies that manual JSON escaping is error-prone and proposes using the standard library's
json.Marshalfor a more robust and correct implementation.