Add AI skill that checks for any unused exports#1818
Add AI skill that checks for any unused exports#1818kyoto wants to merge 1 commit intoopenshift:mainfrom
Conversation
Also removes the unnecessary exports that it found
|
[APPROVALNOTIFIER] This PR is APPROVED Approval requirements bypassed by manually added approval. This pull-request has been approved by: The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
1 similar comment
|
[APPROVALNOTIFIER] This PR is APPROVED Approval requirements bypassed by manually added approval. This pull-request has been approved by: The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
📝 WalkthroughWalkthroughThis PR removes unused exports from the codebase by making five exported types and constants file-scoped: Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
/cherry-pick release-4.19 |
|
@kyoto: once the present PR merges, I will cherry-pick it on top of DetailsIn response to this:
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. |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.cursor/skills/unused-exports/SKILL.md (1)
23-31: Broaden module-path resolution to avoid false positives.The current wording implies
exposedModulesalways maps tosrc/<path>.ts; this can miss*.tsxorindex.ts(x)entry points.Proposed doc tweak
-Read `package.json` field `consolePlugin.exposedModules`. Each value is a module -path relative to `src/` (e.g. `"./flags"` → `src/flags.ts`). These modules are +Read `package.json` field `consolePlugin.exposedModules`. Each value is a module +path relative to `src/` (e.g. `"./flags"` may resolve to `src/flags.ts`, +`src/flags.tsx`, `src/flags/index.ts`, or `src/flags/index.tsx`). These modules are loaded at runtime by the OpenShift console framework — their exports are used externally even though nothing inside this repo imports them.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.cursor/skills/unused-exports/SKILL.md around lines 23 - 31, The docs assume consolePlugin.exposedModules always maps to src/<path>.ts which causes false negatives for .tsx or index files; update the module-path resolution guidance to, when mapping each exposedModules entry to a file, try resolving the exact path as given and fall back to src/<path>.ts, src/<path>.tsx, src/<path>/index.ts, and src/<path>/index.tsx (and accept explicit extensions), and when parsing console-extensions.json $codeRef values map the ModuleName back using that broadened resolution so export references (ModuleName or ModuleName.exportName) correctly identify entry points.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.cursor/skills/unused-exports/SKILL.md:
- Around line 23-31: The docs assume consolePlugin.exposedModules always maps to
src/<path>.ts which causes false negatives for .tsx or index files; update the
module-path resolution guidance to, when mapping each exposedModules entry to a
file, try resolving the exact path as given and fall back to src/<path>.ts,
src/<path>.tsx, src/<path>/index.ts, and src/<path>/index.tsx (and accept
explicit extensions), and when parsing console-extensions.json $codeRef values
map the ModuleName back using that broadened resolution so export references
(ModuleName or ModuleName.exportName) correctly identify entry points.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 15cf0746-3497-466b-95e3-ceb5f7f323ea
📒 Files selected for processing (6)
.cursor/skills/unused-exports/SKILL.mdsrc/error.tssrc/flags.tssrc/hooks/useOpenOLS.tssrc/redux-reducers.tssrc/types.ts
Also removes the unnecessary exports that it found
Summary by CodeRabbit
Release Notes
Documentation
Refactor