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

Create Json Output #970

Merged
merged 19 commits into from
Mar 12, 2024
Merged

Create Json Output #970

merged 19 commits into from
Mar 12, 2024

Conversation

adhilto
Copy link
Collaborator

@adhilto adhilto commented Mar 6, 2024

🗣 Description

Create a single json file (defaults to ScubaResults.json) that contains all of the ScubaGear output, including:

  • Metadata (date, tenant details, ScubaGear module version)
  • Json version of the html reports
  • Raw provider output

💭 Motivation and context

Closes #913.

🧪 Testing

  • Tested via Invoke-Scuba
  • Tested via Invoke-RunCached
  • Modified pester test cases

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

@adhilto adhilto added the enhancement This issue or pull request will add new or improve existing functionality label Mar 6, 2024
@adhilto adhilto requested review from crutchfield and buidav March 6, 2024 21:37
@adhilto adhilto self-assigned this Mar 6, 2024
@adhilto adhilto linked an issue Mar 6, 2024 that may be closed by this pull request
1 task
Copy link
Contributor

@crutchfield crutchfield 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 - two observations:

  1. The individual 'json' reports appear to be not needed - is it useful to clean them up.
  2. The defining of a function so it can be found to mock suggestion is optional. I have been changing them as I revisit tests.

…ke-RunCached.Tests.ps1

Co-authored-by: Richard Crutchfield <crutchfield@users.noreply.github.com>
@adhilto
Copy link
Collaborator Author

adhilto commented Mar 7, 2024

  1. The individual 'json' reports appear to be not needed - is it useful to clean them up.

David had a similar suggestion, so I will make that change.

He also recommended I add a switch to keep the size of the output down. If true, create the ScubaResults.json file and delete the redundant files (the individual jsons you mentioned and the provider output). If false, don't create ScubaResults.json, just execute as normal.

Unless you have any objections, I'll go ahead and make both changes.

@adhilto adhilto added this to the Glacier milestone Mar 7, 2024
@crutchfield
Copy link
Contributor

  1. The individual 'json' reports appear to be not needed - is it useful to clean them up.

David had a similar suggestion, so I will make that change.

He also recommended I add a switch to keep the size of the output down. If true, create the ScubaResults.json file and delete the redundant files (the individual jsons you mentioned and the provider output). If false, don't create ScubaResults.json, just execute as normal.

Unless you have any objections, I'll go ahead and make both changes.

Sounds good to me

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.

Looks good, however have one last comment.

PowerShell/ScubaGear/Modules/Orchestrator.psm1 Outdated Show resolved Hide resolved
Co-authored-by: David Bui <105074908+buidav@users.noreply.github.com>
@adhilto
Copy link
Collaborator Author

adhilto commented Mar 11, 2024

@nanda-katikaneni this PR is ready

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.

Create json version of html reports
4 participants