kyverno: add Storybook stories for CELPolicyViewer#846
Open
Suhani95 wants to merge 1 commit into
Open
Conversation
Signed-off-by: Suhani <suhani4630@gmail.com>
Author
|
@illume could you please take a look when you have a chance? Thanks! |
illume
requested changes
Jun 24, 2026
illume
left a comment
Contributor
There was a problem hiding this comment.
Thanks for this PR.
A few of the commits don't quite follow the project guidelines. We use Linux kernel style for git commits — have a look at the contributing guide and previous commits with git log.
Commits that need attention
kyverno: add Storybook stories for CELPolicyViewer— Description must start with a capital letter — e.g.frontend: HomeButton: Fix the buttonnotfrontend: HomeButton: fix the button.
Commit guidelines
- Use atomic commits focused on a single change.
- Use the title format
<area>: <Description of changes>— description must start with a capital letter. - Keep the title under 72 characters (soft requirement).
- Explain the intention and why the change is needed.
- Make commit titles meaningful and describe what changed.
- Do not add code that a later commit rewrites; squash or reorder commits instead.
- Do not include
Fixes #NNin commit messages.
Good examples:
frontend: HomeButton: Fix so it navigates to homebackend: config: Add enable-dynamic-clusters flag
Contributor
There was a problem hiding this comment.
Pull request overview
Adds Storybook stories for the Kyverno CELPolicyViewer component so each CEL policy type can be rendered and reviewed in isolation using static fixtures (no live cluster required).
Changes:
- Added
CELPolicyViewer.stories.tsxwith stories for Validating, Mutating, Generating, and Deleting policies. - Introduced representative fixture objects to exercise viewer sections (match constraints, variables, validations, mutations, generators, conditions).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+39
to
+46
| const podResourceRules = [ | ||
| { | ||
| apiGroups: [''], | ||
| apiVersions: ['v1'], | ||
| operations: ['CREATE', 'UPDATE'], | ||
| resources: ['pods'], | ||
| }, | ||
| ]; |
Comment on lines
+60
to
+65
| variables: [ | ||
| { | ||
| name: 'containers', | ||
| expression: 'object.spec.containers', | ||
| }, | ||
| ], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds Storybook coverage for the Kyverno
CELPolicyViewercomponent.This PR introduces stories for all supported CEL policy types:
The stories use representative policy fixtures to exercise the different sections rendered by the viewer without requiring a live cluster.
Related Issue
Fixes #845
Changes
src/components/CELPolicyViewer.stories.tsxSteps to Test
npm run format npm run lint-fix npm run lint npm run tsc npm run test npm run storybook-buildNotes for the Reviewer
CELPolicyViewer.