initial #2586
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!2586
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "refs/pull/2586/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: #2162
Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2162
Original created: 2025-12-16T23:39:04Z
Original updated: 2025-12-16T23:53:23Z
Original head: carverauto/serviceradar:2151-poller-status-updates-overwrite-registration-metadata-with-defaults-upsert
Original base: staging
Original merged: 2025-12-16T23:53:16Z 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
Description
Prevent poller status updates from overwriting registration metadata with defaults
Modify UPSERT conflict clause to only update operational fields
Preserve registration identity/provenance across heartbeat updates
Add regression test to prevent metadata clobbering
Diagram Walkthrough
File Walkthrough
cnpg_registry.go
Restrict poller status UPSERT to operational fields onlypkg/db/cnpg_registry.go
clause
first_seen(with COALESCE),last_seen,is_healthy,updated_atcomponent_id,registration_source,status,spiffe_identity,metadata,created_by,agent_count,checker_count,first_registeredfrom being overwritten
cnpg_registry_test.go
Add regression test for metadata preservationpkg/db/cnpg_registry_test.go
TestUpsertPollerStatusSQL_PreservesRegistrationMetadatastringsimport for SQL normalizationproposal.md
Proposal document for metadata preservation fixopenspec/changes/fix-poller-status-metadata-clobber/proposal.md
with defaults
paths
design.md
Design document with context and decision rationaleopenspec/changes/fix-poller-status-metadata-clobber/design.md
pollersrow between registration and statuswrites
ownership boundaries
spec.md
Service registry spec for metadata preservationopenspec/changes/fix-poller-status-metadata-clobber/specs/service-registry/spec.md
first_seentimestamps are not cleared by status updatestasks.md
Implementation and validation task checklistopenspec/changes/fix-poller-status-metadata-clobber/tasks.md
audit
Imported GitHub PR comment.
Original author: @qodo-code-review[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/2162#issuecomment-3662903204
Original created: 2025-12-16T23:39:55Z
You are nearing your monthly Qodo Merge usage quota. For more information, please visit here.
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.🎫 #2151
ON CONFLICTupdate does not overwriteregistration metadata with defaults and only updates operational fields (e.g.,
last_seen,is_healthy,updated_at).FirstSeendo not clear/overwritefirst_seen/first_registered.component_id,registration_source,status,spiffe_identity,metadata,created_by,first_registered,first_seen) whenUpdatePollerStatusis called to update operational state.UpdatePollerStatuscall sites are intended to be operational-only andthat registration/upsert paths remain authoritative for registration metadata.
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: Security-First Input Validation and Data Handling
Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities
Status: Passed
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/2162#issuecomment-3662909521
Original created: 2025-12-16T23:40:53Z
You are nearing your monthly Qodo Merge usage quota. For more information, please visit here.
PR Code Suggestions ✨
Explore these optional code suggestions:
Improve test robustness against regressions
To make the test more robust, isolate the
UPDATEclause of the SQL query andassert that registration-related column names are not present, rather than
checking for an exact string match.
pkg/db/cnpg_registry_test.go [15-34]
Suggestion importance[1-10]: 6
__
Why: The suggestion correctly identifies a weakness in the new test and proposes a more robust implementation that better prevents future regressions, improving the overall quality of the test suite.