Skip to content

feat: add configurable concurrency and improve file copying - #97

Merged
ghiscoding merged 2 commits into
mainfrom
perf/audit-astra
Oct 3, 2026
Merged

ghiscoding merged 2 commits into
mainfrom
perf/audit-astra

Conversation

@ghiscoding

@ghiscoding ghiscoding commented Oct 3, 2026 •

Copy link
Copy Markdown
Owner

Summary

Limit simultaneous file copies, close streams reliably after failures, reduce repeated filesystem work, and honor string exclusions.

Why

Large batches could exhaust file descriptors, and failed writes leaked open streams. Discovery repeated unnecessary filesystem checks, while string exclusions were silently ignored.

Changes

  • Default concurrency to os.availableParallelism(), capped at 32.
  • Add validated API concurrency and CLI --concurrency / -c overrides.
  • Stop queued copies on failure and close active streams before reporting the original error.
  • Cache repeated glob results and destination-directory checks; use Dirents to avoid per-file stats.
  • Normalize string exclusions while preserving default exclusions and ordered negation.
  • Add regression tests and document concurrency and failure behavior.

Validation

  • TypeScript build and Biome checks passed.
  • Vitest: 85 passed, 1 skipped; 100% line coverage.
  • Verified both CLI concurrency flags and rejection of invalid values.
  • Confirmed copying succeeds under a 256-descriptor limit and repeated failed writes no longer leak descriptors.
  • git diff --check passed.

Comments

Discovery remains synchronous. Files already written may remain after a copy fails.

AI / LLM assistance

  • AI / LLM assistance used:
    • No
    • Yes
  • If Yes:
    • which tool/model: OpenAI ChatGPT 6 Astra
    • how was it used: Auditing, benchmarking, implementation, regression tests, and documentation.

Checklist

  • The changes are limited to only one scope.
  • Tests were added or updated where appropriate.
  • Documentation was updated where appropriate.

@codecov

codecov Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (164d340) to head (2fbbf10).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #97   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            2         2           
  Lines          206       224   +18     
  Branches        68        70    +2     
=========================================
+ Hits           206       224   +18     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ghiscoding ghiscoding changed the title fix: bound copy concurrency and clean up failed streams feat: add configurable concurrency and improve file copying Oct 3, 2026
@ghiscoding
ghiscoding merged commit fb8406d into main Oct 3, 2026
6 checks passed
@ghiscoding
ghiscoding deleted the perf/audit-astra branch October 3, 2026 16:43
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