Repository navigation
fix(tegg): preserve load error caller path - #5939
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthroughLoaderUtil adds a Windows platform check and uses it during file loading. If a dynamic import fails, the wrapped error uses the original input path. A test checks the Windows error message and cause. ChangesWindows File Path Preservation
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~8 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to No actionable issue remains from this review; the change is mergeable after normal checks. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
Deploying egg with
|
| Latest commit: |
081f7c3
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://da5b8b9e.egg-cci.pages.dev |
| Branch Preview URL: | https://agent-egg-dev-417ded38.egg-cci.pages.dev |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## next #5939 +/- ##
==========================================
+ Coverage 80.24% 83.91% +3.67%
==========================================
Files 4 731 +727
Lines 329 22602 +22273
Branches 91 4554 +4463
==========================================
+ Hits 264 18967 +18703
- Misses 56 3141 +3085
- Partials 9 494 +485 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Code Review
This pull request updates LoaderUtil.ts to use originalFilePath instead of filePath when reporting load errors, ensuring consistent error messages across different environments. A new test case was added to verify this behavior on Windows. Feedback was provided regarding the method used to mock process.platform in the tests, suggesting a more robust approach like using a helper method or standard mocking tools to avoid potential fragility in different Node.js environments.
There was a problem hiding this comment.
Pull request overview
This PR fixes TEgg loader error wrapping so that, when LoaderUtil.loadFile() falls back to import() on Windows and converts the path to a file:// URL, the thrown “load failed” error message still references the original caller-provided path (not the transformed URL). It also adds a regression test to ensure this behavior.
Changes:
- Use
originalFilePath(caller path) instead of the potentially rewrittenfilePathwhen wrapping dynamicimport()failures. - Add a regression test that simulates
win32and asserts the error message preserves the caller path.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tegg/core/loader/src/LoaderUtil.ts | Preserve caller-provided path in createLoadError(...) when dynamic import fails after Windows file:// conversion. |
| tegg/core/loader/test/Loader.test.ts | Add regression coverage ensuring error messages keep the original path under the win32 fallback branch. |
09214b3 to
444f6eb
Compare
Summary
Tests
Follow-up for CodeRabbit thread on #5932.
Summary by CodeRabbit
Bug Fixes
Tests