OCPBUGS-76556: fix Developer Sandbox telemetry#16020
OCPBUGS-76556: fix Developer Sandbox telemetry#16020MatousJobanek wants to merge 2 commits intoopenshift:mainfrom
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.
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.
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.
|
@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. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: MatousJobanek, spadgett The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@MatousJobanek: This pull request references Jira Issue OCPBUGS-76556, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
Instructions 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 openshift-eng/jira-lifecycle-plugin repository. |
|
/label public-api-approved |
|
@spadgett: The label(s) DetailsIn response to this:
Instructions 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. |
|
/label plugin-api-approved |
|
/jira refresh |
|
@spadgett: This pull request references Jira Issue OCPBUGS-76556, which is valid. The bug has been moved to the POST state. 3 validation(s) were run on this bug
Requesting review from QA contact: DetailsIn response to this:
Instructions 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 openshift-eng/jira-lifecycle-plugin repository. |
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