Skip to content

Remove unused/dead code from cli - #52

Closed
mohit-nagaraj wants to merge 1 commit into
mainfrom
cursor/remove-dead-code-ae5a
Closed

mohit-nagaraj wants to merge 1 commit into
mainfrom
cursor/remove-dead-code-ae5a

Conversation

@mohit-nagaraj

Copy link
Copy Markdown
Member

Summary

Removes unused and dead code from the KubeOrch CLI codebase. All items were verified as truly unused before deletion.

What was deleted

Code deletions

  • cmd/config.go: removeProjectConfig() function (marked nolint:unused, never called)
  • tests/mocks/exec_mock.go: entire file (never imported anywhere)
  • test/docker-install-test.sh: broken test script (not in CI, references wrong npm scope @kubeorch/cli vs @kubeorchestra/cli)
  • npm/index.js: module export file (exported binPath never imported; bin entry in package.json is sufficient)
  • npm/scripts/prepack.js: no-op prepack script (just logs messages, does no actual work)
  • tests/helpers/test_helpers.go: CaptureOutput() function (never called)
  • tests/unit/utils_test.go: TestValidateDockerCompose() and TestJoinArgs() (placeholder tests with mock assertions only)

Package.json updates

  • Removed prepack script reference
  • Removed main field (CLI-only package, only needs bin entry)
  • Removed unused io import from test helpers

What was skipped

  • cmd/testing.go: testDefaultUIRepo and testDefaultCoreRepo constants — still used as NoOptDefVal for flag defaults (lines 64-65)

Verification

go build ./... passes
go test ./cmd/... passes (all cmd package tests green)

Impact

Pure subtraction — smaller surface area, no functional changes.

Open in Web Open in Cursor 

Deleted:
- cmd/config.go: removeProjectConfig() (marked nolint:unused, never called)
- tests/mocks/exec_mock.go (never imported)
- test/docker-install-test.sh (not in CI, has wrong npm scope)
- npm/index.js (exported binPath never imported, bin entry sufficient)
- npm/scripts/prepack.js (no-op script)
- tests/helpers/test_helpers.go: CaptureOutput() (never called)
- tests/unit/utils_test.go: TestValidateDockerCompose, TestJoinArgs (placeholder tests with no real assertions)

Updated:
- package.json: removed prepack script and main field (CLI-only package)
- tests/helpers/test_helpers.go: removed unused io import

Skipped:
- cmd/testing.go: testDefaultUIRepo/testDefaultCoreRepo still used as NoOptDefVal for flag defaults

Tests pass: go build ./... and go test ./cmd/... both succeed

Co-authored-by: Mohit Nagaraj <me@mohitnagaraj.in>
@coderabbitai

coderabbitai Bot commented Sep 16, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@cursor

cursor Bot commented Sep 18, 2026

Copy link
Copy Markdown

Closing this — the nightly audit was retired.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants