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

Generate third-party snapshots and reports #40

Merged
merged 16 commits into from
Nov 7, 2019

Conversation

dav3r
Copy link
Member

@dav3r dav3r commented Oct 31, 2019

This PR updates extras/create_snapshots_reports_scorecard.py with the ability to fetch a list of third-party report organization IDs (via a newly-created report type "CYHY_THIRD_PARTY" - see cisagov/cyhy-core#35), then create snapshots and reports for those third-parties.

Notes:

  • The snapshots that are created for third-parties use the --use-only-existing-snapshots flag, which means that the third-party snapshot will simply roll up the results from the latest snapshot for each child of the third-party org. This avoids the undesirable situation where an org gets one snapshot created for it's own report and a second snapshot created for the third-party report.
  • The third-party reports are logged in the reports collection, just like regular customer CyHy reports are.
  • I blackened create_snapshots_reports_scorecard.py, so you may find it easier to review these changes in the individual commits.

For additional details, refer to CYHYDEV-780.

@dav3r dav3r self-assigned this Oct 31, 2019
Copy link
Member

@mcdonnnj mcdonnnj left a comment

Choose a reason for hiding this comment

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

Seems logical and well thought out. Nice work 👍 Just a couple minor quibbles.

Also I'm not sure if it's worth it, but I do wonder if we should do a pass at some point to make the string formatting methods uniform. The older code is using printf style and newer pieces (including what you've added) uses the str.format() style. Just something to consider.

extras/create_snapshots_reports_scorecard.py Outdated Show resolved Hide resolved
extras/create_snapshots_reports_scorecard.py Outdated Show resolved Hide resolved
Copy link
Member Author

@dav3r dav3r left a comment

Choose a reason for hiding this comment

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

Also I'm not sure if it's worth it, but I do wonder if we should do a pass at some point to make the string formatting methods uniform. The older code is using printf style and newer pieces (including what you've added) uses the str.format() style. Just something to consider.

I don't disagree with you @mcdonnnj, but I didn't want to spend any more time touching code that was unaffected by this change. Some things will just have remain ugly for now.

Copy link
Member

@felddy felddy left a comment

Choose a reason for hiding this comment

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

Approved. Just needs some info on that SSM thang.

extras/create_snapshots_reports_scorecard.py Outdated Show resolved Hide resolved
extras/create_snapshots_reports_scorecard.py Outdated Show resolved Hide resolved
extras/create_snapshots_reports_scorecard.py Show resolved Hide resolved
Copy link
Member

@jsf9k jsf9k left a comment

Choose a reason for hiding this comment

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

🥇

extras/create_snapshots_reports_scorecard.py Show resolved Hide resolved
@dav3r dav3r merged commit 8c6b1ae into develop Nov 7, 2019
@dav3r dav3r deleted the improvement/support_third_party_reports branch November 7, 2019 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants