Conversation
|
ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughCentralizes Windows detection in LoaderUtil.isWindowsPlatform, changes LoaderUtil.loadFile to wrap dynamic-import failures with the original caller file path (originalFilePath), and adds a unit test that validates the Windows-specific error-message behavior. ChangesWindows File Path Preservation in Error Messages
Possibly Related PRs
Poem
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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: |
444f6eb
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://bd00c39d.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 85.19% 85.19%
=======================================
Files 668 668
Lines 19288 19290 +2
Branches 3784 3784
=======================================
+ Hits 16432 16434 +2
Misses 2464 2464
Partials 392 392 ☔ View full report in Codecov by Sentry. 🚀 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. |
Deploying egg-v3 with
|
| Latest commit: |
444f6eb
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://e4b12d26.egg-v3.pages.dev |
| Branch Preview URL: | https://agent-egg-dev-417ded38.egg-v3.pages.dev |
09214b3 to
444f6eb
Compare
Summary
Tests
Follow-up for CodeRabbit thread on #5932.
Summary by CodeRabbit
Bug Fixes
Tests