-
Notifications
You must be signed in to change notification settings - Fork 0
fix: use libvirt types #33
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
|
Caution Review failedThe pull request is closed. WalkthroughThis pull request extends the Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant Domain
Client->>Domain: isActive(), isPersistent(), isUpdated()
Domain-->>Client: boolean responses
Client->>Domain: suspend(), resume(), shutdown(), reboot(), reset()
Domain-->>Client: confirmation (void responses)
Client->>Domain: getState(), getMaxMemory(), getMemory(), getMaxVcpus(), getVcpus()
Domain-->>Client: state & numeric values
Client->>Domain: setMaxMemory(), setMemory(), setVcpus()
Domain-->>Client: acknowledgment
Client->>Domain: getXMLDesc(), defineXML(), hasCurrentSnapshot(), hasSnapshot(), getBlockInfo(), getBlockDevices(), getInterfaceAddresses()
Domain-->>Client: string, object, and array responses
Possibly related PRs
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
lib/get-bindings.d.tsOops! Something went wrong! :( ESLint: 9.22.0 ESLint couldn't find an eslint.config.(js|mjs|cjs) file. From ESLint v9.0.0, the default configuration file is now eslint.config.js. https://eslint.org/docs/latest/use/configure/migration-guide If you still have problems after following the migration guide, please stop by 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
lib/get-bindings.d.ts(1 hunks)package.json(1 hunks)
🧰 Additional context used
🧬 Code Definitions (1)
lib/get-bindings.d.ts (1)
lib/get-bindings.ts (2)
DomainState(44-55)DomainGetXMLDescFlags(36-41)
🪛 Biome (1.9.4)
lib/get-bindings.d.ts
[error] 92-98: The enum declaration should not be const
Const enums are not supported by bundlers and are incompatible with the 'isolatedModules' mode. Their use can lead to import inexistent values.
See TypeScript Docs for more details.
Safe fix: Turn the const enum into a regular enum.
(lint/suspicious/noConstEnum)
[error] 100-104: The enum declaration should not be const
Const enums are not supported by bundlers and are incompatible with the 'isolatedModules' mode. Their use can lead to import inexistent values.
See TypeScript Docs for more details.
Safe fix: Turn the const enum into a regular enum.
(lint/suspicious/noConstEnum)
🔇 Additional comments (5)
lib/get-bindings.d.ts (4)
60-90: Validate the newly introduced domain operations.
All these async domain operations appear adequate for a full range of lifecycle and resource management needs. However, consider clarifying the meaning ofisUpdated(), as the intent is unclear. If it checks for configuration changes, you might rename it to something likeisModified()orisConfigUpdated()to be more explicit. Also, verify in usages that each method handles errors appropriately and returns consistent results in edge cases, for example domains that are already shut down or suspended.
106-110: No issues found withDomainBlockInfo.
The shape of this interface aligns well with libvirt’s block info (capacity, allocation, etc.). Nothing to address here.
112-116: Looks good forDomainInterfaceInfo.
Appropriate fields for interface name, MAC address, and IP addresses. This interface is consistent with typical libvirt network/device modeling.
118-122:DomainInterfaceAddressdefinition.
This interface properly captures basic address details. No further suggestions.package.json (1)
6-6: Check for consistency between types path and exports.
You updated"types": "./dist/types/index.d.ts"at the top level, but the"exports"block on lines 12–17 still references"types": "./dist/index.d.ts". Confirm both references match the new directory layout, ensuring that imported types from@unraid/libvirtresolve correctly without confusion.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Summary by CodeRabbit
New Features
Chores
main, while still gating the release step by the branch condition.