linted/fixing tests #2236
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!2236
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "refs/pull/2236/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: #1656
Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/1656
Original created: 2025-09-23T17:09:09Z
Original updated: 2025-09-23T17:29:33Z
Original head: carverauto/serviceradar:updates/cicd_tests_failing
Original base: main
Original merged: 2025-09-23T17:29:29Z by @mfreeman451
PR Type
Tests, Enhancement
Description
Refactored test constants and function signatures
Applied code formatting and import organization
Fixed linting issues across multiple languages
Improved code consistency and readability
Diagram Walkthrough
File Walkthrough
2 files
Extract test constant and update function callsFormat test code and fix spacing18 files
Organize imports and format code structureFormat code and fix line spacingOrganize imports and improve code formattingReorder imports and fix formattingReorder imports and format function callsFormat code structure and improve readabilityFormat test code and fix spacingExtract constant and improve code structureOrganize imports and format codeOrganize imports and format async codeReorder imports and format function signaturesOrganize imports and format HTTP handlersFormat trait definitions and function signaturesFormat error handling and path operationsOrganize imports and fix formattingOrganize imports and format example codeOrganize module imports and format main functionFormat configuration parsing and conditionals24 files
Imported GitHub PR comment.
Original author: @qodo-code-review[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/1656#issuecomment-3324886647
Original created: 2025-09-23T17:10:03Z
PR Reviewer Guide 🔍
Here are some key observations to aid the review process:
Test Helper Consistency
The new helper
expectKVBootstraphardcodestestKVNamespaceand changes the previous signature that accepted a key. Verify all call sites and related tests still cover non-default namespaces and that no tests implicitly relied on passing different keys.Watch Stream Error Handling
watch_applyspawns a task consuming the stream but discards errors from the spawned task and the stream; consider surfacing/logging stream errors and handling backoff/reconnect to avoid silent failures.Attribute Parsing Robustness
When extracting attributes for HTTP/gRPC, only StringValue is captured; numeric status codes are stringified if present as strings. Validate behavior when attributes are numeric (e.g., http.status_code as IntValue) to avoid missing metrics fields.
Imported GitHub PR comment.
Original author: @qodo-code-review[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/1656#issuecomment-3324891756
Original created: 2025-09-23T17:11:16Z
PR Code Suggestions ✨
Explore these optional code suggestions:
Use correct scheme based on TLS configuration
In
create_channel, determine the connection scheme (httporhttps) based on theTLS configuration instead of unconditionally defaulting to
https://. Thisensures connections to non-TLS endpoints are possible.
cmd/poller-ng/src/adapter.rs [108-112]
[To ensure code accuracy, apply this suggestion manually]Suggestion importance[1-10]: 9
__
Why: This suggestion correctly identifies a critical bug that would prevent connections to non-TLS endpoints by incorrectly forcing
https://. The fix is essential for the poller to function in mixed or non-TLS environments.Fix incorrect scheme for agent health checks
In
ensure_agent_health, remove the hardcodedhttp://scheme and pass the rawagent_addrtocreate_channel. This allowscreate_channelto correctly infer theprotocol scheme based on the security configuration.
cmd/poller-ng/src/adapter.rs [451-473]
[To ensure code accuracy, apply this suggestion manually]Suggestion importance[1-10]: 9
__
Why: This suggestion correctly identifies a critical bug where hardcoding the
http://scheme for health checks breaks TLS-enabled agents. The proposed fix is crucial for ensuring health checks work correctly in all security configurations.Handle process spawn failure during restart
Handle the error from
cmd.spawn()when restarting the process on a configurationupdate. Only exit the current process if the new process spawns successfully to
prevent an outage.
cmd/flowgger/src/main.rs [56-58]
Suggestion importance[1-10]: 8
__
Why: The suggestion correctly identifies a critical reliability issue where a failed process restart would cause an outage, and the proposed fix makes the auto-restart mechanism more robust.
Handle non-string span attribute types
Expand span attribute extraction to handle non-string types like integers,
booleans, and doubles by converting them to strings, preventing loss of metric
data.
cmd/otel/src/lib.rs [208-214]
Suggestion importance[1-10]: 7
__
Why: The suggestion correctly points out that only string attributes are handled, leading to loss of valuable metric data. The proposed change improves metric completeness, but the use of
Box::leakis not ideal and may introduce memory leaks.