Skip to content

fix: enable Topology Rollouts when ClusterVersion is unreadable - #332

Open
aali309 wants to merge 4 commits into
redhat-developer:mainfrom
aali309:GITOPS-topology-flag-clusterversion
Open

aali309 wants to merge 4 commits into
redhat-developer:mainfrom
aali309:GITOPS-topology-flag-clusterversion

Conversation

@aali309

@aali309 aali309 commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

Signed-off-by: Atif Ali <atali@redhat.com>
@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • New Features
    • GitOps topology is enabled on OpenShift 4.19 and later.
  • Bug Fixes
    • GitOps topology is no longer enabled when the OpenShift version is missing or invalid.
    • OpenShift version detection can fall back to the server release version when a watched cluster version is unavailable.

Flag detection now resolves the OpenShift version from the watched value or, in a browser, the server release version. It uses the resolved version to determine whether GitOps topology is enabled.

Changes: GitOps topology flag

Layer / File(s) Summary
Version resolution and enablement rule
src/plugin/utils/flags/shouldEnableGitOpsTopology.ts, src/plugin/utils/flags/shouldEnableGitOpsTopology.test.ts, src/plugin/utils/flags/index.ts
Added helpers to resolve the OpenShift version and determine whether to enable topology. Tests cover version precedence, server fallback, the unknown placeholder, unavailable or invalid versions, and versions below or at and above the threshold. The flags index re-exports both helpers.
Flag detection integration
src/plugin/utils/flags/detectOpenShiftVersion.tsx
Flag detection resolves the version from the watched value and, when window exists, SERVER_FLAGS.releaseVersion. It uses the enablement helper to set the flag.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: keithchong

Merge Risk: Minimal · up to 14c2d

This change lets GitOps topology be enabled when the cluster version cannot be read, by falling back to the server release version. No concrete merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: Topology Rollouts is enabled when the ClusterVersion cannot be read. The raw summary shows the change adds a fallback to the server release version and a shouldEnableG…
Description check Passed The description only links the GITOPS-12070 Jira ticket. The link relates to the changeset because the ticket tracks the same Topology Rollouts fix, so the check passes under the lenient criteria. The…
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.
Full details: Title check

Explanation

The title names the main change: Topology Rollouts is enabled when the ClusterVersion cannot be read. The raw summary shows the change adds a fallback to the server release version and a shouldEnableGitOpsTopology check in detectOpenShiftVersion, which matches the title.

Full details: Description check

Explanation

The description only links the GITOPS-12070 Jira ticket. The link relates to the changeset because the ticket tracks the same Topology Rollouts fix, so the check passes under the lenient criteria. The description gives no detail about the change.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 215e49b5-ab92-42ae-b6c5-3ba31d4d4906
Commits

Reviewing files that changed from the base of the PR and between 276f817 and 14c2ded.

Files selected for processing: 2

  • src/plugin/utils/flags/shouldEnableGitOpsTopology.test.ts
  • src/plugin/utils/flags/shouldEnableGitOpsTopology.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@codecov-commenter

codecov-commenter commented Nov 17, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 69.56522% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 15.53%. Comparing base (3bd1dab) to head (14c2ded).
⚠️ Report is 112 commits behind head on main.

Files with missing lines Patch % Lines
src/plugin/utils/flags/detectOpenShiftVersion.tsx 0.00% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #332      +/-   ##
==========================================
+ Coverage   11.30%   15.53%   +4.23%     
==========================================
  Files         169      234      +65     
  Lines        6679     8516    +1837     
  Branches     2235     2811     +576     
==========================================
+ Hits          755     1323     +568     
- Misses       5923     7191    +1268     
- Partials        1        2       +1     
Flag Coverage Δ
unit-tests 15.53% <69.56%> (+4.23%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Signed-off-by: Atif Ali <atali@redhat.com>
@aali309
aali309 marked this pull request as ready for review November 17, 2026 21:34
Signed-off-by: Atif Ali <atali@redhat.com>
try {
return new SemVer(openshiftVersion).compare('4.18.99999999') >= 0;
} catch {
return true;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

If there is an exception/error, we should not enable the topology view?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Good call — updated. We disable Topology when the version is missing or SemVer throws.

/** Enable Topology for OCP >= 4.19; fail open when version is unknown (namespace users often cannot read ClusterVersion). */
export const shouldEnableGitOpsTopology = (openshiftVersion?: string | null): boolean => {
if (!openshiftVersion) {
return true;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

If there is no openshift version or it's undefined, then we should disable the topology view?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Thanks, updated to return false when the version is missing/undefined.

Signed-off-by: Atif Ali <atali@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants