Skip to content

fix(init): send dirListing/fileCache/existingSentry via initialState#796

Merged
betegon merged 1 commit intomainfrom
fix/init-initial-state
Apr 21, 2026
Merged

fix(init): send dirListing/fileCache/existingSentry via initialState#796
betegon merged 1 commit intomainfrom
fix/init-initial-state

Conversation

@betegon
Copy link
Copy Markdown
Member

@betegon betegon commented Apr 21, 2026

Summary

  • Move large shared context (dirListing, fileCache, existingSentry) out of inputData and into initialState on run.startAsync. inputData now carries only the small parameters (directory, yes, dryRun, features).
  • Added a test that asserts the client no longer packs these fields into inputData and that initialState carries them verbatim.

Context

Companion to getsentry/cli-init-api#108. The server-side refactor drops dirListing / fileCache / existingSentry from wizardInputSchema and every afterXxxFields composite — they now live on wizardStateSchema so the D1 snapshot stores them exactly once per run instead of duplicating them across every step's output. This CLI change is what populates that state.

Together with:

Relates to getsentry/cli-init-api#98.

Migration

No shim. Land order: server #108 → this CLI PR. In-flight runs at server-deploy time (if any) will fail on next resume and users re-run; runs are short-lived (single CLI session) so blast radius is small.

Test plan

  • bun test test/lib/init/wizard-runner.test.ts (13/13 pass; new test for initialState wiring).
  • bunx @biomejs/biome check clean.
  • After server feat(install): auto-add sentry to PATH on install #108 is deployed: run sentry init against /Users/bete/code/sentry-test-projects/tanstack-start-faster and confirm the wizard completes successfully.

Made with Cursor

Large shared context now lives on Mastra workflow state rather than
inputData. The server-side refactor (getsentry/cli-init-api#108)
moved dirListing/fileCache/existingSentry onto `wizardStateSchema`
so the D1 snapshot stops duplicating them across every step's
output and no longer trips the per-row size limit on big projects.

Pass them through the `initialState` arg to `run.startAsync` instead.
inputData keeps only directory/yes/dryRun/features.

Test updated to assert the client no longer packs these fields into
inputData and that initialState carries them verbatim.

Made-with: Cursor
@github-actions
Copy link
Copy Markdown
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 ✨

Bug Fixes 🐛

Init

  • Send dirListing/fileCache/existingSentry via initialState by betegon in #796
  • Force process exit after wizard completes by betegon in #782

Other

Internal Changes 🔧

  • (init) Trim deprecated --features help entries by MathurAditya724 in #781
  • Regenerate docs by github-actions[bot] in 58a84035

🤖 This preview updates automatically when you update the PR.

@github-actions
Copy link
Copy Markdown
Contributor

PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://cli.sentry.dev/_preview/pr-796/

Built to branch gh-pages at 2026-04-21 10:18 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@github-actions
Copy link
Copy Markdown
Contributor

Codecov Results 📊

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

📊 Comparison with Base Branch

Metric Change
Total Tests
Passed Tests
Failed Tests
Skipped Tests

✨ No test changes detected

All tests are passing successfully.

✅ Patch coverage is 100.00%. Project has 1698 uncovered lines.
✅ Project coverage is 95.58%. Comparing base (base) to head (head).

Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    95.58%    95.58%        —%
==========================================
  Files          264       264         —
  Lines        38454     38457        +3
  Branches         0         0         —
==========================================
+ Hits         36755     36759        +4
- Misses        1699      1698        -1
- Partials         0         0         —

Generated by Codecov Action

@betegon betegon merged commit be5b6ca into main Apr 21, 2026
25 checks passed
@betegon betegon deleted the fix/init-initial-state branch April 21, 2026 13:06
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