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

Fix import path for Support Initialize-SCuBA #1363

Conversation

schrolla
Copy link
Collaborator

@schrolla schrolla commented Oct 10, 2024

🗣 Description

Add fixes to resolve the error that is thrown during an Initiailze-SCuBA cmdlet run after installing ScubaGear from its nuget package (via PSGallery).

💭 Motivation and context

Prevents extraneous error and red text from being thrown during ScubaGear initialization.

Closes #1361

🧪 Testing

  1. Start with a clean test system without ScubaGear or its dependencies installed.
  2. Run Install-Module -Name ScubaGear -AllowPrerelease -RequiredVersion 1.4.0-test2024101002 (note: this module version corresponds to a packaging of the PR fix branch)
  3. Run Initialize-SCuBA and review output for presence of red text shown in screenshot below.

📷 Screenshots (if appropriate)

Showing the issue when present (the red text should not be present in the fix)
UnexpectedSGInitializePSGallery

✅ 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

✅ 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.

@schrolla schrolla added the bug This issue or pull request addresses broken functionality label Oct 10, 2024
@schrolla schrolla added this to the Jellyfish milestone Oct 10, 2024
@schrolla schrolla self-assigned this Oct 10, 2024
@schrolla schrolla linked an issue Oct 10, 2024 that may be closed by this pull request
@schrolla
Copy link
Collaborator Author

A more complete fix for overall module issues is documented in #1347 . This PR addresses the immediate associated smaller issue.

@schrolla schrolla requested review from dagarwal-mitre and buidav and removed request for buidav October 10, 2024 18:27
@schrolla schrolla marked this pull request as ready for review October 10, 2024 18:29
@schrolla
Copy link
Collaborator Author

Feature branch currently fails functional testing workflow due to Get-Module ScubaGear being called when the workflow hasn't imported the module. Thus causing the path construction for Import-Module to fail. Working to resolve.

Copy link
Collaborator

@buidav buidav left a comment

Choose a reason for hiding this comment

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

Error seems to be gone from both the release package import via terminal and the PSGallery install.
Functional tests are unaffected by this change (still some failures with SharePoint but that's unrelated to this issue).
Good to go.

@schrolla
Copy link
Collaborator Author

Error seems to be gone from both the release package import via terminal and the PSGallery install. Functional tests are unaffected by this change (still some failures with SharePoint but that's unrelated to this issue). Good to go.

Re-ran failed functional tests to validate that they were due to unrelated intermittent failures. All functional tests are now green.

Copy link
Collaborator

@dagarwal-mitre dagarwal-mitre left a comment

Choose a reason for hiding this comment

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

Looks good, I wasn't able to recreate the error now!

@schrolla
Copy link
Collaborator Author

@nanda-katikaneni The bug fix has been thoroughly reviewed and tested and is ready for merge.

@nanda-katikaneni nanda-katikaneni merged commit df1c21d into main Oct 11, 2024
60 checks passed
@nanda-katikaneni nanda-katikaneni deleted the 1361-initialize-scuba-throws-cannot-find-module-error-in-140-rc5 branch October 11, 2024 14:41
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.

Initialize-SCuBA throws cannot find module error in 1.4.0-rc5
4 participants