refactor: telemetry request parameters#19722
Conversation
|
Images are ready for the commit at 117a534. To use with deploy scripts, first |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #19722 +/- ##
==========================================
+ Coverage 49.59% 49.61% +0.01%
==========================================
Files 2756 2760 +4
Lines 208036 208154 +118
==========================================
+ Hits 103183 103271 +88
- Misses 97192 97223 +31
+ Partials 7661 7660 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
2e708df to
27967f6
Compare
2aa5f95 to
5f7202d
Compare
|
/test ocp-4-21-operator-e2e-tests |
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe pull request refactors telemetry header handling from function-based callbacks to concrete types. Changes include introducing a Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
central/telemetry/centralclient/interceptors.go (1)
14-14: Header constant casing changed.The constant changed from
Rh-ServiceNow-IntegrationtoRh-Servicenow-Integration. Since HTTP header lookup is case-insensitive andhttp.Headercanonicalizes keys, this should work correctly for matching. However, if external systems expect the exact original casing in responses or logs, verify this change aligns with their expectations.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@central/telemetry/centralclient/interceptors.go` at line 14, The header constant snowIntegrationHeader in interceptors.go was altered from "Rh-ServiceNow-Integration" to "Rh-Servicenow-Integration"; revert the constant value back to "Rh-ServiceNow-Integration" (or confirm with integrators that the new casing is acceptable) so external systems expecting the original exact header casing in responses/logs are not broken; update the snowIntegrationHeader definition accordingly and run tests to ensure no callers or logs rely on the changed string.pkg/telemetry/phonehome/campaign_test.go (1)
140-140: Typo in variable name.
expecedHeadersshould beexpectedHeaders.Proposed fix
- expecedHeaders := Headers{ + expectedHeaders := Headers{Also update the reference on line 155.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@pkg/telemetry/phonehome/campaign_test.go` at line 140, Rename the misspelled test variable `expecedHeaders` to `expectedHeaders` (the variable is of type `Headers`) and update any references to it in the same test (e.g., the assertion or comparison that currently uses `expecedHeaders`) to use `expectedHeaders` instead so the identifier matches the correct spelling.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@central/telemetry/centralclient/interceptors.go`:
- Line 14: The header constant snowIntegrationHeader in interceptors.go was
altered from "Rh-ServiceNow-Integration" to "Rh-Servicenow-Integration"; revert
the constant value back to "Rh-ServiceNow-Integration" (or confirm with
integrators that the new casing is acceptable) so external systems expecting the
original exact header casing in responses/logs are not broken; update the
snowIntegrationHeader definition accordingly and run tests to ensure no callers
or logs rely on the changed string.
In `@pkg/telemetry/phonehome/campaign_test.go`:
- Line 140: Rename the misspelled test variable `expecedHeaders` to
`expectedHeaders` (the variable is of type `Headers`) and update any references
to it in the same test (e.g., the assertion or comparison that currently uses
`expecedHeaders`) to use `expectedHeaders` instead so the identifier matches the
correct spelling.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Central YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro
Run ID: b73b4739-be94-4858-b7b8-7ca6e167f4ac
📒 Files selected for processing (10)
central/telemetry/centralclient/interceptors.gocentral/telemetry/centralclient/interceptors_test.gopkg/telemetry/phonehome/campaign.gopkg/telemetry/phonehome/campaign_test.gopkg/telemetry/phonehome/headers_multimap.gopkg/telemetry/phonehome/headers_multimap_test.gopkg/telemetry/phonehome/interceptor.gopkg/telemetry/phonehome/interceptor_test.gopkg/telemetry/phonehome/request_params.gopkg/telemetry/phonehome/request_params_test.go
|
Note Docstrings generation - SUCCESS |
Docstrings generation was requested by @parametalol. * #19722 (comment) The following files were modified: * `central/telemetry/centralclient/interceptors.go` * `pkg/telemetry/phonehome/campaign.go` * `pkg/telemetry/phonehome/headers_multimap.go` * `pkg/telemetry/phonehome/interceptor.go`
Docstrings generation was requested by @parametalol. * #19722 (comment) The following files were modified: * `central/telemetry/centralclient/interceptors.go` * `pkg/telemetry/phonehome/campaign.go` * `pkg/telemetry/phonehome/headers_multimap.go` * `pkg/telemetry/phonehome/interceptor.go`
Description
This is a prefactoring that simplifies implementation of matching requests by header name glob pattern.
In addition, gRPC metadata is now converted to http.Header type with canonicalized keys to support protocol-independent matching.
User-facing documentation
Testing and quality
Automated testing
How I validated my change
CI
Current dependencies on/for this PR: