-
Notifications
You must be signed in to change notification settings - Fork 238
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
Remove reference to removed VersionCheckFile #1481
base: main
Are you sure you want to change the base?
Conversation
@twneale Testing section should also include how the reviewers can test the code. Also, have you tested it when running from the ZIP to see if it's fully resolved there too? |
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.
The removal of the test code is perfect. But while reviewing I had some other suggestions and a possible bug that requires more extensive changes. See comments below.
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.
I believe the function Invoke-CheckScubaGearVersionPSGallery
will fail if more than one version of ScubaGear is installed as the Get-Module
will return an array rather than a single object causing the .Version
field access to fail on the array and throw an exception.
I think a better approach would be to check if an array is returned, and select the highest version in the list as the installed version. Also, InstalledHighestVersion
might be a better var name in this case as CurrentVersion
is ambigious.
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.
Recommend the function Invoke-CheckScubaGearVersionPSGallery
name remove the PSGallery portion as, on fail, it checks GitHub as well, so it's really just the overall check. If you want a PSGallery specific function, then factor that out of the current function and call it as such using the return code to determine if the GitHub function needs to be called.
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.
The GitHub version check should be the same as the PSGallery check by coercing the version strings into System.Version types and comparing rather than relying on a string -ne
operator. Both for consistency, and to allow pre-release versions that are newer than the Github release to not trigger the message.
Improved verbiage Co-authored-by: Addam Schroll <108814318+schrolla@users.noreply.github.com>
Fix Version Check Path Bug
The version check code has a reference to a removed variable still present. This PR deletes it and closes #1480
🗣 Description
Deleted two lines of code writing out the version check file, which was removed for Kraken.
💭 Motivation and context
Currently this bug causes a error and stack trace on import.
🧪 Testing
Installed from PSGallery and imported ScubaGear.
✅ Pre-approval checklist
✅ Pre-merge checklist
PR passed smoke test check.
Feature branch has been rebased against changes from parent branch, as needed
Use
Rebase branch
button below or use this reference to rebase from the command line.Resolved all merge conflicts on branch
Notified merge coordinator that PR is ready for merge via comment mention
Demonstrate changes to the team for questions and comments.
(Note: Only required for issues of size
Medium
or larger)✅ Post-merge checklist