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

Dates on output files #15

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

cmcmenamin
Copy link

Files generated with export_report_data.py now prepend all filenames with the value of "output_report_name" (specified in export_report_data_config.json). This can be used to add YYYY-MM to the start of reports.

Example usage:

  1. Run CWAC scan
  2. Configure export_report_data_config.json to ingest the new data in ./results/
  3. In export_report_data_config.json, set the value of output_report_name to the YYYY-MM date of the scan i.e. 2024-11
  4. All files export_report_data.py generates will have the output_report_name prepended.
  5. Note: I recommend prepending YYYY-MM dates to the files, as this enables you to easily sort output files by date - putting the date at the end of the filename makes it way harder to chronologically sort data.

Other changes:

  1. Updated pip dependencies in requirements.txt to latest versions
  2. Tidied up element_audit.py which had several unused imports, incorrect logging formats etc.
  3. Updated to latest axe-core version

Reports generated using export_report_data.py now prepend the output filenames with the value of "output_report_name" within export_report_data_config.json. This can be used to add YYYY-MM to the start of reports.
Copy link
Contributor

@iggy-m iggy-m left a comment

Choose a reason for hiding this comment

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

JSON is hardcoded and needs to be dynamic for automation purposes.

"input_results_folder_name": "source_folder",
"output_report_name": "09-2024",
"input_results_folder_name": "results_folder_name_here",
"output_report_name": "2024-09",
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi Callum, this is a minor twist in the code.
What I was considering was something along the lines of:

from datetime import date
today = str(date.today())

and plug today in to "output_report_name"

Since import json package is already initialised
all we have to do is change the value of "output_report_name" data key

data["output_report_name"] = today

This way, its all automated and won't need manual intervention on the config file whenever we run a monthly CWAC scan.

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.

2 participants