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

Update setup process and instructions #613

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

Conversation

adhilto
Copy link
Collaborator

@adhilto adhilto commented Feb 24, 2025

🗣 Description

Modified the installation process and documentation per feedback.

Coauthered by @atuomit.

Goals of these changes:

Specific changes:

  • The "~ /.scubagoggles" file is now "~/.scubagoggles/userdefaults.json"
  • The setup utility no longer prompts the user to input the OPA path, credentials path, or output path if not provided.
  • The parameters for the setupt utility have been renamed for consistency with the parameters used for scubagoggles gws
  • If not specified by the user, the OPA executable will be saved in ~/.scubagoggles/.
  • If not specified by the user, ScubaGoggles will expect the credentials as ./credentials.json.
  • If not specified by the user, ScubaGoggles will save the output in the current directory of the user calling ScubaGoggles.
  • All of the above defaults can be changed at any time by the user using the setup utility.
  • Documentation has been updated to reflect the above changes.

💭 Motivation and context

Closes #526.
Closes #531.

🧪 Testing

I recommend the reviewers start by following the README instructions as a new user would, specifically the 3 files listed under the "Installation" section of the README: https://github.com/cisagov/ScubaGoggles/blob/531-update-setup-instructions/README.md.

If you already have ScubaGoggles installed, first move the .scubagoggles file from your home directory. Since that was a text file and now is a folder, you will need to first move it before you can use the new setup util.

I performed the following tests:

  1. Run "scubagoggles setup" from a clean slate, with no prexisting user defaults file
  2. Run "scubagoggles setup" with a prexisting user defaults file
  3. Run "scubagoggles setup" with a ~/.scubagoggles text file setup by v0.4
  4. Run "scubagoggles setup -o [folder name]" with a folder that doesn't exist
  5. Run "scubagoggles setup -o [folder name]" with a folder that does exist
  6. Run "scubagoggles setup -o [folder name]" with a relative path
  7. Run "scubagoggles setup -r [folder name]" with a folder that does exist
  8. Run "scubagoggles setup -r [folder name]" with a folder that doesn't exist
  9. Run "scubagoggles setup -r [folder name] -nd" with a folder that doesn't exist
  10. Run "scubagoggles gws" when the opa folder is empty
  11. Run "scubagoggles setup -r [folder name]" where [folder name] is actually a file not a folder
  12. Run "scubagoggles setup -c [file name]" with a file that does exist
  13. Run "scubagoggles setup -c [file name]" with a file that doesn't exist
  14. Run "scubagoggles setup -c [file name] -nc" with a file that doesn't exist
  15. Run "scubagoggles gws" inside the ScubaGoggles folder without using setup util or cli args, verify that it looks for OPA exe in current dir, output goes to current dir, and it looks for creds in the current dir
  16. Run "scubagoggles gws"outside the ScubaGoggles folder without using setup util or cli args, verify that it looks for OPA exe in current dir, output goes to current dir, and it looks for creds in the current dir
  17. Run scubagoggles gws ... with ~/.scubagoggles as a text file from v0.4
  18. Run "scubagoggles gws -h" without running the setup util first
  19. Run "scubagoggles gws -h" after running the setup util
  20. Run scubagoggles gws ... with a value for the creds file defined in the user defaults file, verify that creds file is used
  21. Run scubagoggles gws ... with a value for the creds file defined in the user defaults file but override it with a config file
  22. Run scubagoggles gws ... with a value for the creds file defined in the user defaults file but override it on the commandline
  23. Run scubagoggles gws ... with cred path specified in the user defaults file that doesn't exist
  24. Run scubagoggles gws ... with opa path specified in the user defaults file that doesn't exist
  25. Run scubagoggles gws ... with output path specified in the user defaults file that doesn't exist
  26. Run scubagoggles gws ... with paths specified in the user defaults file that don't exist but overwritten with good paths as cli args
  27. Run scubagoggles setup when OPA exists in the path
  28. Run scubagoggles gws when OPA exists in the path but not in the current directory or defined in the user defaults

✅ Pre-approval checklist

  • This PR has an informative and human-readable title.
  • Changes are limited to a single goal - eschew scope creep!
  • If applicable, All future TODOs are captured in issues, which are referenced in the PR description.
  • The relevant issues PR resolves are linked preferably via closing keywords.
  • All relevant type-of-change labels have been added.
  • I have read and agree to the CONTRIBUTING.md document.
  • These code changes follow cisagov code standards.
  • All relevant repo and/or project documentation has been updated to reflect the changes in this PR.
  • Tests have been added and/or modified to cover the changes in this PR.
  • All new and existing tests pass.

✅ Pre-merge Checklist

  • This PR has been smoke tested to ensure main is in a functional state when this PR is merged.
  • Squash all commits into one PR level commit using the Squash and merge button.

✅ Post-merge Checklist

  • Delete the branch to clean up.
  • Close issues resolved by this PR if the closing keywords did not activate.

adhilto and others added 30 commits January 13, 2025 16:30
@adhilto adhilto added documentation This issue or pull request improves or adds to documentation enhancement labels Feb 24, 2025
@adhilto adhilto added this to the Eel milestone Feb 24, 2025
@adhilto adhilto requested review from rlxdev and snarve February 24, 2025 17:10
@adhilto adhilto self-assigned this Feb 24, 2025
@adhilto adhilto linked an issue Feb 24, 2025 that may be closed by this pull request
@adhilto adhilto changed the title 531 update setup instructions Update setup process and instructions Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation This issue or pull request improves or adds to documentation enhancement
Projects
None yet
2 participants