ministryofjustice / modernisation-platform

A place for the core work of the Modernisation Platform • This repository is defined and managed in Terraform
https://user-guide.modernisation-platform.service.justice.gov.uk
MIT License
680 stars 290 forks source link

Refactor instance-scheduler to make the code DRY #5039

Open ewastempel opened 1 year ago

ewastempel commented 1 year ago

User Story

The instance scheduler supports RDS instances scheduling now, but there is a lot of code repetition. See if you can introduce a Instance interface type that will serve both EC2 and RDS clients and replace the common functions with methods. Note there is an equal amount of repetition in tests too. This will also need updating as we change the main code.

User Type(s)

Modernisation Platform Engineer

Value

DRY code

Assumptions / Hypothesis / Questions / Unknowns

Proposal

Extracting common functions for EC2 and RDS and passing client as a variable.

Unknowns

Is it possible?

Definition of done

Reference

How to write good user stories

ewastempel commented 1 year ago

Blocked until https://github.com/ministryofjustice/modernisation-platform/issues/4673 is resolved