Feature/identity map step1 #2300
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!2300
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "refs/pull/2300/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: #1730
Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/1730
Original created: 2025-10-07T04:49:57Z
Original updated: 2025-10-10T05:30:03Z
Original head: carverauto/serviceradar:feature/identity-map-step1
Original base: main
Original merged: 2025-10-10T05:29:55Z by @mfreeman451
PR Type
Enhancement
Description
Add identity map system for canonical device lookups
Integrate KV client for identity publishing
Create protobuf definitions for identity mapping
Refactor device registry with identity publisher
Diagram Walkthrough
File Walkthrough
9 files
Extract KV client creation functionIntegrate identity map KV clientAdd identity KV closer fieldCore identity mapping functionalityDeterministic metadata hashing utilityKV-backed identity map publisherAdd identity publisher to registryGenerated protobuf code for identityIdentity map protobuf schema definition2 files
Test identity map key buildingTest identity publisher functionality4 files
Add identity map protobuf generationBazel build configuration for identitymapUpdate registry build dependenciesBazel build for identity protobufImported GitHub PR comment.
Original author: @qodo-code-review[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/1730#issuecomment-3375184607
Original created: 2025-10-07T04:50:34Z
PR Compliance Guide 🔍
Below is a summary of compliance checks for this PR:
Resource management risk
Description: The identity KV client closer set at initialization may remain non-nil if client creation
partially fails after adding registry options, potentially leading to a nil dereference or
unintended lifecycle coupling; verify closer validity across all branches.
server.go [102-110]
Referred Code
Supply-chain integrity
Description: Generated protobuf file includes an unsafe import and version comments; ensure protoc and
plugin versions are vetted and the file is not user-modified to avoid supply-chain risks.
identity_map.pb.go [1-297]
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/1730#issuecomment-3375186618
Original created: 2025-10-07T04:51:48Z
PR Code Suggestions ✨
Explore these optional code suggestions:
Clarify the long-term identity strategy
The PR adds a KV store-based identity map alongside the existing database-backed
identity logic. The suggestion is to clarify the design and long-term strategy
for these two parallel systems to avoid potential data inconsistencies.
Examples:
pkg/registry/registry.go [161-163]
pkg/registry/identity_publisher.go [76-147]
Solution Walkthrough:
Before:
After:
Suggestion importance[1-10]: 9
__
Why: This is a critical architectural suggestion that correctly identifies the introduction of a parallel identity system and raises valid concerns about data consistency and long-term design clarity, which is fundamental to the PR's goal.
Remove unnecessary slice copy loop
Remove the unnecessary byte slice copy when building the
PutManyRequest, as thegRPC marshaling process will handle copying the data, thus improving performance
by reducing allocations.
pkg/registry/identity_publisher.go [76-147]
Suggestion importance[1-10]: 5
__
Why: The suggestion correctly identifies a redundant memory allocation and copy, and removing it improves performance without changing behavior, as the gRPC marshaling process handles the data copying.