Skip to content

CONSOLE-5271: Gate lifecycle metadata on server-side OLM lifecycle flag#16668

Open
perdasilva wants to merge 2 commits into
openshift:mainfrom
perdasilva:CONSOLE-5271-featuregate-lifecycle-metadata
Open

CONSOLE-5271: Gate lifecycle metadata on server-side OLM lifecycle flag#16668
perdasilva wants to merge 2 commits into
openshift:mainfrom
perdasilva:CONSOLE-5271-featuregate-lifecycle-metadata

Conversation

@perdasilva

@perdasilva perdasilva commented Jun 23, 2026

Copy link
Copy Markdown

Analysis / Root cause:
The operator lifecycle metadata UI (cluster compatibility and support phase columns on the Installed Operators page) was gated on the console's --tech-preview server flag (window.SERVER_FLAGS.techPreview). This couples the feature to the console's tech-preview mode rather than the cluster-level FeatureGate that controls the OLM lifecycle service itself. The frontend cannot read the FeatureGate resource directly because not all users have RBAC for it, so the gating must be done server-side via the console-operator.

Solution description:

  • Add --olm-lifecycle bridge flag and OLMLifecycleEnabled config field to ClusterInfo
  • Thread olmLifecycle through SERVER_FLAGS to the frontend via jsGlobals
  • Simplify detectLifecycleMetadata to read window.SERVER_FLAGS.olmLifecycle instead of techPreview
  • Remove FeatureGateModel (no longer needed — gating is handled server-side)
  • Add backend config test for the new flag

Screenshots / screen recording:

Test setup:
Requires the companion console-operator PR (openshift/console-operator#1174) to set olmLifecycleEnabled based on the OLMLifecycleAndCompatibility cluster FeatureGate.

Test cases:

  • Verify lifecycle columns (Cluster compatibility, Support phase) appear when --olm-lifecycle is set to true
  • Verify lifecycle columns are hidden when the flag is false, even if --tech-preview is set
  • Verify no regressions on the Installed Operators list page

Browser conformance:

  • Chrome
  • Firefox
  • Safari (or Epiphany on Linux)

Additional info:
Companion PR: openshift/console-operator#1174 (sets olmLifecycleEnabled in the ConsoleConfig based on the cluster FeatureGate).
Depends on #16655 and #16551.

Reviewers and assignees:
/assign @perdasilva

Summary by CodeRabbit

  • New Features
    • Added a new --olm-lifecycle-metadata configuration flag (default false) to control whether Operator Lifecycle Manager lifecycle metadata is exposed to the frontend.
    • You can now enable this setting at the cluster level via olmLifecycleMetadataEnabled, which maps to the new --olm-lifecycle-metadata flag.
    • Updated frontend configuration and detection logic so the UI receives the corresponding olmLifecycleMetadata value.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jun 23, 2026
@openshift-ci-robot

openshift-ci-robot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

@perdasilva: This pull request references CONSOLE-5271 which is a valid jira issue.

Details

In response to this:

Analysis / Root cause:
The operator lifecycle metadata UI (cluster compatibility and support phase columns on the Installed Operators page) was gated on the console's --tech-preview server flag (window.SERVER_FLAGS.techPreview). This couples the feature to the console's tech-preview mode rather than the cluster-level FeatureGate that controls the OLM lifecycle service itself.

Solution description:

  • Add FeatureGateModel (config.openshift.io/v1) to the frontend model registry
  • Convert detectLifecycleMetadata (synchronous console.flag handler) to useDetectLifecycleMetadata (console.flag/hookProvider) that watches the singleton FeatureGate cluster resource via useK8sGet and checks status.featureGates[].enabled[] for the OLMLifecycleAndCompatibility gate
  • Update console-extensions.json to register the new hook provider
  • No changes to the lifecycle UI components themselves — the OPERATOR_LIFECYCLE_METADATA flag name is unchanged, only how it is determined

Screenshots / screen recording:

Test setup:
Requires a cluster with the OLMLifecycleAndCompatibility FeatureGate enabled. The lifecycle columns should appear on the Installed Operators page when the gate is enabled and be hidden when it is not, regardless of whether the console runs in tech-preview mode.

Test cases:

  • Verify lifecycle columns (Cluster compatibility, Support phase) appear when OLMLifecycleAndCompatibility is in FeatureGate/cluster status.featureGates[].enabled
  • Verify lifecycle columns are hidden when the gate is not enabled, even if --tech-preview is set
  • Verify graceful fallback (flag set to false) when FeatureGate resource cannot be read (e.g. RBAC)
  • Verify no regressions on the Installed Operators list page

Browser conformance:

  • Chrome
  • Firefox
  • Safari (or Epiphany on Linux)

Additional info:
Depends on #16655 and #16551.

Reviewers and assignees:
/assign @perdasilva

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.

@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: c805bdf4-54b1-4a35-8f46-fc0a8b93ecff

📥 Commits

Reviewing files that changed from the base of the PR and between 5b0213f and 21eab53.

📒 Files selected for processing (7)
  • cmd/bridge/main.go
  • frontend/@types/console/window.d.ts
  • frontend/packages/operator-lifecycle-manager/src/features.ts
  • pkg/server/server.go
  • pkg/serverconfig/config.go
  • pkg/serverconfig/config_test.go
  • pkg/serverconfig/types.go
✅ Files skipped from review due to trivial changes (2)
  • pkg/serverconfig/config.go
  • frontend/@types/console/window.d.ts
🚧 Files skipped from review as they are similar to previous changes (5)
  • frontend/packages/operator-lifecycle-manager/src/features.ts
  • pkg/serverconfig/config_test.go
  • pkg/serverconfig/types.go
  • cmd/bridge/main.go
  • pkg/server/server.go

Walkthrough

Adds a new olmLifecycleMetadata flag path from server config through Server globals to frontend feature detection. ClusterInfo and addClusterInfo map the config to the flag, main passes it into Server, and the frontend now reads window.SERVER_FLAGS.olmLifecycleMetadata.

Changes

OLM Lifecycle Metadata Flag Pipeline

Layer / File(s) Summary
Config shape and flag mapping
pkg/serverconfig/types.go, pkg/serverconfig/config.go
ClusterInfo gains OLMLifecycleMetadataEnabled, and addClusterInfo maps it to olm-lifecycle-metadata when enabled.
Bridge and server wiring
cmd/bridge/main.go, pkg/server/server.go
main registers --olm-lifecycle-metadata and passes it into server.Server; Server, jsGlobals, and indexHandler carry the value into frontend template data.
Frontend type and detection
frontend/@types/console/window.d.ts, frontend/packages/operator-lifecycle-manager/src/features.ts
SERVER_FLAGS.telemetry gains olmLifecycleMetadata: boolean, and OLM lifecycle metadata detection reads that field instead of techPreview.
Config flag test
pkg/serverconfig/config_test.go
TestSetFlagsFromConfig adds coverage for OLMLifecycleMetadataEnabled and registers the olm-lifecycle-metadata flag in the test flag set.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • spadgett
  • fsgreco
🚥 Pre-merge checks | ✅ 14 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (14 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately describes the main change: moving lifecycle metadata gating to a server-side OLM flag.
Description check ✅ Passed The description covers the required sections and provides a clear root cause, solution, testing plan, and related context.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed The only added test cases use static table names in t.Run; no Ginkgo titles or dynamic values appear in changed tests.
Test Structure And Quality ✅ Passed No Ginkgo tests were changed; the new table-driven unit test is single-purpose and matches existing repo test patterns.
Microshift Test Compatibility ✅ Passed No new Ginkgo/e2e tests were added; the only test change is a Go unit test in pkg/serverconfig/config_test.go with no MicroShift-sensitive APIs.
Single Node Openshift (Sno) Test Compatibility ✅ Passed No new Ginkgo/e2e tests were added; the only test change is a standard Go unit test, and I found no SNO/HA assumptions in the touched files.
Topology-Aware Scheduling Compatibility ✅ Passed PASS: The PR only threads a boolean feature flag through config/server/frontend; it adds no deployments, affinities, nodeSelectors, tolerations, replicas, or PDBs.
Ote Binary Stdout Contract ✅ Passed PASS: The PR only adds a boolean flag and threads it through config/server globals; no new stdout writes or suite/init setup were introduced.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed Only a Go unit test and flag plumbing were added; no new Ginkgo e2e tests, IPv4-only parsing, or external connectivity found.
No-Weak-Crypto ✅ Passed Changed code only wires an OLM lifecycle feature flag; no weak crypto or secret-comparison logic appears in the touched hunks.
Container-Privileges ✅ Passed The PR only changes frontend/backend flag wiring and types; no container/K8s manifests were touched, and no privileged/host* or allowPrivilegeEscalation settings appear in the changed files.
No-Sensitive-Data-In-Logs ✅ Passed No new logging or sensitive-data output paths were added; the changes only thread a boolean flag through config, globals, and tests.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@openshift-ci openshift-ci Bot requested review from TheRealJon and fsgreco June 23, 2026 14:15
@openshift-ci openshift-ci Bot added component/backend Related to backend component/core Related to console core functionality component/olm Related to OLM kind/i18n Indicates issue or PR relates to internationalization or has content that needs to be translated labels Jun 23, 2026
@perdasilva perdasilva force-pushed the CONSOLE-5271-featuregate-lifecycle-metadata branch from 23500fb to 553fdaa Compare June 23, 2026 14:16
Replace the frontend FeatureGate CRD watch with a server-side flag so
that operator lifecycle metadata columns (cluster compatibility, support
phase) on the Installed Operators page are controlled by the console
operator configuration rather than requiring frontend RBAC to read the
FeatureGate resource.

- Add --olm-lifecycle bridge flag and OLMLifecycleEnabled config field
- Pass olmLifecycle through SERVER_FLAGS to the frontend
- Simplify detectLifecycleMetadata to read the server flag directly
- Remove FeatureGateModel (no longer needed in frontend)
- Add backend config test for the new flag

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@perdasilva perdasilva changed the title CONSOLE-5271: Gate lifecycle metadata on OLMLifecycleAndCompatibility FeatureGate CONSOLE-5271: Gate lifecycle metadata on server-side OLM lifecycle flag Jun 23, 2026
@perdasilva perdasilva force-pushed the CONSOLE-5271-featuregate-lifecycle-metadata branch from 553fdaa to 6c9e8a3 Compare June 23, 2026 14:48

@TheRealJon TheRealJon left a comment

Copy link
Copy Markdown
Member

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 Jun 23, 2026
@openshift-ci

openshift-ci Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: perdasilva, TheRealJon

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 Jun 23, 2026
Rename all occurrences of the OLM lifecycle config field, CLI flag, and
SERVER_FLAGS property to include "Metadata" for consistency with the
feature name (operator lifecycle metadata).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Per G. da Silva <pegoncal@redhat.com>
@perdasilva perdasilva force-pushed the CONSOLE-5271-featuregate-lifecycle-metadata branch from 5b0213f to 21eab53 Compare June 24, 2026 09:06
@openshift-ci openshift-ci Bot removed the lgtm Indicates that a PR is ready to be merged. label Jun 24, 2026
@openshift-ci

openshift-ci Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

New changes are detected. LGTM label has been removed.

@openshift-ci

openshift-ci Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

@perdasilva: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/images 21eab53 link true /test images
ci/prow/e2e-gcp-console 21eab53 link true /test e2e-gcp-console
ci/prow/e2e-playwright 21eab53 link false /test e2e-playwright
ci/prow/backend 21eab53 link true /test backend

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/olm Related to OLM jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. kind/i18n Indicates issue or PR relates to internationalization or has content that needs to be translated

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants