Skip to content

CONSOLE-4987: Conditionally render Guided Tour based on capability and disable it for Console E2E tests#15926

Open
krishagarwal278 wants to merge 1 commit intoopenshift:mainfrom
krishagarwal278:CONSOLE-4987
Open

CONSOLE-4987: Conditionally render Guided Tour based on capability and disable it for Console E2E tests#15926
krishagarwal278 wants to merge 1 commit intoopenshift:mainfrom
krishagarwal278:CONSOLE-4987

Conversation

@krishagarwal278
Copy link
Member

@krishagarwal278 krishagarwal278 commented Jan 19, 2026

Summary by CodeRabbit

  • New Features
    • Guided Tour is now governed by a server-side capability flag; visibility can be centrally enabled/disabled.
    • Default behavior remains enabled unless the server explicitly sets the Guided Tour to "Disabled".
    • Extension manifests and startup logic now recognize and require the Guided Tour capability flag for consistent behavior.

✏️ Tip: You can customize this high-level summary in your review settings.

@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Jan 19, 2026

@krishagarwal278: This pull request references CONSOLE-4987 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set.

Details

In 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.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jan 19, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 19, 2026

📝 Walkthrough

Walkthrough

Adds a new capability feature flag, CONSOLE_CAPABILITY_GUIDEDTOUR_IS_ENABLED: declared in FLAGS, referenced in guided-tour extension manifests, initialized from server capabilities during app startup (defaults enabled unless explicitly disabled), and included in feature-flag test expectations.

Changes

Cohort / File(s) Summary
Feature flag definition
frontend/packages/console-shared/src/constants/common.ts
Added enum member CONSOLE_CAPABILITY_GUIDEDTOUR_IS_ENABLED to exported FLAGS enum.
Console extension manifests
frontend/packages/console-app/console-extensions.json, frontend/packages/dev-console/console-extensions.json
Added CONSOLE_CAPABILITY_GUIDEDTOUR_IS_ENABLED to flags.required for guided-tour extension entries.
Application initialization
frontend/public/components/app.tsx
Read GuidedTourFeature from window.SERVER_FLAGS.capabilities and dispatch/set CONSOLE_CAPABILITY_GUIDEDTOUR_IS_ENABLED (defaults to enabled unless Disabled).
Feature flag tests
frontend/public/reducers/__tests__/features.spec.tsx
Updated default feature flags expectation to include CONSOLE_CAPABILITY_GUIDEDTOUR_IS_ENABLED: undefined.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title clearly describes the main change: adding conditional rendering of Guided Tour based on a capability flag and disabling it for E2E tests, which aligns with all file changes across the codebase.

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

✨ Finishing touches
  • 📝 Generate docstrings

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

@openshift-ci openshift-ci bot requested review from rhamilto and sg00dwin January 19, 2026 09:13
@openshift-ci openshift-ci bot added component/core Related to console core functionality component/dev-console Related to dev-console component/shared Related to console-shared labels Jan 19, 2026
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Jan 19, 2026

@krishagarwal278: This pull request references CONSOLE-4987 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set.

Details

In response to this:

Summary by CodeRabbit

  • New Features
  • Guided tour feature is now controlled through a server-side capability flag, enabling centralized management and visibility control across environments.

✏️ Tip: You can customize this high-level summary in your review 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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
frontend/public/components/app.tsx (1)

169-196: Backend capability name GuidedTourFeature is not defined in the OpenShift API and will never be emitted.

The code searches for a capability named GuidedTourFeature, but the OpenShift API enum (vendor/github.com/openshift/api/operator/v1/types_console.go) only defines LightspeedButton and GettingStartedBanner as valid ConsoleCapabilityName values. The kubebuilder validation enforces this enum restriction, meaning:

  • The backend will never emit a capability named GuidedTourFeature
  • guidedTourCapability will always be undefined
  • The logic guidedTourCapability?.visibility?.state !== 'Disabled' will always evaluate to true
  • The flag CONSOLE_CAPABILITY_GUIDEDTOUR_IS_ENABLED will always be enabled, regardless of intent

Add GuidedTourFeature to the ConsoleCapabilityName enum in the OpenShift API types, update the kubebuilder validation enum constraint, and ensure the backend handles emitting this capability.

@krishagarwal278 krishagarwal278 changed the title CONSOLE-4987: Conditionally render Guided Tour based on capability and disable it for Console E2E tests [WIP] CONSOLE-4987: Conditionally render Guided Tour based on capability and disable it for Console E2E tests Jan 19, 2026
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 19, 2026
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Jan 19, 2026

@krishagarwal278: This pull request references CONSOLE-4987 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set.

Details

In response to this:

Summary by CodeRabbit

  • New Features
  • Guided Tour is now governed by a server-side capability flag; visibility can be centrally enabled/disabled.
  • Default behavior remains enabled unless the server explicitly sets the Guided Tour to "Disabled".
  • Extension manifests and startup logic now recognize and require the Guided Tour capability flag for consistent behavior.

✏️ Tip: You can customize this high-level summary in your review 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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
frontend/public/components/app.tsx (1)

175-196: Backend API sync required: 'GuidedTourFeature' capability not registered.

The backend API definition (vendor/github.com/openshift/api/operator/v1/types_console.go:138) only registers "LightspeedButton" and "GettingStartedBanner" as valid capabilities. The frontend is searching for "GuidedTourFeature" (line 176), which doesn't exist in the API spec and will never be returned by the server.

The condition guidedTourCapability?.visibility?.state !== 'Disabled' evaluates to true when guidedTourCapability is undefined, accidentally enabling the tour for backwards compatibility. However, this bypasses API validation and will break if the backend enforces the capability enum.

The API types must be updated to include "GuidedTourFeature" in the ConsoleCapabilityName enum (line 138 of vendor/github.com/openshift/api/operator/v1/types_console.go), or this frontend code needs to be reverted.

@krishagarwal278
Copy link
Member Author

/retest

@krishagarwal278 krishagarwal278 force-pushed the CONSOLE-4987 branch 3 times, most recently from ff9fa0b to 9feb299 Compare January 19, 2026 12:00
@openshift-ci openshift-ci bot added the component/backend Related to backend label Jan 20, 2026
@krishagarwal278 krishagarwal278 changed the title [WIP] CONSOLE-4987: Conditionally render Guided Tour based on capability and disable it for Console E2E tests CONSOLE-4987: Conditionally render Guided Tour based on capability and disable it for Console E2E tests Jan 20, 2026
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 20, 2026
@krishagarwal278
Copy link
Member Author

/retest

@yanpzhan
Copy link
Contributor

Checked on cluster launched against the pr, the GuidedTour capability is set as Enabled by default in console operator, there is Guided Tour when login console. Set GuidedTour capability as Disabled in console operator. Login console again, there is not Guided Tour.
The feature works as expected.
/verified by yanpzhan

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Jan 21, 2026
@openshift-ci-robot
Copy link
Contributor

@yanpzhan: This PR has been marked as verified by yanpzhan.

Details

In response to this:

Checked on cluster launched against the pr, the GuidedTour capability is set as Enabled by default in console operator, there is Guided Tour when login console. Set GuidedTour capability as Disabled in console operator. Login console again, there is not Guided Tour.
The feature works as expected.
/verified by yanpzhan

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.

Copy link
Member

@logonoff logonoff 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 Jan 21, 2026
@krishagarwal278
Copy link
Member Author

/assign @jhadvig

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 2, 2026

@krishagarwal278: GitHub didn't allow me to assign the following users: jseseCCS.

Note that only openshift members with read permissions, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time.
For more information please see the contributor guide

Details

In response to this:

px-approval:
/assign @sferich888

docs approval:
/assign @jseseCCS

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.

@jseseCCS
Copy link

jseseCCS commented Feb 2, 2026

one minor suggestion in 1 file. otherwise, LGTM!

@jseseCCS
Copy link

jseseCCS commented Feb 2, 2026

/label docs-approved

dispatch(
setFlag(
FLAGS.CONSOLE_CAPABILITY_GUIDEDTOUR_IS_ENABLED,
// Default to enabled if capability is not explicitly set (backwards compatibility)
Copy link

Choose a reason for hiding this comment

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

Minor: change “backwards compatibility” → “backward compatibility” for style consistency?

Copy link
Member

Choose a reason for hiding this comment

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

no sure why the comment is needed ?

@openshift-ci openshift-ci bot added the docs-approved Signifies that Docs has signed off on this PR label Feb 2, 2026
setFlag(
FLAGS.CONSOLE_CAPABILITY_GUIDEDTOUR_IS_ENABLED,
// Default to enabled if capability is not explicitly set (backwards compatibility)
guidedTourCapability?.visibility?.state !== 'Disabled',
Copy link
Member

Choose a reason for hiding this comment

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

Lets follow the pattern from above

guidedTourCapability?.visibility?.state === 'Enabled',

dispatch(
setFlag(
FLAGS.CONSOLE_CAPABILITY_GUIDEDTOUR_IS_ENABLED,
// Default to enabled if capability is not explicitly set (backwards compatibility)
Copy link
Member

Choose a reason for hiding this comment

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

no sure why the comment is needed ?

@openshift-ci-robot openshift-ci-robot removed the verified Signifies that the PR passed pre-merge verification criteria label Feb 2, 2026
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Feb 2, 2026
…ndencies to vendor openshift/api with gudiedTour capability
@rh-joshbeverly
Copy link

/label px-approved

@openshift-ci openshift-ci bot added the px-approved Signifies that Product Support has signed off on this PR label Feb 2, 2026
@krishagarwal278
Copy link
Member Author

/retest

Copy link
Member

@jhadvig jhadvig left a comment

Choose a reason for hiding this comment

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

Thanks @krishagarwal278 for the update.
The code looks good but I dont see the code responsible for conditionally rendering the GuiderdTour component based on the flag.
Also we need to check if all the e2e tests (besides GuidedTour test itself) set the flag to disabled.

@krishagarwal278
Copy link
Member Author

Hi @jhadvig, thanks for the review!

The conditional rendering is currently handled at the extension manifest level via "required": ["CONSOLE_CAPABILITY_GUIDEDTOUR_IS_ENABLED"] in both console-extensions.json files. QE (@yanpzhan) verified this works as expected.
For e2e tests, GuidedTour is disabled via "disallowed": ["INTEGRATION_TEST"] in the extension manifest.
Shall I add an explicit flag check around <GuidedTour /> if that would make the code clearer? Let me know your preference!

@jhadvig
Copy link
Member

jhadvig commented Feb 3, 2026

ok, nice. I see that in the GuidedTour component. In that case we should be fine

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Feb 3, 2026
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 3, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jhadvig, jseseCCS, krishagarwal278, logonoff

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 3, 2026
@yanpzhan
Copy link
Contributor

yanpzhan commented Feb 4, 2026

/verified by yanpzhan

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Feb 4, 2026
@openshift-ci-robot
Copy link
Contributor

@yanpzhan: This PR has been marked as verified by yanpzhan.

Details

In response to this:

/verified by yanpzhan

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-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD 1a68f54 and 2 for PR HEAD 9774f79 in total

@krishagarwal278
Copy link
Member Author

/retest

1 similar comment
@krishagarwal278
Copy link
Member Author

/retest

@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD d101674 and 1 for PR HEAD 9774f79 in total

@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD 61387af and 0 for PR HEAD 9774f79 in total

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 5, 2026

@krishagarwal278: 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.

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/backend Related to backend component/core Related to console core functionality component/dev-console Related to dev-console component/shared Related to console-shared docs-approved Signifies that Docs has signed off on this PR 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. px-approved Signifies that Product Support has signed off on this PR verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants