Skip to content

Conversation

@sg00dwin
Copy link
Member

Summary

Adds /find-component-pattern slash command for analyzing component usage consistency across the OpenShift Console codebase.

Features

  • Component Discovery: Locates component definition and all usages across frontend
  • Pattern Analysis: Groups usages by similarity (props, context, wrapper patterns)
  • Inconsistency Detection: Identifies missing required props, deprecated patterns, and outliers
  • Scope Filtering:
    • --scope=all - Search entire frontend (default)
    • --scope=core - Core components only
    • --scope=package:NAME - Specific package
  • Recommendations: Optional prioritized guidance for standardization (via --show-recommendations flag)

Use Cases

  • Code quality audits and consistency reviews
  • Identifying bugs (missing required props)
  • Planning refactoring efforts
  • Understanding component usage before API changes
  • Onboarding new team members to component patterns

  Adds a command to analyze component usage patterns across the codebase,
  identify inconsistencies, and detect potential bugs. The command searches
  for all usages of a specified component, groups them into patterns, flags
  outliers (missing props, deprecated usage), and provides prioritized
  recommendations for standardization. Supports scoping to core components,
  specific packages, or all frontend code.

Assisted-by Claude
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Oct 23, 2025
@openshift-ci-robot
Copy link
Contributor

@sg00dwin: This pull request explicitly references no jira issue.

In response to this:

Summary

Adds /find-component-pattern slash command for analyzing component usage consistency across the OpenShift Console codebase.

Features

  • Component Discovery: Locates component definition and all usages across frontend
  • Pattern Analysis: Groups usages by similarity (props, context, wrapper patterns)
  • Inconsistency Detection: Identifies missing required props, deprecated patterns, and outliers
  • Scope Filtering:
    • --scope=all - Search entire frontend (default)
    • --scope=core - Core components only
    • --scope=package:NAME - Specific package
  • Recommendations: Optional prioritized guidance for standardization (via --show-recommendations flag)

Use Cases

  • Code quality audits and consistency reviews
  • Identifying bugs (missing required props)
  • Planning refactoring efforts
  • Understanding component usage before API changes
  • Onboarding new team members to component patterns

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 openshift-ci bot requested review from jhadvig and spadgett October 23, 2025 22:26
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 23, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

The full list of commands accepted by this bot can be found here.

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

openshift-ci bot commented Oct 23, 2025

@sg00dwin: all tests passed!

Full PR test history. Your PR dashboard.

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.

Copy link
Member

@jhadvig jhadvig left a comment

Choose a reason for hiding this comment

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

Thanks @sg00dwin 🥇
Adding couple of comments. Happy to further discuss them.
Would be great if you could demo this cmd on scrum 👍

```
Which component would you like me analyze?

Use --scope=SCOPE to limit scope (optional):
Copy link
Member

Choose a reason for hiding this comment

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

Base on the examples at the end of the file this feel like is should be part of --help flag. Cause the user already specified the scope in the command, so rendering the usage, after the scope is defined does not sound as a correct flow.

```
Which component would you like me analyze?

Use --scope=SCOPE to limit scope (optional):
Copy link
Member

Choose a reason for hiding this comment

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

Here the scope is already define, so the user should just specify the component name, right ?

## Usage

```
/find-component-pattern [--show-recommendations] [--scope=SCOPE]
Copy link
Member

Choose a reason for hiding this comment

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

Ideally if all the params could be supplied when triggering the cmd

Suggested change
/find-component-pattern [--show-recommendations] [--scope=SCOPE]
/find-component-pattern [component-name] [--show-recommendations] [--scope=SCOPE]


Use --scope=SCOPE to limit scope (optional):
- all - Search entire frontend (default)
- core - Only core components (frontend/public/components/)
Copy link
Member

Choose a reason for hiding this comment

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

thinking if we want to be more granular for a large packages, cause there could be hundreds of hits for a common resource.
Just a thought ... I've seen the Performance Considerations 👍

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

Labels

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.

3 participants