Skip to content

refactor: clean dead code, add high-value tests, streamline docs - #162

Merged
rsonghuster merged 2 commits into
masterfrom
refactor/cleanup-tests-docs
Aug 8, 2026
Merged

refactor: clean dead code, add high-value tests, streamline docs#162
rsonghuster merged 2 commits into
masterfrom
refactor/cleanup-tests-docs

Conversation

@rsonghuster

Copy link
Copy Markdown
Contributor

Summary

Behavior-preserving refactor covering dead-code cleanup, test gaps, and documentation. No public API changes — all 22 command exports in src/index.ts are unchanged. Verified by typecheck + full unit suite + ncc build.

Dead code (safe cleanup only)

  • Remove ~17 comment-only dead blocks (kept meaningful TODOs).
  • Rename misnamed goLocalInvoke.tsgoLocalStart.ts (the class is GoLocalStart, and the old name collided with invoke/goLocalInvoke.ts); import updated.
  • Add ts-prune / depcheck audit scripts. Audit confirms no production dependency is safely removable — flags are interface/ public types and ts-jest/e2e/f2elint transitive deps.

Tests (high-value gaps first)

  • +12 test files / +120 cases for previously untested modules: resource clients acr/oss/ram/vpc-nas, info, 2to3, deploy/impl (base/trigger/vpc_binding), deploy/utils, run-command.
  • Coverage: oss/ram/vpc-nas 0→100%, acr 0→80.8%, info 0→98.9%, 2to3 0→98.5%.
  • Overall statement coverage 61.87% → 67.36%.
  • jestconfig: added collectCoverageFrom to expose real coverage.
  • Split test to unit-only (no credentials required); added test:it for integration tests.

Docs

  • Deleted: empty version.md, redundant root CONTRIBUTING.md (generic boilerplate with wrong repo refs), and stale AI meta-docs (project-summary, testing-plan, technical-documentation).
  • Consolidated contribution guide into docs/CONTRIB.md; rewrote docs index and architecture design notes.
  • Fixed README node badge >=14.14.0>=16; updated CLAUDE.md scripts table.

Test plan

  • npm run typecheck — clean
  • npm test — 75 suites, 1122 passed / 2 skipped
  • npm run build — ncc bundle produced
  • npm run lint — 0 errors
  • CI green on all three platforms (node16)

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@rsonghuster, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 47 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 59820cfa-7e92-4590-91cc-01edd3ab9338

📥 Commits

Reviewing files that changed from the base of the PR and between e22227e and ea5ade6.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (45)
  • CLAUDE.md
  • CONTRIBUTING.md
  • README.md
  • __tests__/ut/commands/2to3/index_test.ts
  • __tests__/ut/commands/deploy/impl/base_test.ts
  • __tests__/ut/commands/deploy/impl/trigger_test.ts
  • __tests__/ut/commands/deploy/impl/vpc_binding_test.ts
  • __tests__/ut/commands/deploy/utils/index_test.ts
  • __tests__/ut/commands/info/index_test.ts
  • __tests__/ut/local/local_test.ts
  • __tests__/ut/resources/acr/index_test.ts
  • __tests__/ut/resources/acr/login_test.ts
  • __tests__/ut/resources/oss/index_test.ts
  • __tests__/ut/resources/ram/index_test.ts
  • __tests__/ut/resources/vpc-nas/index_test.ts
  • __tests__/ut/utils/run-command_test.ts
  • docs/CONTRIB.md
  • docs/RUNBOOK.md
  • docs/architecture.md
  • docs/project-summary.md
  • docs/readme.md
  • docs/technical-documentation.md
  • docs/testing-plan.md
  • jestconfig.json
  • package.json
  • src/interface/trigger.ts
  • src/resources/acr/login.ts
  • src/resources/fc/impl/utils.ts
  • src/resources/fc/index.ts
  • src/resources/vpc-nas/index.ts
  • src/subCommands/deploy/impl/custom_domain.ts
  • src/subCommands/deploy/impl/function.ts
  • src/subCommands/deploy/impl/provision_config.ts
  • src/subCommands/invoke/index.ts
  • src/subCommands/local/impl/invoke/baseLocalInvoke.ts
  • src/subCommands/local/impl/invoke/customContainerLocalInvoke.ts
  • src/subCommands/local/impl/invoke/pythonLocalInvoke.ts
  • src/subCommands/local/impl/start/customLocalStart.ts
  • src/subCommands/local/impl/start/goLocalStart.ts
  • src/subCommands/local/index.ts
  • src/subCommands/logs/index.ts
  • src/subCommands/plan/index.ts
  • src/subCommands/remove/index.ts
  • src/utils/run-command.ts
  • version.md
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/cleanup-tests-docs

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.

Behavior-preserving refactor verified by typecheck + full unit suite + ncc build.

Dead code (safe cleanup):
- remove ~17 comment-only dead blocks (keep meaningful TODOs)
- rename misnamed goLocalInvoke.ts -> goLocalStart.ts (class is GoLocalStart),
  update its import
- add ts-prune/depcheck audit scripts; audit confirms no production dependency
  is safely removable (flags are interface types, ts-jest/e2e/f2elint transitives)

Tests (high-value gaps first):
- add 12 unit test files / 120 cases for previously untested modules:
  resources acr/oss/ram/vpc-nas, info, 2to3, deploy/impl base/trigger/vpc_binding,
  deploy/utils, run-command
- oss/ram/vpc-nas 0->100%, acr 0->80.8%, info 0->98.9%, 2to3 0->98.5%
- overall statement coverage 61.87% -> 67.36%

Test config:
- add collectCoverageFrom to expose real coverage
- split `test` to unit-only (no credentials); add `test:it` for integration

Docs:
- delete empty version.md, redundant root CONTRIBUTING.md, and stale AI meta-docs
  (project-summary, testing-plan, technical-documentation)
- consolidate contribution guide into docs/CONTRIB.md; rewrite docs index and
  architecture design notes; fix README node badge >=14.14.0 -> >=16
- update CLAUDE.md scripts table

Signed-off-by: ls147258 <ls147258@alibaba-inc.com>
@rsonghuster
rsonghuster force-pushed the refactor/cleanup-tests-docs branch from 49f582f to d574086 Compare August 8, 2026 01:27
- Run npm run fix so check-format CI passes (no residual TS diffs)
- 2to3 test: use path.join instead of hardcoded POSIX paths so
  assertions pass on Windows (path.join uses the platform separator)

Signed-off-by: ls147258 <ls147258@alibaba-inc.com>
@rsonghuster
rsonghuster merged commit 3dc7e65 into master Aug 8, 2026
6 checks passed
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.

1 participant