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

Add action plan CSV #1351

Merged
merged 14 commits into from
Oct 8, 2024
Merged

Add action plan CSV #1351

merged 14 commits into from
Oct 8, 2024

Conversation

adhilto
Copy link
Collaborator

@adhilto adhilto commented Oct 3, 2024

🗣 Description

Remove the action plan columns from ScubaResults.csv, separate into separate ActionPlan.csv file.

💭 Motivation and context

Closes #1350

🧪 Testing

Testing I've manually performed:

  • Invoke-Scuba without modifying either CSV file name
  • Invoke-Scuba with -OutActionPlanFileName parameter
  • Invoke-Scuba with both -OutActionPlanFileName and -OutCsvFileName
  • Invoke-Scuba with -OutActionPlanFileName and -OutCsvFileName set equal to each other
  • Invoke-ScubaCached without modifying either CSV file name
  • Invoke-ScubaCached with -OutActionPlanFileName parameter
  • Invoke-ScubaCached with both -OutActionPlanFileName and -OutCsvFileName
  • Invoke-ScubaCached with -OutActionPlanFileName and -OutCsvFileName set equal to each other
  • Invoke-Scuba with both -OutActionPlanFileName and -OutCsvFileName set in a config file
  • Invoke-Scuba against a product configured to have no failing SHALL statements
  • Invoke-ScubaCached against a product configured to have no failing SHALL statements

✅ 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 Oct 3, 2024
@adhilto adhilto linked an issue Oct 3, 2024 that may be closed by this pull request
1 task
@adhilto adhilto self-assigned this Oct 3, 2024
@adhilto adhilto marked this pull request as ready for review October 3, 2024 22:38
@adhilto adhilto requested review from buidav and schrolla October 3, 2024 22:38
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.

Comments addressed from other channel.

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.

Noted an issue when identical filenames for different output files are used. Also some grammatical issues with documentation text.

I believe it would also make sense to add this new parameter to our sample config file(s) as well as updating it with the ScubaResults defaults in full_config.yaml.

docs/execution/reports.md Outdated Show resolved Hide resolved
docs/configuration/parameters.md Outdated Show resolved Hide resolved
PowerShell/ScubaGear/Modules/Orchestrator.psm1 Outdated Show resolved Hide resolved
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.

Updates addressed the previous concerns and comments. Unit tests pass and Invoke-SCuBA works as expected. New test for filename collision works as expected with variables defined in both config file or command line.

Copy link
Collaborator

@tkol2022 tkol2022 left a comment

Choose a reason for hiding this comment

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

Nice work Alden. I performed a cursory review given the timing of the PR and the end of the release. My comments assume that others will review and test the PR as well.
My recommendations are below:

  • Regression test the existing OutCsvFileName parameter to ensure it wasn’t broken.
  • Ensure that hands-on testing is performed and that the test scenarios include cases with the config file.

PowerShell/ScubaGear/Modules/Orchestrator.psm1 Outdated Show resolved Hide resolved
@adhilto adhilto added this to the Jellyfish milestone Oct 7, 2024
@adhilto
Copy link
Collaborator Author

adhilto commented Oct 7, 2024

Ensure that hands-on testing is performed and that the test scenarios include cases with the config file.

@tkol2022 Sorry I just now noticed that I forgot to fill in the Testing section of the PR description. I just updated it with the hands on testing I've performed.

@adhilto
Copy link
Collaborator Author

adhilto commented Oct 7, 2024

@tkol2022 I just added some new unit tests to test the OutCsvFileName and OutActionPlanFileName parameters. Ready for further review.

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.

Note some changes to make sure unit tests don't litter.

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.

Final unit test review item has been addressed. Looks good.

@schrolla
Copy link
Collaborator

schrolla commented Oct 8, 2024

@nanda-katikaneni The PR has been approved and is ready for merge.

@nanda-katikaneni nanda-katikaneni merged commit bb54d8c into main Oct 8, 2024
23 checks passed
@nanda-katikaneni nanda-katikaneni deleted the 1350-create-a-filtered-csv-file branch October 8, 2024 18:49
amart241 pushed a commit that referenced this pull request Jan 22, 2025
* Add ActionPlan csv

* Add ActionPlan.csv to reports.md

* Update parameters.md with OutPlanFileName

* Ensure the action plan file is still created even if all tests pass

* Unhardcode column names

* Add spaces to empty columns

* Minor documentation fixes

Co-authored-by: Addam Schroll <108814318+schrolla@users.noreply.github.com>

* Add OutPlanFileName to sample config files

* Error if OutPlanFileName and OutCsvFileName are equal

* Add missing newline to config

* Rename OutPlanFileName to OutActionPlanFileName

* Move OutActionPlanFileName documentation to appropriate spot in alphabetical order

* Add unit tests for OutCsvFileName and OutActionPlanFileName parameters

* Mock ConvertTo-ResultsCsv in Invoke-ScubaCached to prevent actual file creation in tests

---------

Co-authored-by: Addam Schroll <108814318+schrolla@users.noreply.github.com>
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 a Filtered CSV file that can be used to document an action plans
5 participants