Updates/post tenant cleanup fixes #2682
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!2682
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "refs/pull/2682/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: #2321
Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2321
Original created: 2026-01-17T17:53:59Z
Original updated: 2026-01-17T19:54:59Z
Original head: carverauto/serviceradar:updates/post-tenant-cleanup-fixes
Original base: staging
Original merged: 2026-01-17T19:54:57Z 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
Enhancement, Bug fix
Description
Remove Go-based CNPG migrations; consolidate schema to Ash migration
Fix Oban tables created in wrong schema by removing explicit prefix
Add Oban schema to consolidated Ash migration for idempotent startup
Fix Horde supervisor naming conflict in ProcessRegistry
Make TLS client certificates optional in CNPG connections
Update Helm/Compose to use core-elx migrations instead of cnpg-migrate tool
Diagram Walkthrough
File Walkthrough
8 files
Remove prefix from Oban migrations and reorder gateways/partitionsGuard ProcessRegistry startup to prevent duplicate initializationRename supervisor to ProcessSupervisor to avoid naming conflictsRemove Go-based CNPG migrations and shouldRunDBMigrations functionMake TLS client certificates optional in CNPG connectionsFix TLS path normalization to handle empty paths correctlyMake NATS credentials optional when using mTLS authenticationRemove ecto.migrate from web-ng startup command4 files
Add platform schema prefix to Oban configurationAdd platform schema prefix to Oban configurationAdd platform schema prefix to Oban configurationEnable agent gateway and database migrations by default17 files
Update documentation comment for schema overrideUpdate error message from schema to database initializationReplace cnpg-migrate documentation with Ash migration instructionsUpdate OTEL metrics retention documentation to reference Ash migrationUpdate trigram index documentation to reference Ash migrationUpdate AGE graph schema documentation to reference Ash migrationUpdate SRQL schema references to point to Ash rebuild migrationReplace cnpg-migrate with mix ash.migrate in troubleshooting guideUpdate prerequisites to reference Ash migrations instead ofcnpg-migrateNew proposal document for fixing Helm deployment bootstrap issuesNew tasks document for Helm deployment bootstrap fixesNew specification for Helm deployment requirementsNew proposal for stabilizing Docker Compose stack startupNew design document for Docker Compose stack stabilizationNew tasks document for Docker Compose stack fixesNew specification for Docker Compose stack requirementsUpdate task status for schema isolation verification9 files
Replace cnpg-migrate with core-elx startup migrationsRemove cnpg-migrate service and update dependenciesMake CNPG client certs conditional and add NATS creds mountingMake CNPG client certificates conditional on configurationEnable database migrations by default in db-event-writerMake TLS client certificates conditional in db-event-writer configAdd conditional client certificate configuration for SPIREAdd default pg_hba rules for SSL without client certificatesNew job to create CNPG client CA secret from certificate data20 files
Imported GitHub PR comment.
Original author: @qodo-code-review[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/2321#issuecomment-3764160086
Original created: 2026-01-17T17:54:52Z
PR Compliance Guide 🔍
Below is a summary of compliance checks for this PR:
Unpinned container image
Description: The Job uses an unpinned image tag
bitnami/kubectl:latest, which can silently change overtime and introduces a supply-chain risk (unexpected image contents or compromised upstream
tag).
cnpg-client-ca-secret-job.yaml [24-24]
Referred Code
TLS client auth relaxation
Description: When
requireClientCertis false, the generatedpg_hbarules allowhostssl ...scram-sha-256withoutclientcert=verify-ca, which weakens database access controls frommutual TLS to password-only TLS and can enable unauthorized CNPG access if credentials are
obtained (this pattern is reinforced by making client cert env vars conditional in other
Helm templates).
spire-postgres.yaml [142-150]
Referred Code
🎫 No ticket provided
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: Comprehensive Audit Trails
Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.
Status:
Audit coverage unclear: The PR primarily changes database bootstrap/migrations behavior and does not show any
explicit audit logging additions, so it is not possible to verify from this diff whether
all critical actions are consistently logged with user context.
Referred Code
Generic: Secure Error Handling
Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.
Status:
Error exposure unknown: The diff adjusts TLS validation and connection URL building but does not show the call
sites that surface these errors, so it cannot be confirmed whether detailed internal
errors are only logged internally and not returned to end-users.
Referred Code
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:
Logging format unknown: The PR adds/updates operational log output and configuration, but the diff does not
provide enough evidence about structured logging or whether runtime logs could include
sensitive data.
Referred Code
Generic: Security-First Input Validation and Data Handling
Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities
Status:
TLS mode handling: Client certificate handling is made optional and CA enforcement is changed, but without
the full context of
sslmodederivation and config sources it requires verification thatall TLS modes and external config inputs are validated and enforced as intended.
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/2321#issuecomment-3764161377
Original created: 2026-01-17T17:56:34Z
PR Code Suggestions ✨
Explore these optional code suggestions:
Nil-guard TLS normalization
Add a
nilcheck for thetlsparameter at the beginning of thenormalizeTLSPathsfunction to prevent a potential panic.
pkg/config/config.go [568-571]
Suggestion importance[1-10]: 8
__
Why: The suggestion correctly identifies a potential nil pointer dereference, which would cause a panic, and provides a simple guard to prevent the crash, significantly improving the code's robustness.
Add a timeout to the wait loop
Add a timeout to the shell script's
whileloop to prevent it from runningindefinitely if the certificate file is not generated.
helm/serviceradar/templates/cnpg-client-ca-secret-job.yaml [27-41]
Suggestion importance[1-10]: 6
__
Why: The suggestion correctly identifies a potential infinite loop in the Kubernetes Job and proposes adding a timeout, which improves the script's robustness and makes failure detection faster and more explicit.
Fix a race condition in process startup
To prevent a race condition where multiple applications might start
ProcessRegistrysimultaneously, use a dedicated starter process to serialize thecheck and startup logic.
elixir/serviceradar_core/lib/serviceradar/application.ex [198-211]
Suggestion importance[1-10]: 7
__
Why: The suggestion correctly identifies a potential race condition in the process startup logic and proposes a more robust solution using a starter process, which would improve the system's reliability.
Restrict TLS setup to non-disabled SSL modes
In
buildCNPGConnURL, wrap the TLS configuration block in a condition to ensureit only runs when
sslModeis notdisable.pkg/db/cnpg_pool.go [125-143]
Suggestion importance[1-10]: 7
__
Why: The suggestion correctly points out that TLS file validation should not occur when SSL is disabled, and the proposed fix makes the connection logic more robust and flexible for different SSL modes.