Skip to content

perf(init): pre-compute directory listing before first API call#307

Draft
betegon wants to merge 1 commit intofeat/init-commandfrom
feat/precompute-dir-listing
Draft

perf(init): pre-compute directory listing before first API call#307
betegon wants to merge 1 commit intofeat/init-commandfrom
feat/precompute-dir-listing

Conversation

@betegon
Copy link
Member

@betegon betegon commented Feb 27, 2026

Summary

Sends a pre-computed directory listing with the first API call so the server can skip its initial list-dir suspend. Saves one full HTTP round-trip in the discover-context step.

Changes

Exports precomputeDirListing from local-ops.ts — reuses the existing listDir function with the same params the server would request (recursive, maxDepth 3, maxEntries 500). The wizard runner calls it before startAsync and includes the result as dirListing in inputData.

Companion server change: getsentry/cli-init-api#16

Test plan

  • Init tests pass (bun test test/lib/init/)
  • Lint passes
  • End-to-end with local dev server

🤖 Generated with Claude Code

Scans the project directory locally and sends the listing with the
initial workflow request. This lets the server's discover-context step
skip its list-dir suspend, saving one full round-trip.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Contributor

Semver Impact of This PR

🟢 Patch (bug fixes)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

  • (init) Add init command for guided Sentry project setup by betegon in #283

Bug Fixes 🐛

  • (api) Auto-correct ':' to '=' in --field values with a warning by BYK in #302
  • (ci) Generate JUnit XML to silence codecov-action warnings by BYK in #300
  • (nightly) Push to GHCR from artifacts dir so layer titles are bare filenames by BYK in #301
  • Added auth headers in the mastra client by MathurAditya724 in #264

Internal Changes 🔧

  • (init) Pre-compute directory listing before first API call by betegon in #307

🤖 This preview updates automatically when you update the PR.

@github-actions
Copy link
Contributor

Codecov Results 📊

2087 passed | Total: 2087 | Pass Rate: 100% | Execution Time: 0ms

📊 Comparison with Base Branch

Metric Change
Total Tests 📈 +5
Passed Tests 📈 +5
Failed Tests
Skipped Tests

All tests are passing successfully.

❌ Patch coverage is 8.70%. Project has 4323 uncovered lines.
❌ Project coverage is 73.42%. Comparing base (base) to head (head).

Files with missing lines (2)
File Patch % Lines
local-ops.ts 21.75% ⚠️ 277 Missing
wizard-runner.ts 5.74% ⚠️ 197 Missing
Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
- Coverage    76.47%    73.42%    -3.05%
==========================================
  Files          117       124        +7
  Lines        15335     16262      +927
  Branches         0         0         —
==========================================
+ Hits         11727     11939      +212
- Misses        3608      4323      +715
- Partials         0         0         —

Generated by Codecov Action

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