Skip to content

[release-4.20] OCPBUGS-82012: Fix VolumeSnapshot and VolumeSnapshotContent tables sorting#16261

Open
stefanonardo wants to merge 1 commit intoopenshift:release-4.20from
stefanonardo:OCPBUGS-82012
Open

[release-4.20] OCPBUGS-82012: Fix VolumeSnapshot and VolumeSnapshotContent tables sorting#16261
stefanonardo wants to merge 1 commit intoopenshift:release-4.20from
stefanonardo:OCPBUGS-82012

Conversation

@stefanonardo
Copy link
Copy Markdown
Contributor

Summary

Cherry-pick of #16216.

  • Fixed Status, Size, and Source column sorting in VolumeSnapshot table
  • Fixed Status and Size column sorting in VolumeSnapshotContent table
  • Corrected TypeScript types to distinguish string vs number restoreSize values
  • Refactored volumeSnapshotStatus to shared location and renamed to snapshotStatus

Problem

The Status, Size, and Source columns in the VolumeSnapshot table and Status and Size columns in VolumeSnapshotContent table were not sorting correctly. The columns referenced non-existent sort field names (like 'volumeSnapshotSize') instead of using function wrappers with the sorts registry.

Additionally, TypeScript types incorrectly defined restoreSize as a number for both VolumeSnapshot and VolumeSnapshotContent, when in reality VolumeSnapshot uses Kubernetes quantity strings (e.g., "1Gi") and VolumeSnapshotContent uses integer bytes.

Changes

Sorting fix:

  • Updated sort columns to use inline wrapper functions: (data, direction) => data.sort(sortResourceByValue(direction, sorts.functionName))
  • Added volumeSnapshotStatus, volumeSnapshotSize, volumeSnapshotContentSize, and volumeSnapshotSource to the sorts registry in table.tsx
  • Fixed TypeScript types to correctly represent VolumeSnapshot.status.restoreSize as string and VolumeSnapshotContent.status.restoreSize as number
  • Added snapshotContentSize() utility function to handle VolumeSnapshotContent size sorting
  • Removed dead code from useConsoleDataViewData.tsx (redundant string sort check that was never reached)

Refactoring:

  • Moved volumeSnapshotStatus from @console/app/src/status to @console/shared/src/sorts/snapshot
  • Renamed to snapshotStatus for consistency with other snapshot utilities (snapshotSize, snapshotSource, snapshotContentSize)
  • Updated all imports across 9 files to use the new shared location
  • Maintained backwards compatibility by re-exporting from old location

Test plan

  • Navigate to Storage → VolumeSnapshots in the OpenShift console
  • Create test snapshots with different sizes and statuses
  • Click Status column header and verify snapshots sort alphabetically by status
  • Click Size column header and verify snapshots sort numerically by size (ascending/descending)
  • Click Source column header and verify snapshots sort alphabetically by source PVC name
  • Navigate to VolumeSnapshotContents tab and verify Status and Size sorting works

🤖 Generated with Claude Code

@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 Apr 7, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@stefanonardo: This pull request references Jira Issue OCPBUGS-81308, which is invalid:

  • expected the bug to target either version "4.20." or "openshift-4.20.", but it targets "4.21.z" instead
  • expected the bug to be in one of the following states: NEW, ASSIGNED, POST, but it is ON_QA instead
  • expected dependent Jira Issue OCPBUGS-62700 to target a version in 4.21.0, 4.21.z, but it targets "4.22.0" instead

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:

Summary

Cherry-pick of #16216.

  • Fixed Status, Size, and Source column sorting in VolumeSnapshot table
  • Fixed Status and Size column sorting in VolumeSnapshotContent table
  • Corrected TypeScript types to distinguish string vs number restoreSize values
  • Refactored volumeSnapshotStatus to shared location and renamed to snapshotStatus

Problem

The Status, Size, and Source columns in the VolumeSnapshot table and Status and Size columns in VolumeSnapshotContent table were not sorting correctly. The columns referenced non-existent sort field names (like 'volumeSnapshotSize') instead of using function wrappers with the sorts registry.

Additionally, TypeScript types incorrectly defined restoreSize as a number for both VolumeSnapshot and VolumeSnapshotContent, when in reality VolumeSnapshot uses Kubernetes quantity strings (e.g., "1Gi") and VolumeSnapshotContent uses integer bytes.

Changes

Sorting fix:

  • Updated sort columns to use inline wrapper functions: (data, direction) => data.sort(sortResourceByValue(direction, sorts.functionName))
  • Added volumeSnapshotStatus, volumeSnapshotSize, volumeSnapshotContentSize, and volumeSnapshotSource to the sorts registry in table.tsx
  • Fixed TypeScript types to correctly represent VolumeSnapshot.status.restoreSize as string and VolumeSnapshotContent.status.restoreSize as number
  • Added snapshotContentSize() utility function to handle VolumeSnapshotContent size sorting
  • Removed dead code from useConsoleDataViewData.tsx (redundant string sort check that was never reached)

Refactoring:

  • Moved volumeSnapshotStatus from @console/app/src/status to @console/shared/src/sorts/snapshot
  • Renamed to snapshotStatus for consistency with other snapshot utilities (snapshotSize, snapshotSource, snapshotContentSize)
  • Updated all imports across 9 files to use the new shared location
  • Maintained backwards compatibility by re-exporting from old location

Test plan

  • Navigate to Storage → VolumeSnapshots in the OpenShift console
  • Create test snapshots with different sizes and statuses
  • Click Status column header and verify snapshots sort alphabetically by status
  • Click Size column header and verify snapshots sort numerically by size (ascending/descending)
  • Click Source column header and verify snapshots sort alphabetically by source PVC name
  • Navigate to VolumeSnapshotContents tab and verify Status and Size sorting works

🤖 Generated with Claude Code

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

coderabbitai bot commented Apr 7, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: aa1c5052-ea77-4e3f-8cff-268c64cd0162

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

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

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

@openshift-ci openshift-ci bot requested review from jhadvig and spadgett April 7, 2026 08:39
@openshift-ci openshift-ci bot added component/core Related to console core functionality component/dashboard Related to dashboard component/shared Related to console-shared labels Apr 7, 2026
@stefanonardo stefanonardo changed the title [release-4.20] OCPBUGS-81308: Fix VolumeSnapshot and VolumeSnapshotContent tables sorting [release-4.20] OCPBUGS-82012: Fix VolumeSnapshot and VolumeSnapshotContent tables sorting Apr 7, 2026
@stefanonardo
Copy link
Copy Markdown
Contributor Author

/jira refresh

@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@stefanonardo: This pull request references Jira Issue OCPBUGS-82012, which is invalid:

  • expected dependent Jira Issue OCPBUGS-81308 to be in one of the following states: VERIFIED, RELEASE PENDING, CLOSED (ERRATA), CLOSED (CURRENT RELEASE), CLOSED (DONE), CLOSED (DONE-ERRATA), but it is ON_QA instead

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:

Summary

Cherry-pick of #16216.

  • Fixed Status, Size, and Source column sorting in VolumeSnapshot table
  • Fixed Status and Size column sorting in VolumeSnapshotContent table
  • Corrected TypeScript types to distinguish string vs number restoreSize values
  • Refactored volumeSnapshotStatus to shared location and renamed to snapshotStatus

Problem

The Status, Size, and Source columns in the VolumeSnapshot table and Status and Size columns in VolumeSnapshotContent table were not sorting correctly. The columns referenced non-existent sort field names (like 'volumeSnapshotSize') instead of using function wrappers with the sorts registry.

Additionally, TypeScript types incorrectly defined restoreSize as a number for both VolumeSnapshot and VolumeSnapshotContent, when in reality VolumeSnapshot uses Kubernetes quantity strings (e.g., "1Gi") and VolumeSnapshotContent uses integer bytes.

Changes

Sorting fix:

  • Updated sort columns to use inline wrapper functions: (data, direction) => data.sort(sortResourceByValue(direction, sorts.functionName))
  • Added volumeSnapshotStatus, volumeSnapshotSize, volumeSnapshotContentSize, and volumeSnapshotSource to the sorts registry in table.tsx
  • Fixed TypeScript types to correctly represent VolumeSnapshot.status.restoreSize as string and VolumeSnapshotContent.status.restoreSize as number
  • Added snapshotContentSize() utility function to handle VolumeSnapshotContent size sorting
  • Removed dead code from useConsoleDataViewData.tsx (redundant string sort check that was never reached)

Refactoring:

  • Moved volumeSnapshotStatus from @console/app/src/status to @console/shared/src/sorts/snapshot
  • Renamed to snapshotStatus for consistency with other snapshot utilities (snapshotSize, snapshotSource, snapshotContentSize)
  • Updated all imports across 9 files to use the new shared location
  • Maintained backwards compatibility by re-exporting from old location

Test plan

  • Navigate to Storage → VolumeSnapshots in the OpenShift console
  • Create test snapshots with different sizes and statuses
  • Click Status column header and verify snapshots sort alphabetically by status
  • Click Size column header and verify snapshots sort numerically by size (ascending/descending)
  • Click Source column header and verify snapshots sort alphabetically by source PVC name
  • Navigate to VolumeSnapshotContents tab and verify Status and Size sorting works

🤖 Generated with Claude Code

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
Copy Markdown
Contributor

@stefanonardo: This pull request references Jira Issue OCPBUGS-82012, which is invalid:

  • expected dependent Jira Issue OCPBUGS-81308 to be in one of the following states: VERIFIED, RELEASE PENDING, CLOSED (ERRATA), CLOSED (CURRENT RELEASE), CLOSED (DONE), CLOSED (DONE-ERRATA), but it is ON_QA instead

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.

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.

@stefanonardo
Copy link
Copy Markdown
Contributor Author

/assign @cajieh

@cajieh
Copy link
Copy Markdown
Contributor

cajieh commented Apr 7, 2026

/lgtm
/label backport-risk-assessed

@openshift-ci openshift-ci bot added the backport-risk-assessed Indicates a PR to a release branch has been evaluated and considered safe to accept. label Apr 7, 2026
@cajieh
Copy link
Copy Markdown
Contributor

cajieh commented Apr 7, 2026

/retest

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

openshift-ci bot commented Apr 7, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cajieh, stefanonardo

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 Apr 7, 2026
The Status, Size, and Source columns in the VolumeSnapshot table and
Status and Size columns in VolumeSnapshotContent table were not sorting
correctly because they referenced non-existent sort field names instead
of using the sorts registry.
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Apr 7, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 7, 2026

New changes are detected. LGTM label has been removed.

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 7, 2026

@stefanonardo: 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/frontend be45cea link true /test frontend
ci/prow/e2e-gcp-console be45cea link true /test e2e-gcp-console

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. backport-risk-assessed Indicates a PR to a release branch has been evaluated and considered safe to accept. component/core Related to console core functionality component/dashboard Related to dashboard component/shared Related to console-shared jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants