Skip to content

OCPBUGS-76556: fix Developer Sandbox telemetry#16020

Open
MatousJobanek wants to merge 2 commits intoopenshift:mainfrom
MatousJobanek:fix-devsandbox-telemetry
Open

OCPBUGS-76556: fix Developer Sandbox telemetry#16020
MatousJobanek wants to merge 2 commits intoopenshift:mainfrom
MatousJobanek:fix-devsandbox-telemetry

Conversation

@MatousJobanek
Copy link

@MatousJobanek MatousJobanek commented Feb 11, 2026

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:

  1. Developer Sandbox clusters were migrated from OSD to ROSA, thus the current if statement

    window.SERVER_FLAGS.telemetry?.CLUSTER_TYPE === 'OSD' &&
    is not applicable anymore. As a result, the cluster type is not marked as DEVSANDBOX, which means that any other DevSandbox-specific logic is not applied:
    // anonymize user ID if cluster is not a DEVSANDBOX cluster
    if (getClusterProperties().clusterType === 'DEVSANDBOX') {
    processedUserId =
    userResource?.metadata?.annotations?.['toolchain.dev.openshift.com/sso-user-id'];
    } else {
    processedUserId = await anonymizeId(userId);
    }

  2. The priority of loading the telemetry keys has been changed so the DEVSANDBOX_SEGMENT_API_KEY is loaded as the last one - see:

    const TELEMETRY_API_KEY =
    window.SERVER_FLAGS.telemetry?.SEGMENT_API_KEY ||
    window.SERVER_FLAGS.telemetry?.SEGMENT_PUBLIC_API_KEY ||
    window.SERVER_FLAGS.telemetry?.DEVSANDBOX_SEGMENT_API_KEY ||

    However, since the managed ROSA clusters already come with the SEGMENT_API_KEY set (set by SD team and we cannot do anything with it), then the DEVSANDBOX_SEGMENT_API_KEY is never used.
    The priority of the keys was changed in this commit 56139d0

Changes

This PR does the following:

  • drops the condition relying on specific cluster type - having telemetry.console.openshift.io/DEVSANDBOX: true should be sufficient
  • changes the priority of loading the telemetry api key so when DEVSANDBOX: true then it uses the DEVSANDBOX_SEGMENT_API_KEY (if set)

Assisted-by: Cursor

Summary by CodeRabbit

  • Chores

    • Improved telemetry configuration for DevSandbox environments: when DevSandbox mode is enabled, the DevSandbox-specific analytics key is used and cluster type is reported as DEVSANDBOX, ensuring consistent environment identification.
    • Extended telemetry settings to recognize DevSandbox-specific flags.
  • Tests

    • Updated telemetry tests to validate DevSandbox precedence, confirming cluster type is DEVSANDBOX when enabled regardless of other cluster settings.

Assisted-by: Cursor
@openshift-ci openshift-ci bot requested review from rhamilto and spadgett February 11, 2026 15:21
@openshift-ci openshift-ci bot added component/sdk Related to console-plugin-sdk component/shared Related to console-shared plugin-api-changed Categorizes a PR as containing plugin API changes labels Feb 11, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 11, 2026

📝 Walkthrough

Walkthrough

Adds 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)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly references the bug fix (OCPBUGS-76556) and clearly identifies the main change: fixing Developer Sandbox telemetry behavior.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Member

@spadgett spadgett left a 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' },
Copy link
Member

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.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, done in 25f426c

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 12, 2026

@MatousJobanek: all tests passed!

Full PR test history. Your PR dashboard.

Details

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. I understand the commands that are listed here.

Copy link
Member

@spadgett spadgett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Feb 13, 2026
@spadgett spadgett changed the title fix Developer Sandbox telemetry OCPBUGS-76556: fix Developer Sandbox telemetry Feb 13, 2026
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 13, 2026

[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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 13, 2026
@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Feb 13, 2026
@openshift-ci-robot
Copy link
Contributor

@MatousJobanek: This pull request references Jira Issue OCPBUGS-76556, which is invalid:

  • expected the bug to target the "4.22.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

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:

  1. Developer Sandbox clusters were migrated from OSD to ROSA, thus the current if statement

    window.SERVER_FLAGS.telemetry?.CLUSTER_TYPE === 'OSD' &&
    is not applicable anymore. As a result, the cluster type is not marked as DEVSANDBOX, which means that any other DevSandbox-specific logic is not applied:
    // anonymize user ID if cluster is not a DEVSANDBOX cluster
    if (getClusterProperties().clusterType === 'DEVSANDBOX') {
    processedUserId =
    userResource?.metadata?.annotations?.['toolchain.dev.openshift.com/sso-user-id'];
    } else {
    processedUserId = await anonymizeId(userId);
    }

  2. The priority of loading the telemetry keys has been changed so the DEVSANDBOX_SEGMENT_API_KEY is loaded as the last one - see:

    const TELEMETRY_API_KEY =
    window.SERVER_FLAGS.telemetry?.SEGMENT_API_KEY ||
    window.SERVER_FLAGS.telemetry?.SEGMENT_PUBLIC_API_KEY ||
    window.SERVER_FLAGS.telemetry?.DEVSANDBOX_SEGMENT_API_KEY ||

    However, since the managed ROSA clusters already come with the SEGMENT_API_KEY set (set by SD team and we cannot do anything with it), then the DEVSANDBOX_SEGMENT_API_KEY is never used.
    The priority of the keys was changed in this commit 56139d0

Changes

This PR does the following:

  • drops the condition relying on specific cluster type - having telemetry.console.openshift.io/DEVSANDBOX: true should be sufficient
  • changes the priority of loading the telemetry api key so when DEVSANDBOX: true then it uses the DEVSANDBOX_SEGMENT_API_KEY (if set)

Assisted-by: Cursor

Summary by CodeRabbit

  • Chores

  • Improved telemetry configuration for DevSandbox environments: when DevSandbox mode is enabled, the DevSandbox-specific analytics key is used and cluster type is reported as DEVSANDBOX, ensuring consistent environment identification.

  • Extended telemetry settings to recognize DevSandbox-specific flags.

  • Tests

  • Updated telemetry tests to validate DevSandbox precedence, confirming cluster type is DEVSANDBOX when enabled regardless of other cluster settings.

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.

@spadgett
Copy link
Member

/label public-api-approved

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 13, 2026

@spadgett: The label(s) /label public-api-approved cannot be applied. These labels are supported: acknowledge-critical-fixes-only, platform/aws, platform/azure, platform/baremetal, platform/google, platform/libvirt, platform/openstack, ga, tide/merge-method-merge, tide/merge-method-rebase, tide/merge-method-squash, px-approved, docs-approved, qe-approved, ux-approved, no-qe, downstream-change-needed, rebase/manual, cluster-config-api-changed, run-integration-tests, approved, backport-risk-assessed, bugzilla/valid-bug, cherry-pick-approved, jira/valid-bug, ok-to-test, plugin-api-approved, plugin-api-changed, stability-fix-approved, staff-eng-approved. Is this label configured under labels -> additional_labels or labels -> restricted_labels in plugin.yaml?

Details

In response to this:

/label public-api-approved

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.

@spadgett
Copy link
Member

/label plugin-api-approved

@openshift-ci openshift-ci bot added the plugin-api-approved Indicates a PR with plugin API changes has been approved by an API reviewer label Feb 13, 2026
@spadgett
Copy link
Member

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Feb 13, 2026
@openshift-ci-robot
Copy link
Contributor

@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
  • bug is open, matching expected state (open)
  • bug target version (4.22.0) matches configured target version for branch (4.22.0)
  • bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @yapei

Details

In response to this:

/jira refresh

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.

@openshift-ci openshift-ci bot requested a review from yapei February 13, 2026 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. component/sdk Related to console-plugin-sdk component/shared Related to console-shared jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. plugin-api-approved Indicates a PR with plugin API changes has been approved by an API reviewer plugin-api-changed Categorizes a PR as containing plugin API changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants