Skip to content
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

[Compute] Bug fix in Invoke-AzVMPatchAssessment #25714

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

haagha
Copy link
Member

@haagha haagha commented Jul 31, 2024

Description

resolves #25123

Mandatory Checklist

  • SHOULD update ChangeLog.md file(s) appropriately
    • For SDK-based development mode, update src/{{SERVICE}}/{{SERVICE}}/ChangeLog.md.
      • A snippet outlining the change(s) made in the PR should be written under the ## Upcoming Release header in the past tense.
    • For autorest-based development mode, include the changelog in the PR description.
    • Should not change ChangeLog.md if no new release is required, such as fixing test case only.
  • SHOULD regenerate markdown help files if there is cmdlet API change. Instruction
  • SHOULD have proper test coverage for changes in pull request.
  • SHOULD NOT adjust version of module manually in pull request

Copy link

azure-client-tools-bot-prd bot commented Jul 31, 2024

️✔️Az.Accounts
️✔️Build
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
❌Az.Compute
️✔️Build
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
❌Breaking Change Check
❌PowerShell Core - Windows
Type Cmdlet Description Remediation
Invoke-AzVMPatchAssessment The property 'Patches' of type 'Microsoft.Azure.Commands.Compute.Automation.Models.PSVirtualMachinePatchAssessmentResult' has been removed. Add the property 'Patches' back to type 'Microsoft.Azure.Commands.Compute.Automation.Models.PSVirtualMachinePatchAssessmentResult'.
❌Windows PowerShell - Windows
Type Cmdlet Description Remediation
Invoke-AzVMPatchAssessment The property 'Patches' of type 'Microsoft.Azure.Commands.Compute.Automation.Models.PSVirtualMachinePatchAssessmentResult' has been removed. Add the property 'Patches' back to type 'Microsoft.Azure.Commands.Compute.Automation.Models.PSVirtualMachinePatchAssessmentResult'.
️✔️Signature Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Help File Existence Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️File Change Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️UX Metadata Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Test
️✔️PowerShell Core - Linux
️✔️PowerShell Core - MacOS
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Az.KeyVault
️✔️Build
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Az.ManagedServiceIdentity
️✔️Build
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Az.Monitor
️✔️Build
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Az.Network
️✔️Build
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Test
️✔️PowerShell Core - Linux
️✔️PowerShell Core - MacOS
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Az.OperationalInsights
️✔️Build
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Az.PrivateDns
️✔️Build
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Az.RecoveryServices
️✔️Build
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Test
️✔️PowerShell Core - Linux
️✔️PowerShell Core - MacOS
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Az.Security
️✔️Build
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Test
️✔️PowerShell Core - Linux
️✔️PowerShell Core - MacOS
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Az.Sql
️✔️Build
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Az.Ssh
️✔️Build
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Test
️✔️PowerShell Core - Linux
️✔️PowerShell Core - MacOS
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Az.Storage
️✔️Build
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows

@dolauli dolauli self-assigned this Aug 1, 2024
@@ -29,7 +29,7 @@ public class PSVirtualMachinePatchAssessmentResult
public int? CriticalAndSecurityPatchCount { get; set; }
public int? OtherPatchCount { get; set; }
public DateTime? StartDateTime { get; set; }
public IList<VirtualMachineSoftwarePatchProperties> Patches { get; set; }
public IList<VirtualMachineSoftwarePatchProperties> AvailablePatches { get; private set; }
Copy link
Member

Choose a reason for hiding this comment

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

So the issue was that the PS object made up a nonexistent Patches property instead of the AvailablePatches property which actually exists on the VirtualMachineAssessPatchesResult.cs object?

@@ -29,7 +29,7 @@ public class PSVirtualMachinePatchAssessmentResult
public int? CriticalAndSecurityPatchCount { get; set; }
public int? OtherPatchCount { get; set; }
public DateTime? StartDateTime { get; set; }
public IList<VirtualMachineSoftwarePatchProperties> Patches { get; set; }
public IList<VirtualMachineSoftwarePatchProperties> AvailablePatches { get; private set; }
public ApiError Error { get; set; }
Copy link
Member

Choose a reason for hiding this comment

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

Please write a test for this as the initial functionality seems to have never been tested as this issue would have been caught back then.

@@ -29,7 +29,7 @@ public class PSVirtualMachinePatchAssessmentResult
public int? CriticalAndSecurityPatchCount { get; set; }
public int? OtherPatchCount { get; set; }
public DateTime? StartDateTime { get; set; }
Copy link
Member

Choose a reason for hiding this comment

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

you need to add a breaking change suppression to this file:
tools/StaticAnalysis/Exceptions/Az.Compute/BreakingChangeIssues.csv

and add a description to this PR describing why you need to do this and it is not really a breaking change.

@dolauli dolauli removed their assignment Aug 29, 2024
Copy link

This PR was labeled "needs-revision" because it has unresolved review comments or CI failures.
Please resolve all open review comments and make sure all CI checks are green. Refer to our guide to troubleshoot common CI failures.

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.

Unable to get the list of patches while running Invoke-AzVMPatchAssessment
5 participants