Skip to content

Feat: get pending current config#462

Open
Tinyblargon wants to merge 3 commits intoTelmate:masterfrom
Tinyblargon:feat-get-pending
Open

Feat: get pending current config#462
Tinyblargon wants to merge 3 commits intoTelmate:masterfrom
Tinyblargon:feat-get-pending

Conversation

@Tinyblargon
Copy link
Collaborator

Add support for getting the pending config, which is an optimization for getting the pending flag and the normal config in 1 API call.

Reduced duplicate code between tests.

@Tinyblargon Tinyblargon requested a review from Copilot September 18, 2025 21:53
@Tinyblargon Tinyblargon self-assigned this Sep 18, 2025
@Tinyblargon Tinyblargon added type/enhancement An improvement of existing functionality type/refactoring Existing code has been cleaned up. There should be no new functionality modifies/go Pull requests that update Go code size/L Denotes a PR that changes 100-499 lines, ignoring generated files test/needen This PR has to be tested labels Sep 18, 2025
Copy link
Contributor

Copilot AI left a 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 PR adds support for getting the pending config in a single API call, optimizing the process of fetching both pending changes and current configuration. It introduces a new pendingCurrentConfig method that returns the configuration with pending changes applied.

Key changes:

  • Added new pendingCurrentConfig method that applies pending changes to the current configuration
  • Refactored existing pendingConfig method to pendingActiveConfig for clarity
  • Extracted duplicate test helper code into a reusable baseTest method

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
proxmox/vmref.go Added constants for pending change keys, new pendingCurrentConfig method, and renamed existing method for clarity
proxmox/vmref_test.go Added comprehensive test coverage for the new pendingCurrentConfig functionality
proxmox/config__qemu_test.go Refactored duplicate test setup code into a reusable baseTest helper method
proxmox/config__qemu.go Updated method calls to use the renamed pendingActiveConfig and new pendingCurrentConfig methods
proxmox/config__lxc__new.go Updated method call to use the renamed pendingActiveConfig method
Comments suppressed due to low confidence (1)

proxmox/config__qemu_test.go:1

  • [nitpick] The method name baseTest is ambiguous and doesn't clearly indicate its purpose. Consider renaming it to withDefaultsForTesting or setTestDefaults to better communicate that it sets default values for test scenarios.
package proxmox

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

pendingProperty = "key"
)

// pendingActiveConfig returns the active config without pending changes applied.
Copy link

Copilot AI Sep 18, 2025

Choose a reason for hiding this comment

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

The comment is misleading. Based on the implementation, this method returns the current config values (which could include previously applied pending changes), not necessarily the 'active config without pending changes'. Consider clarifying this as 'returns the current config values from the pending changes API'.

Suggested change
// pendingActiveConfig returns the active config without pending changes applied.
// pendingActiveConfig returns the current config values as retrieved from the pending changes API.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

modifies/go Pull requests that update Go code size/L Denotes a PR that changes 100-499 lines, ignoring generated files test/needen This PR has to be tested type/enhancement An improvement of existing functionality type/refactoring Existing code has been cleaned up. There should be no new functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants