-
Notifications
You must be signed in to change notification settings - Fork 242
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
Enhance csv version of output #1281
Conversation
Hey, @adhilto , did you look at the documentation to see if it needs to be updated IAW your coding changes? |
@adhilto , I noticed that you created Pester tests files for converting to CSV (ConvertTo-ResultsCsv.Tests.ps1) and for testing plain text formatting (Format-PlainText.Tests.ps1). Breaking out these tests seems like a great idea. It makes me wonder where the corresponding test files are for converting to other file formats and formatting them. I don't see any other files similar to these 2 and I intuit they should exist. If they should exist, but if they are out of scope for your issue, please create one or more other issues to ensure that we eventually get to feature testing parity. |
We do have test cases for the json ( |
Turns out there is, thanks for the reminder. I'll get that updated soon. |
Done |
In the docs I see this parameter: |
...yes. Let me try again. |
@james-garriss @buidav Ready for review again |
Formatting for TestResults.json is odd. Is it easy to do a pretty print before saving the file? |
TestResults.json needs to be added back the Reports page, as it's a report. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add these 3 columns to the final ScubaResults.csv?
If the formatting looks too off, adding a single space to each row of the new columns makes things clearer.
Also, we should highly encourage the -MergeJSON
flag then in the README. I would create a TODO issue for it as a placeholder until #1205 is complete.
Adding a note to relvant sections of the documation and adding the -MergeJson
flag in our Invoke-SCuBA
examples will do the trick.
I still feel like we are missing the right parameter. If someone wants a CSV output, then |
ScubaResults.json is now missing from the output, and there's the some weird repetitions in the output. (@adhilto , see Slack for details). |
Sorry, looks like I didn't explain the changes I made when I converted the PR back to a draft. The CSV output is no longer dependent on the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested results, works great, ty.
@nanda-katikaneni Ready for merge |
Merging into the main as the smoke test error is a known issue (related to the current state of E5 tenant and not related to the changes in this pr). |
🗣 Description
Remove the TestResults.csv file, which was just a csv version of the Rego output and replace it with a new csv which is structured the same way as the Results are in the html files.
💭 Motivation and context
Closes #1026
🧪 Testing
📷 Screenshots (if appropriate)
The old TestResults.csv, which looked like this:
Is replaced with the new ScubaResults.csv file looks like this:
✅ Pre-approval checklist
✅ 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