-
Notifications
You must be signed in to change notification settings - Fork 905
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
(#3477) Replace Get-ChecksumValid with Assert-ValidChecksum cmdlet. #3525
base: develop
Are you sure you want to change the base?
Conversation
There is one final matter to resolve before this PR is fully ready; help documentation for the cmdlet. I will have a corresponding PR opened on the docs repository by tomorrow, and then update the |
406ebb8
to
ce9d045
Compare
1627d8f
to
7574df1
Compare
After talking with @gep13 we have agreed it is best not to update the XML here at present, as it would require increasingly complicated messing around with the associated docs PRs as we rewrite more commands, and will instead opt to update the help XML file before a release artifact is created. |
a1983e4
to
f9be806
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you get this PR rebased onto the head of develop?
// Use the following format to provide a deprecation notice. If the new command name is an empty string, | ||
// the warning will inform the user it is to be removed instead of renamed. | ||
// | ||
// { "Deprecated-CommandName", "New-CommandName" }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the linked patch file in the PR description, there is an additional line to add to this _deprecatedCommandNames dictionary. What is the reason that this is not included in this PR? Just so that we can see it in action, before and after?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, just to demonstrate that it works, as we don't have any fully deprecated command names just yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could arguably mark anything we rename immediately as a deprecated name and just have it be aliased until next major version, but wasn't sure if we wanted to do that yet.
As a small convenience, to allow us to run tests for an invididual cmdlet when doing development testing.
This command replaces the Get-ChecksumValid helper function, adding an alias for compatibility purposes.
Add tests to ensure the behaviour of rewritten command matches the original behaviour.
When working on this, some irregularities were noted with the generation of the documentation, so these changes avoid the issues that arose.
This allows us to maintain a simple list of deprecated aliases and the new command name, or commands that are being removed, and automatically warn when that command is called.
f9be806
to
61cfde0
Compare
Description Of Changes
Get-ChecksumValid
Assert-ValidChecksum
This PR does not contain the compiled XML help information for the command. In discussion with @gep13 we agreed that it would be better to compile that in the final release. I will have a docs PR linked here in a moment, watch this space.
Note: As this PR is part of #3477 and is thus a breaking change to a degree, we will need to cut a
support/2.x
branch once this is merged, so that none of the breaking changes associated with #3477 inadvertently make their way into the 2.x versions.Motivation and Context
See #3477
Documentation PR: chocolatey/docs#1075
Testing
Tested locally with the accompanying Pester tests:
.\build.ps1
.\Invoke-Tests.ps1 -Tag AssertValidChecksum
Proving out the deprecated commands framework
After running the above, close and reopen the admin PowerShell session, and then follow these steps:
Get-ChecksumValid
and that the alias is deprecated and should be replaced withAssert-ValidChecksum
Operating Systems Testing
Windows 10
Change Types Made
Change Checklist
Related Issue
Part of #3477