-
Notifications
You must be signed in to change notification settings - Fork 670
fix Developer Sandbox telemetry #16020
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
fix Developer Sandbox telemetry #16020
Conversation
Assisted-by: Cursor
📝 WalkthroughWalkthroughAdds two telemetry fields to Window.telemetry: DEVSANDBOX_SEGMENT_API_KEY (string) and DEVSANDBOX ('true' | 'false'). Updates Segment analytics key selection to prefer DEVSANDBOX_SEGMENT_API_KEY only when telemetry.DEVSANDBOX === 'true'; otherwise continues using existing SEGMENT_API_KEY fallbacks. Modifies useTelemetry cluster type derivation to set clusterType to 'DEVSANDBOX' whenever telemetry.DEVSANDBOX === 'true', independent of CLUSTER_TYPE. Adjusts unit tests to reflect the new precedence and outcomes for DevSandbox scenarios. No exported/public API signatures changed beyond the added telemetry fields on Window. 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. 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 |
spadgett
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall. One small comment.
| it('returns DEVSANDBOX when DEVSANDBOX is "true" regardless of CLUSTER_TYPE', () => { | ||
| window.SERVER_FLAGS = { | ||
| ...originServerFlags, | ||
| telemetry: { CLUSTER_TYPE: 'OSD', DEVSANDBOX: 'true' }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest changing the mock data to ROSA if that's what we're actually using (here and in some of the other tests below). That way we know the actual expected values work. We have the a_FUTURE_DEVSANDBOX_KEY to test the case where it's set to something else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, done in 25f426c
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: MatousJobanek The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
@MatousJobanek: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
This PR is fixing this issue: https://issues.redhat.com/browse/OCPBUGS-76556
Context
The special DevSandbox telemetry is not being properly used in the Developer Sandbox clusters. This is caused by two things:
Developer Sandbox clusters were migrated from OSD to ROSA, thus the current if statement
console/frontend/packages/console-shared/src/hooks/useTelemetry.ts
Line 44 in a00af1a
console/frontend/packages/console-telemetry-plugin/src/listeners/segment.ts
Lines 68 to 74 in a00af1a
The priority of loading the telemetry keys has been changed so the
DEVSANDBOX_SEGMENT_API_KEYis loaded as the last one - see:console/frontend/packages/console-dynamic-plugin-sdk/src/api/segment-analytics.ts
Lines 4 to 7 in aa30da3
However, since the managed ROSA clusters already come with the
SEGMENT_API_KEYset (set by SD team and we cannot do anything with it), then theDEVSANDBOX_SEGMENT_API_KEYis never used.The priority of the keys was changed in this commit 56139d0
Changes
This PR does the following:
telemetry.console.openshift.io/DEVSANDBOX: trueshould be sufficientDEVSANDBOX: truethen it uses theDEVSANDBOX_SEGMENT_API_KEY(if set)Assisted-by: Cursor
Summary by CodeRabbit
Chores
Tests