Skip to content

[Az.Tools.Installer]: Updates for a new minor/patch version #20022

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

Merged
merged 10 commits into from
Nov 17, 2022

Conversation

matsest
Copy link
Contributor

@matsest matsest commented Nov 3, 2022

Description

There hasn't been a release for Az.Tools.Installer for a long time (0.2.0) - even with changes being made to it several months ago - so adding a few updates to hopefully make it ready for a new release.

Checklist

  • SHOULD select appropriate branch. Cmdlets from Autorest.PowerShell should go to generation branch.
  • SHOULD make the title of PR clear and informative, and in the present imperative tense.
  • SHOULD update ChangeLog.md file(s) appropriately
    • For any service, the ChangeLog.md file can be found at 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. Add changelog in description section if PR goes into generation branch.
    • Should not change ChangeLog.md if no new release is required, such as fixing test case only.
  • SHOULD have approved design review for the changes in this repository (Microsoft internal only) with following situations
    • Create new module from scratch
    • Create new resource types which are not easy to conform to Azure PowerShell Design Guidelines
    • Create new resource type which name doesn't use module name as prefix
    • Have design question before implementation
  • SHOULD regenerate markdown help files if there is cmdlet API change. Instruction
  • SHOULD have proper test coverage for changes in pull request.
  • SHOULD NOT introduce breaking changes in Az minor release except preview version.
  • SHOULD NOT adjust version of module manually in pull request

@ghost ghost added the customer-reported label Nov 3, 2022
@ghost
Copy link

ghost commented Nov 3, 2022

Thank you for your contribution matsest! We will review the pull request and get back to you soon.

@Nickcandy
Copy link
Contributor

Changing parameters to mandatory would cause a breaking change which is not allowed in regular releases. Is that right? @BethanyZhou

@BethanyZhou
Copy link
Contributor

Changing parameters to mandatory would cause a breaking change which is not allowed in regular releases. Is that right? @BethanyZhou

That's true for module with stable version. Az.Tools.Installer is under preview, its version is 0.2.0, That's fine to include breaking changes.

@msJinLei
Copy link
Contributor

msJinLei commented Nov 7, 2022

/azp list

@azure-pipelines
Copy link
Contributor

@@ -55,7 +55,7 @@

# Assemblies that must be loaded prior to importing this module
RequiredAssemblies = @(
'.\assembly\Microsoft.ApplicationInsights.2.12.0\Microsoft.ApplicationInsights.dll'
'.\assembly\Microsoft.ApplicationInsights.2.21.0\Microsoft.ApplicationInsights.dll'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let me know if this should not be updated (I see that it failed some tests in ADO, but I can't see where the relevant test is specified)

Copy link
Contributor

@msJinLei msJinLei Nov 9, 2022

Choose a reason for hiding this comment

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

Let me know if this should not be updated (I see that it failed some tests in ADO, but I can't see where the relevant test is specified)

Hi @matsest, Welcome to contribute to Az.Tools.Installer!

The pipeline fails of other reasons. We are fixing it.
However, we still cannot upgrade ApplicationInsights to the latest version for PowerShell 7.0+ cannot support it. I have change the version to 2.13.1.

I also revert the change of Repository for we keep the parameter as optional to be consistent with PowerShellGet. To clarify the ambiguity, I add more explanation in the help message.

I remove the Az.Tools.Installer-help.xml for we will generate it every time we release a new version.

Please review the change I've made.

Copy link
Contributor Author

@matsest matsest Nov 9, 2022

Choose a reason for hiding this comment

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

@msJinLei Thanks for the updates on ApplicationInsights

I also revert the change of Repository for we keep the parameter as optional to be consistent with PowerShellGet. To clarify the ambiguity, I add more explanation in the help message.

With removal of the mandatory value the linked issue will however not be resolved as I see the behaviour when it's not given is:

$ Update-AzModule

Find-Module: Cannot validate argument on parameter 'Repository'. The argument is null, empty, or an element of the argument collection contains a
null value. Supply a collection that does not contain any null values and then try the command again.

PropertyNotFoundException: The property 'Version' cannot be found on this object. Verify that the property exists.

InvalidArgument: /home/matsest/personal/azure-powershell/tools/Az.Tools.Installer/exports/Update-AzModule.ps1:94
Line |
  94 |  … eUpdateTable = $modulesToUpdate | Foreach-Object { [PSCustomObject]@{
     |                                                       ~~~~~~~~~~~~~~~~~~
     | Cannot convert value "0" to type "System.Version". Error: "Version string portion was too short or too long. (Parameter 'input')"

If it's not desirable to be mandatory, should this error be catched?

If only one repository is registered in PowerShell, Install-AzModule will use it.

I can't see that this is the implemented behaviour? (see comment below)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For reference, I do only have one repository:

$ Get-PSRepository

Name                      InstallationPolicy   SourceLocation
----                      ------------------   --------------
PSGallery                 Trusted              https://www.powershellgallery.com/api/v2

Copy link
Contributor

Choose a reason for hiding this comment

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

@matsest Could you report the issue here https://github.com/Azure/azure-powershell/issues? Thanks

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@msJinLei I would assume the issue already listed in the description of this PR is covering this sufficiently - see #19839

Let me know if there should be created another one

Copy link
Contributor

Choose a reason for hiding this comment

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

OK. I will check it later.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@msJinLei I see this was merged but the issue regarding the Repository parameter was not resolved as I suggested. Https://github.com/Azure/azure-powershell/issues/19839 should be reopened..

Copy link
Contributor

@msJinLei msJinLei Nov 22, 2022

Choose a reason for hiding this comment

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

@msJinLei I see this was merged but the issue regarding the Repository parameter was not resolved as I suggested. Https://github.com/Azure/azure-powershell/issues/19839 should be reopened..

@matsest I created an issue for it #20209 and will fix it soon. Thanks for reporting.

msJinLei and others added 2 commits November 9, 2022 09:03
Revert the change of parameter `Repository`
@msJinLei msJinLei force-pushed the fix/az-tools-installer branch from c2e784c to 0c75308 Compare November 9, 2022 04:26
@msJinLei msJinLei added needs-author-feedback More information is needed from author to address the issue. and removed Do Not Merge 🚫 labels Nov 9, 2022
@msJinLei msJinLei removed the needs-author-feedback More information is needed from author to address the issue. label Nov 11, 2022
@Nickcandy
Copy link
Contributor

/azp run azure-powershell - security-tools

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 1 pipeline(s).

@msJinLei msJinLei merged commit 8872dfc into Azure:main Nov 17, 2022
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.

[Feature]: Improve error message for Az.Tools.Installer
4 participants