Skip to content

frontend: crd: Fix Served column displaying storage value#6095

Open
mahesh-09-12 wants to merge 1 commit into
kubernetes-sigs:mainfrom
mahesh-09-12:frontend/crd-served-column-regression
Open

frontend: crd: Fix Served column displaying storage value#6095
mahesh-09-12 wants to merge 1 commit into
kubernetes-sigs:mainfrom
mahesh-09-12:frontend/crd-served-column-regression

Conversation

@mahesh-09-12

Copy link
Copy Markdown
Contributor

Summary

This PR fixes an issue in the CRD Details Versions table where the Served column displayed the storage value instead of the served value.

It also adds regression coverage to ensure the Served and Storage columns remain independent and updates the Storybook fixture to expose this scenario.

Related Issue

Fixes #6094

Changes

  • Fixed the Served column to use version.served
  • Added regression coverage for CRD versions with distinct served and storage values
  • Updated the Storybook fixture to use different values for served and storage
  • Updated the affected Storybook snapshot

Steps to Test

  1. Run the test suite:

    npm test
  2. Open the CRD Details story in Storybook.

  3. Navigate to the Versions section.

  4. Verify that:

    • Served displays true
    • Storage displays false
      when the underlying version data has served: true and storage: false.

Screenshots (if applicable)

N/A

Notes for the Reviewer

  • The previous Storybook fixture used identical values for served and storage, which masked the issue.
  • The added regression coverage ensures the Served column cannot accidentally fall back to the Storage field in future changes.

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jun 19, 2026
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: mahesh-09-12
Once this PR has been reviewed and has the lgtm label, please assign joaquimrocha for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes the CRD Details “Versions” table so the Served column correctly reflects version.served (instead of incorrectly showing version.storage). It also updates Storybook fixtures/snapshots and adds a regression test to prevent this mismatch from reappearing.

Changes:

  • Update the “Served” column getter to use version.served.
  • Adjust the CRD Storybook mock data to include differing served/storage values and update the corresponding snapshot.
  • Add a Vitest regression test verifying Served/Storage remain independent.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
frontend/src/components/crd/storyHelper.ts Updates mock CRD version data to expose served vs storage differences.
frontend/src/components/crd/Details.tsx Fixes the Served column getter to use version.served.
frontend/src/components/crd/Details.test.tsx Adds regression coverage for Served/Storage column mapping.
frontend/src/components/crd/snapshots/CustomResourceDefinition.Details.stories.storyshot Updates snapshot output to match corrected Served display.

Comment thread frontend/src/components/crd/Details.test.tsx

@illume illume left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the contribution.

There are some open Copilot review comments — could you take a look at them? Please mark each one as resolved once you've addressed it.

The Versions table used the storage field for both the Served and
Storage columns, causing the Served value to be displayed incorrectly
when served and storage differ.

Update the Served column to use the correct field and add regression
coverage for CRD versions with distinct served and storage values.

Signed-off-by: mahesh-09-12 <m8143177@gmail.com>
@mahesh-09-12 mahesh-09-12 force-pushed the frontend/crd-served-column-regression branch from 6f6440b to b17420d Compare June 19, 2026 17:12
@mahesh-09-12

Copy link
Copy Markdown
Contributor Author

@illume addressed the Copilot feedback, ready for another review when convenient.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

frontend: CRD Details Versions table displays storage value in Served column

4 participants