Merged
Conversation
Contributor
Reviewer's GuideThis PR implements a full end-to-end test for VM restore operations via VMOP by extending the test framework with new util and builder helpers, adding a dedicated restore test suite, and updating object constructors to support restore-specific options. Class diagram for new VM snapshot builder and optionsclassDiagram
class VirtualMachineSnapshot {
+TypeMeta
+ObjectMeta
+Spec: VirtualMachineSnapshotSpec
}
class VirtualMachineSnapshotSpec {
+RequiredConsistency: bool
+KeepIPAddress: KeepIPAddress
+VirtualMachineName: string
}
class Option {
<<interface>>
+apply(vmsnapshot: VirtualMachineSnapshot)
}
VirtualMachineSnapshotSpec <|-- VirtualMachineSnapshot
Option <|.. VirtualMachineSnapshot
VirtualMachineSnapshot "1" *-- "1" VirtualMachineSnapshotSpec
Class diagram for new VMOP restore optionsclassDiagram
class VirtualMachineOperation {
+Spec: VirtualMachineOperationSpec
}
class VirtualMachineOperationSpec {
+Force: bool
+Restore: VirtualMachineOperationRestoreSpec
}
class VirtualMachineOperationRestoreSpec {
+Mode: VMOPRestoreMode
+VirtualMachineSnapshotName: string
}
VirtualMachineOperationSpec <|-- VirtualMachineOperation
VirtualMachineOperationRestoreSpec <|-- VirtualMachineOperationSpec
VirtualMachineOperation "1" *-- "1" VirtualMachineOperationSpec
VirtualMachineOperationSpec "1" *-- "0..1" VirtualMachineOperationRestoreSpec
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey there - I've reviewed your changes - here's some feedback:
- The
vmop/restore.goe2e test is quite large and repetitive; consider breaking it into smaller table-driven subtests or extracting common setup/validation logic into reusable helpers to improve readability and maintainability. - In the builder functions wrapping
vd.New, you append user-provided options after base options, which can lead to precedence issues; consider documenting the override order clearly or prepending base options so callers can reliably override defaults. - You introduced
Framework.UpdateFromClusterbut most retrievals still usef.Clients.GenericClient(); consolidating on a single pattern for updating objects (either the new helper or the existing client) would reduce confusion and duplication.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The `vmop/restore.go` e2e test is quite large and repetitive; consider breaking it into smaller table-driven subtests or extracting common setup/validation logic into reusable helpers to improve readability and maintainability.
- In the builder functions wrapping `vd.New`, you append user-provided options after base options, which can lead to precedence issues; consider documenting the override order clearly or prepending base options so callers can reliably override defaults.
- You introduced `Framework.UpdateFromCluster` but most retrievals still use `f.Clients.GenericClient()`; consolidating on a single pattern for updating objects (either the new helper or the existing client) would reduce confusion and duplication.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
ffd1511 to
558e087
Compare
4227e81 to
45e1ed1
Compare
73ae2a3 to
33ea848
Compare
472bbc7 to
7bb38ab
Compare
hardcoretime
requested changes
Nov 13, 2025
Contributor
|
Workflow has started. The target step completed with status: failure. |
691b453 to
a399822
Compare
hardcoretime
requested changes
Dec 10, 2025
Signed-off-by: Valeriy Khorunzhin <valeriy.khorunzhin@flant.com>
Co-authored-by: Roman Sysoev <36233932+hardcoretime@users.noreply.github.com> Signed-off-by: Valeriy Khorunzhin <b1kapb999@gmail.com>
Co-authored-by: Roman Sysoev <36233932+hardcoretime@users.noreply.github.com> Signed-off-by: Valeriy Khorunzhin <b1kapb999@gmail.com>
Signed-off-by: Valeriy Khorunzhin <valeriy.khorunzhin@flant.com>
Signed-off-by: Valeriy Khorunzhin <valeriy.khorunzhin@flant.com>
Signed-off-by: Valeriy Khorunzhin <valeriy.khorunzhin@flant.com>
Signed-off-by: Valeriy Khorunzhin <valeriy.khorunzhin@flant.com>
7aa0e88 to
aae0e16
Compare
added 2 commits
December 11, 2025 14:11
Signed-off-by: Valeriy Khorunzhin <valeriy.khorunzhin@flant.com>
Signed-off-by: Valeriy Khorunzhin <valeriy.khorunzhin@flant.com>
Co-authored-by: Roman Sysoev <36233932+hardcoretime@users.noreply.github.com> Signed-off-by: Valeriy Khorunzhin <b1kapb999@gmail.com>
hardcoretime
approved these changes
Dec 11, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add e2e test for VM restore VMOP.
Checklist
Changelog entries