Skip to content
This repository has been archived by the owner on Feb 14, 2024. It is now read-only.

Update Command Line 'Usage' for pe-reports #72

Closed
wants to merge 25 commits into from

Conversation

schmelz21
Copy link
Collaborator

@schmelz21 schmelz21 commented Oct 1, 2021

🗣 Description

Proposed in issue - #54 (comment) to simplify command-line inputs and build continuity to both the pe-reports and pe-mailer module usage.

💭 Motivation and context

Implementation of the following 'Usage' would be applied. Updates are made specifically to pe-reports module.

Reports

Usage:
  pe-reports [--pe-report-dir=DIRECTORY] [--db-creds-file=FILENAME] [--log-level=LEVEL]

Arguments:
  -r --pe-report-dir=DIRECTORY  Directory containing the pe-reports output.
  -c --db-creds-file=FILENAME   A YAML file containing the Cyber
                                Hygiene database credentials.
                                [default: /secrets/database_creds.yml]
Options:
  -h --help                     Show this message.
  -v --version                  Show version information.
  --log-level=LEVEL             If specified, then the log level will be set to
                                the specified value.  Valid values are "debug", "info",
                                "warning", "error", and "critical". [default: info]

Mailer

Usage:
  pe-mailer [--pe-report-dir=DIRECTORY] [--db-creds-file=FILENAME] [--log-level=LEVEL]

Arguments:
  -r --pe-report-dir=DIRECTORY  Directory containing the pe-reports output.
  -c --db-creds-file=FILENAME   A YAML file containing the Cyber
                                Hygiene database credentials.
                                [default: /secrets/database_creds.yml]
Options:
  -h --help                     Show this message.
  -v --version                  Show version information.
  -s --summary-to=EMAILS        A comma-separated list of email addresses
                                to which the summary statistics should be
                                sent at the end of the run.  If not
                                specified then no summary will be sent.
  -t --test_emails=EMAILS       A comma-separated list of email addresses
                                to which to test email send process. If not
                                specified then no test will be sent.
  -l --log-level=LEVEL          If specified, then the log level will be set to
                                the specified value.  Valid values are "debug", "info",
                                "warning", "error", and "critical". [default: info]

So essentially to run these in sync the following cmd-lines could go:

% <Connect to CyHy DB>
% pe-reports -r /output_dir -c /connect_cyhy.yml
% <Load AWS SES Profile>
% pe-mailer -r /output_dir -c /connect_cyhy.yml

🧪 Testing

The following processes must run successfully
Install: pip install -e .
Tests: pytest /tests
Additionally pass all pre-commits
pre-commit run --all-files

% <Connect to CyHy DB>
% pe-reports -r /output_dir -c /connect_cyhy.yml
% <Load AWS SES Profile>
% pe-mailer -r /output_dir -c /connect_cyhy.yml

📷 Screenshots (if appropriate)

✅ Checklist

  • This PR has an informative and human-readable title.
  • Changes are limited to a single goal - eschew scope creep!
  • All future TODOs are captured in issues, which are referenced
    in code comments.
  • All relevant type-of-change labels have been added.
  • I have read the CONTRIBUTING 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.

@schmelz21 schmelz21 added improvement This issue or pull request will add or improve functionality, maintainability, or ease of use upstream update This issue or pull request pulls in upstream updates version bump This issue or pull request increments the version number labels Oct 1, 2021
@schmelz21 schmelz21 self-assigned this Oct 1, 2021
@coveralls
Copy link

coveralls commented Oct 1, 2021

Pull Request Test Coverage Report for Build 1296005731

  • 3 of 3 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 76.987%

Totals Coverage Status
Change from base Build 1291451750: 0.0%
Covered Lines: 174
Relevant Lines: 217

💛 - Coveralls

@schmelz21
Copy link
Collaborator Author

schmelz21 commented Oct 15, 2021

@cisagov/posture-and-exposure
Scope Update :
Add options to pe-reports module:

  • Report Date: Can run reports at any given period
  • Select Customer: Can do one offs or list of particular customers

Default - if no "Date" or "Customer" is listed in cmd-line args, the reports produced are from the last available reporting period and generated for all the customers.

@schmelz21 schmelz21 added invalid This issue or pull request is not applicable, incorrect, or obsolete wontfix This issue will not be incorporated and removed upstream update This issue or pull request pulls in upstream updates version bump This issue or pull request increments the version number labels Nov 8, 2021
@schmelz21
Copy link
Collaborator Author

Currently out of scope for next 2 sprints. A new solution may be occur due to change in priorities and code architecture.
#93

@schmelz21 schmelz21 closed this Nov 8, 2021
@schmelz21 schmelz21 deleted the ss-wip-cmd-line-update branch November 9, 2021 14:03
@stewartl97 stewartl97 moved this from TODO to DONE in Sprint 7 (12/1 - 12/31) Dec 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
improvement This issue or pull request will add or improve functionality, maintainability, or ease of use invalid This issue or pull request is not applicable, incorrect, or obsolete wontfix This issue will not be incorporated
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants