-
-
Notifications
You must be signed in to change notification settings - Fork 0
fix: shows v3 not supported message #16
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
Conversation
📝 WalkthroughWalkthroughVersion bumped to 0.2.2 with new uuid dependency integration. Telemetry system now generates device IDs using UUIDv5 with a fixed namespace. Machine ID utilities refactored to use uuid.v4 instead of randomUUID. Error messages clarified with expanded context. No public API modifications. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (5)
🧰 Additional context used🧬 Code graph analysis (2)src/telemetry.ts (1)
src/zmodel-parser.ts (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🔇 Additional comments (5)
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 |
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.
Pull request overview
This pull request adds a user-facing message indicating that ZenStack V3 is not supported, while also refactoring UUID generation to use the uuid package instead of Node.js's built-in crypto.randomUUID(). The changes improve telemetry by using UUIDv5 for consistent device ID generation.
Key changes:
- Enhanced error message for missing generator blocks to inform users about V3 compatibility
- Migrated from Node.js native
randomUUIDto theuuidpackage (v13.0.0) for UUID generation - Implemented UUIDv5-based device ID hashing in telemetry for better consistency
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/zmodel-parser.ts | Enhanced error message to inform users that V3 is not supported when no generator block is found |
| src/utils/machine-id-utils.ts | Replaced Node.js randomUUID with uuid package's v4 function and modified return type of expose() function |
| src/telemetry.ts | Added UUIDv5-based device ID generation using a custom namespace UUID |
| src/index.ts | Minor cleanup removing "Error:" prefix from error message and extra blank line |
| package.json | Version bump to 0.2.2 and added uuid dependency (^13.0.0) |
| pnpm-lock.yaml | Added [email protected] package entries |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/utils/machine-id-utils.ts (1)
35-62: Type safety issue:exposecan returnundefineddespite declared return type.The
exposefunction's return type is declared asstring, but the implementation uses optional chaining (?.) which can returnundefined:
- Line 39:
.split('IOPlatformUUID')[1]?.split('\n')[0]?.replace(...)- Line 46:
.split('REG_SZ')[1]?.replace(...)When
exposereturnsundefinedand is passed tohash()on line 71, it will cause type errors or runtime issues.🔧 Proposed fix to handle potential undefined returns
Update the
exposefunction to handle undefined cases explicitly:-function expose(result: string): string { +function expose(result: string): string | undefined { switch (platform) { case 'darwin': return result .split('IOPlatformUUID')[1] ?.split('\n')[0] ?.replace(/=|\s+|"/gi, '') .toLowerCase() case 'win32': return result .toString() .split('REG_SZ')[1] ?.replace(/\r+|\n+|\s+/gi, '') .toLowerCase() case 'linux': return result .toString() .replace(/\r+|\n+|\s+/gi, '') .toLowerCase() case 'freebsd': return result .toString() .replace(/\r+|\n+|\s+/gi, '') .toLowerCase() default: throw new Error(`Unsupported platform: ${process.platform}`) } } export function getMachineId() { if (!(platform in guid)) { return uuid() } try { const value = execSync(guid[platform as keyof typeof guid]) const id = expose(value.toString()) + if (!id) { + return uuid() + } return hash(id) } catch { return uuid() } }
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (5)
package.jsonsrc/index.tssrc/telemetry.tssrc/utils/machine-id-utils.tssrc/zmodel-parser.ts
🧰 Additional context used
🧬 Code graph analysis (2)
src/telemetry.ts (1)
src/utils/machine-id-utils.ts (1)
getMachineId(64-75)
src/zmodel-parser.ts (1)
src/cli-error.ts (1)
CliError(4-4)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Agent
🔇 Additional comments (5)
src/index.ts (1)
34-34: LGTM! Error message formatting improved.Removing the "Error: " prefix is appropriate since
console.erroralready formats the output as an error. This makes the message cleaner.src/zmodel-parser.ts (1)
160-162: LGTM! Clear and informative error message.The expanded error message effectively communicates that ZenStack V3 is not supported and provides helpful context about upcoming built-in proxy support. This aligns well with the PR's objective.
src/telemetry.ts (1)
44-48: Verify the UUIDv5 namespace identifier.The hardcoded namespace UUID
'133cac15-3efb-50fa-b5fc-4b90e441e563'doesn't match the standard DNS namespace UUID ('6ba7b810-9dad-11d1-80b4-00c04fd430c8'). The comment indicates this is for DNS 'zenstack.dev', but the value appears to be a custom namespace.Please confirm:
- Is this a pre-generated UUIDv5 for 'zenstack.dev' that's being used as a custom namespace?
- Or should this use the standard DNS namespace constant from the uuid library?
Alternative implementation using standard DNS namespace
If you want to use the standard DNS namespace:
import { v5 as uuidv5, NIL as NIL_UUID } from 'uuid' private getDeviceId() { const hostId = getMachineId() // Use standard DNS namespace const DNS_NAMESPACE = '6ba7b810-9dad-11d1-80b4-00c04fd430c8' return uuidv5('zenstack.dev', DNS_NAMESPACE) }Or if the current approach is intentional, consider adding a constant to clarify the purpose:
private getDeviceId() { const hostId = getMachineId() // Custom namespace UUID for ZenStack telemetry const ZENSTACK_NAMESPACE = '133cac15-3efb-50fa-b5fc-4b90e441e563' return uuidv5(hostId, ZENSTACK_NAMESPACE) }package.json (2)
3-3: Version bump looks appropriate.The patch version increment from 0.2.1 to 0.2.2 is appropriate for this fix that improves error messaging.
37-37: No action required — [email protected] is the current latest version with no security advisories.[email protected] is a valid, published release and is the latest version on npm (as of January 2026). The main uuid package has no published security advisories affecting the current release. The dependency is safe to use.
Summary by CodeRabbit
Chores
Bug Fixes
✏️ Tip: You can customize this high-level summary in your review settings.