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

Remove reference to removed VersionCheckFile #1481

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

twneale
Copy link
Collaborator

@twneale twneale commented Dec 19, 2024

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.
Closes #1480

🧪 Testing

Installed from PSGallery and imported ScubaGear.

✅ Pre-approval checklist

  • This PR has an informative and human-readable title.
  • PR targets the correct parent branch (e.g., main or release-name) for merge.
  • Changes are limited to a single goal - eschew scope creep!
  • Changes are sized such that they do not touch excessive number of files.
  • All future TODOs are captured in issues, which are referenced in code comments.
  • These code changes follow the ScubaGear content style guide.
  • Related issues these changes resolve are linked preferably via closing keywords.
  • All relevant type-of-change labels added.
  • All relevant project fields are set.
  • All relevant repo and/or project documentation updated to reflect these changes.
  • Unit tests added/updated to cover PowerShell and Rego changes.
  • Functional tests added/updated to cover PowerShell and Rego changes.
  • All relevant functional tests passed.
  • All automated checks (e.g., linting, static analysis, unit/smoke tests) passed.

✅ 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

  • Feature branch deleted after merge to clean up repository.
  • Verified that all checks pass on parent branch (e.g., main or release-name) after merge.

@twneale twneale added the bug This issue or pull request addresses broken functionality label Dec 19, 2024
@twneale twneale self-assigned this Dec 19, 2024
@twneale twneale requested review from schrolla and tkol2022 December 19, 2024 19:34
@schrolla schrolla changed the title Deleted reference to removed VersionCheckFile Remove reference to removed VersionCheckFile Dec 19, 2024
@schrolla
Copy link
Collaborator

@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?

@schrolla schrolla modified the milestones: Kraken, Lionfish Dec 19, 2024
Copy link
Collaborator

@schrolla schrolla left a 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.

PowerShell/ScubaGear/CheckVersion.ps1 Show resolved Hide resolved
PowerShell/ScubaGear/CheckVersion.ps1 Show resolved Hide resolved
PowerShell/ScubaGear/CheckVersion.ps1 Outdated Show resolved Hide resolved
PowerShell/ScubaGear/CheckVersion.ps1 Show resolved Hide resolved
Improved verbiage

Co-authored-by: Addam Schroll <[email protected]>
@twneale twneale requested review from buidav and removed request for tkol2022 December 23, 2024 18:02
@twneale
Copy link
Collaborator Author

twneale commented Jan 2, 2025

@schrolla what would you think about checking PSGallery and comparing it to the module manifest version of the running ScubaGear rather than querying the installed versions and getting the latest? This way it would still work when running as a git checkout. Otherwise, running from a latest git checkout can result in an inaccurate warning to "upgrade" to a lower version. Instead of trying to guess whether it was installed from PSGallery or a GitHub zip, we could just warn that newer releases are available from both PSGallery and Github. Watcha think?

@schrolla
Copy link
Collaborator

schrolla commented Jan 2, 2025

@schrolla what would you think about checking PSGallery and comparing it to the module manifest version of the running ScubaGear rather than querying the installed versions and getting the latest? This way it would still work when running as a git checkout. Otherwise, running from a latest git checkout can result in an inaccurate warning to "upgrade" to a lower version. Instead of trying to guess whether it was installed from PSGallery or a GitHub zip, we could just warn that newer releases are available from both PSGallery and Github. Watcha think?

Yes, I think that's a reasonable way of checking since checking the manifest based on the PSScriptRoot of the running version check script makes it a direct comparison between the published available version and the running version. Whether you check GitHub or PSGallery for the comparison it doesn't much matter as they should be the same and are both official. I'd slightly prefer checking GitHub as that's the official release and PSGallery is just our package distribution mechanism which could (although not likely for now) change over time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue or pull request addresses broken functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ScubaGear throws warning during update check due to null path
2 participants