-
Notifications
You must be signed in to change notification settings - Fork 5
fix: Remove root directory error #139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughThe change adds validation guards to the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~15 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@src/subCommands/model/model.ts`:
- Around line 112-120: The OSS root check incorrectly treats any non-empty
bucketPath as root because the condition uses
(processedOssMountPoints[0].bucketPath || processedOssMountPoints[0].bucketPath
=== '/'); update the guard around storage === 'oss' to explicitly detect
undefined/empty or the literal root by checking processedOssMountPoints[0]
exists and then (processedOssMountPoints[0].bucketPath === undefined ||
processedOssMountPoints[0].bucketPath === '' ||
processedOssMountPoints[0].bucketPath === '/'); throw the Error only in that
case so valid non-root bucketPath values (e.g., '/models/mymodel') are allowed
to proceed.
- Around line 110-111: NAS_ROOT_REGEX currently only matches China regions
because it hardcodes "cn-[a-z]+"; update the regex (symbol NAS_ROOT_REGEX in
model.ts) to accept any region token so non‑China domains (e.g., ap-southeast-1,
us-west-1) are matched. Replace the region part with a more general character
class such as [a-z0-9-]+ (for example change \.cn-[a-z]+\. to \.[a-z0-9-]+\.) so
the full pattern becomes something like
/^[\w-]+\.[a-z0-9-]+\.nas\.aliyuncs\.com:\/$/ and retain the rest of the pattern
and anchors.
5258e48 to
ee61e1e
Compare
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.