fix(init): send dirListing/fileCache/existingSentry via initialState#796
Merged
fix(init): send dirListing/fileCache/existingSentry via initialState#796
Conversation
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
Contributor
Semver Impact of This PR🟢 Patch (bug fixes) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨
Bug Fixes 🐛Init
Other
Internal Changes 🔧
🤖 This preview updates automatically when you update the PR. |
Contributor
|
Contributor
Codecov Results 📊✅ 138 passed | Total: 138 | Pass Rate: 100% | Execution Time: 0ms 📊 Comparison with Base Branch
✨ No test changes detected All tests are passing successfully. ✅ Patch coverage is 100.00%. Project has 1698 uncovered lines. 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
dirListing,fileCache,existingSentry) out ofinputDataand intoinitialStateonrun.startAsync.inputDatanow carries only the small parameters (directory,yes,dryRun,features).inputDataand thatinitialStatecarries them verbatim.Context
Companion to getsentry/cli-init-api#108. The server-side refactor drops
dirListing/fileCache/existingSentryfromwizardInputSchemaand everyafterXxxFieldscomposite — they now live onwizardStateSchemaso 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:
retries: 0onMastraClientso real server errors surface instead of retry cascade.wizard.workflow.erroredfunnel metric.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 forinitialStatewiring).bunx @biomejs/biome checkclean.sentry initagainst/Users/bete/code/sentry-test-projects/tanstack-start-fasterand confirm the wizard completes successfully.Made with Cursor