ministryofjustice / operations-engineering

This repository is home to the Operations Engineering's tools and utilities for managing, monitoring, and optimising software development processes at the Ministry of Justice. • This repository is defined and managed in Terraform
https://user-guide.operations-engineering.service.justice.gov.uk/
MIT License
14 stars 5 forks source link

Enhance Support Stats reporting - using an S3 bucket to store and append .csv file #4356

Open andyrogers1973 opened 7 months ago

andyrogers1973 commented 7 months ago

Replaces https://github.com/ministryofjustice/operations-engineering/issues/4209 which has been broken down into smaller tickets.

Related to https://github.com/ministryofjustice/operations-engineering/issues/4350 and https://github.com/ministryofjustice/operations-engineering/issues/4353 which change and test the data format Support Request stats are reported in.

This ticket is to look at the possibility of storing the Support Requests stats reporting data in an S3 bucket.

To achieve this:

Considered done when:

andyrogers1973 commented 2 weeks ago

Investigating how to create an s3 bucket via code.

Started writing script to pull csv file from s3, upload amended csv to s3 from repo.

Figuring out the workflow - best way to update the csv file with new data, is this via the Google sheet (current method) or find a new way (maybe with web front end and db, edit csv in the repo?)

andyrogers1973 commented 1 day ago

Example of how data can be added as a new file and Athena is used to create a table from all the files: https://github.com/moj-analytical-services/lookup_offence/blob/main/.github/scripts/deploy.py

andyrogers1973 commented 1 day ago

Understanding the method used in the example above and how to implement this for support stats

andyrogers1973 commented 11 hours ago

Draft PR for first version of the s3 upload script #72

andyrogers1973 commented 11 hours ago

Have now updated the script with changes:

andyrogers1973 commented 11 hours ago

Added a timestamp variable. Use this variable to create in the write_path for the latest csv update

andyrogers1973 commented 10 hours ago

Create s3 bucket for support stats:

operations-engineering-support-request-stats

andyrogers1973 commented 9 hours ago

Added support_request_stats.json to create the table schema