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

Only explicitly install dependencies for Scuba #946

Conversation

crutchfield
Copy link
Contributor

@crutchfield crutchfield commented Feb 28, 2024

🗣 Description

Change ScubaGear module to not automatically install dependencies. Checks if they are missing on import and advised user to use Initialize-SCuBA to add them.

closes #931

💭 Motivation and context

The import of Scuba caused dependencies to be checked/installed each time it is imported. This check took time (<2 minute) that impacts testing.

🧪 Testing

  • Ran import of scuba with missing modules, verify warning
  • Ran scuba with all module, verify no warning
  • Ran scuba against tenant after import, verified expected results.
  • Ran Smoke Test
  • Nightly build is failing but is failing in main with same error.

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

@crutchfield crutchfield added the enhancement This issue or pull request will add new or improve existing functionality label Feb 28, 2024
@crutchfield crutchfield added this to the Glacier milestone Feb 28, 2024
@crutchfield crutchfield self-assigned this Feb 28, 2024
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.

Quick line of feedback before I can test this out.
Update the README to match the new Initialize process.
updatedREADME

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.

One small documentation change to help with clarity of usage. Change functions as expected and resolves the issue of running setup actions with each import well.

README.md Outdated Show resolved Hide resolved
PowerShell/ScubaGear/Dependencies.ps1 Outdated Show resolved Hide resolved
@crutchfield crutchfield force-pushed the 931-prevent-initalize-scuba-from-executing-on-each-scubagear-module-import branch from 178d41f to 438537a Compare March 1, 2024 12:33
README.md Outdated Show resolved Hide resolved
@james-garriss james-garriss mentioned this pull request Mar 5, 2024
14 tasks
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.

Approved with one minor suggestion fix for the README.

Also, we should include a section in the README for installing from PowerShell Gallery once the finishing touches are done with that.

README.md Outdated Show resolved Hide resolved
crutchfield and others added 10 commits March 6, 2024 06:41
Co-authored-by: David Bui <105074908+buidav@users.noreply.github.com>
Co-authored-by: Addam Schroll <108814318+schrolla@users.noreply.github.com>
Co-authored-by: David Bui <105074908+buidav@users.noreply.github.com>
@crutchfield crutchfield force-pushed the 931-prevent-initalize-scuba-from-executing-on-each-scubagear-module-import branch from f7435e9 to f1408bd Compare March 6, 2024 11:45
@crutchfield
Copy link
Contributor Author

@nanda-katikaneni PR ready to merge to main. Smoke test failure is for know g3 tenant issue.

@nanda-katikaneni nanda-katikaneni merged commit 4e49f2b into main Mar 6, 2024
14 checks passed
@nanda-katikaneni nanda-katikaneni deleted the 931-prevent-initalize-scuba-from-executing-on-each-scubagear-module-import branch March 6, 2024 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This issue or pull request will add new or improve existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prevent Initalize-SCuBA from executing on each ScubaGear module import
4 participants