Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@AlexKarpov98
Copy link
Contributor

@AlexKarpov98 AlexKarpov98 commented Oct 1, 2025

WIP

Testing: see ticket & story.

not: API Limitations (for now API is limited and not fully created)
Available endpoints, which I used for current refactoring :

container.create
container.delete
container.get_instance
container.migrate (not used in this PR)
container.query
container.start
container.stop
container.update
container.pool_choices

and as well config endpoints:

lxc.bridge_choices
lxc.config
lxc.update

As well:

  • Removed VM-specific features: TPM, PCI passthrough, boot disk management, VNC configuration
  • Deleted unused components: instance-edit-form (now only instance wizard used), change-root-disk-setup, change-boot-from-disk, pci-passthrough-dialog, import-iso-dialog, upload-iso-button, virtualization-state
  • Refactored to use MapValuePipe instead of component methods for value transformation
  • Remove unnecessary computed properties (isLocked, needToSetupPool, virtualizationState)
  • Cleaned up unused API definitions from api-call-directory, api-job-directory, api-event-directory
  • Fixed all test failures and removed skipped tests

Preview:

- Add shorter type aliases: Instance, CreateInstance, UpdateInstance
- Update all API directories to use new aliases instead of verbose names
- Reduces repetition while maintaining backward compatibility
@AlexKarpov98 AlexKarpov98 self-assigned this Oct 1, 2025
@bugclerk bugclerk changed the title Nas 137713 NAS-137713 / 26.04 / Nas 137713 Oct 1, 2025
@bugclerk
Copy link
Contributor

bugclerk commented Oct 1, 2025

@claude
Copy link

claude bot commented Oct 1, 2025

Claude finished @AlexKarpov98's task —— View job


PR Review: Convert Containers pages to use new API ✅

This is a well-executed refactoring that successfully converts the virtualization system from VM-focused to LXC container-specific architecture.

Positive Aspects 🎉

Clean Architecture Transition: The conversion from VirtualizationInstanceContainerInstance is systematic and complete across 100+ files, with proper API endpoint migration to container.* and lxc.* namespaces.

Modern Angular Patterns: Excellent adoption of current best practices including inject() DI pattern, standalone components, OnPush change detection, and the replacement of wizard with SlideIn pattern for better UX.

Smart Code Cleanup: Proper removal of 34+ VM-specific components (PCI passthrough, TPM, boot management, VNC) while maintaining functionality needed for containers. The refactoring to use MapValuePipe instead of component methods improves maintainability.

Areas for Improvement 🔧

Role Enum Inconsistency

The codebase mixes old VM roles (Role.VmDeviceRead) with new container roles (Role.ContainerWrite, Role.LxcConfigWrite). Consider standardizing on the container role names:

// Instead of mixed usage, standardize to:
Role.ContainerRead, Role.ContainerWrite
Role.LxcConfigRead, Role.LxcConfigWrite

Type Safety Gap

The VirtualizationDevice union type (src/app/interfaces/container.interface.ts:101) still includes VM-specific types like VirtualizationTpm and VirtualizationPciDevice which shouldn't be available for containers:

// Consider filtering out VM-only device types:
export type ContainerDevice = 
  | VirtualizationDisk 
  | VirtualizationGpu
  | VirtualizationProxy 
  | VirtualizationUsb
  | VirtualizationNic;
  // Remove: VirtualizationTpm | VirtualizationPciDevice

Test Coverage Consistency

While tests were updated to use ContainerInstance, some utility functions like fakeVirtualizationInstance() retain confusing names. Consider renaming to fakeContainerInstance() for clarity.

API Service Performance Fix

The performance monitoring fix in api.service.ts:160 is well implemented with proper null checking, addressing the reviewer's concern about performance.mark errors.

Security & Accessibility

No security concerns identified. Role-based access controls are properly maintained with appropriate container-specific permissions.

@AlexKarpov98 AlexKarpov98 changed the title NAS-137713 / 26.04 / Nas 137713 NAS-137713: Convert Containers pages to use new API Oct 1, 2025
@codecov
Copy link

codecov bot commented Oct 1, 2025

⚠️ JUnit XML file not found

The CLI was unable to find any JUnit XML files to upload.
For more help, visit our troubleshooting guide.

@AlexKarpov98 AlexKarpov98 marked this pull request as ready for review October 2, 2025 17:41
@AlexKarpov98 AlexKarpov98 requested a review from a team as a code owner October 2, 2025 17:41
@AlexKarpov98 AlexKarpov98 requested review from william-gr and removed request for a team October 2, 2025 17:41
Copy link
Member

@william-gr william-gr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Partial quick review

@AlexKarpov98
Copy link
Contributor Author

AlexKarpov98 commented Oct 3, 2025

@william-gr I made quick updates to move to SlideIn instead of Wizard.
Will address comments later. 🙌

Screenshot 2025-10-03 at 18 13 20

@william-gr
Copy link
Member

@william-gr I made quick updates to move to SlideIn instead of Wizard. Will address comments later. 🙌

Screenshot 2025-10-03 at 18 13 20

at least Virtual CPUs and memory we should have in the default view, I think, but I like this way better.

@AlexKarpov98
Copy link
Contributor Author

@william-gr comments addressed :)
Let's wait for API changes now.

@AlexKarpov98
Copy link
Contributor Author

@william-gr good catches 👍 (fixed)

@william-gr
Copy link
Member

Thanks! For the next set of fixes I believe you can create another PR that merges into this branch, as we discussed.

@william-gr william-gr removed their request for review October 7, 2025 12:01
…ates) (#12648)

* NAS-137713: Convert Containers pages to use new API (next updates)

* NAS-137713: PR Update

* NAS-137713: PR update

* NAS-137713: PR Update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants