Writes the rules pulled from our Google sheet into the database when /refresh endpoint is hit on the management service.
We write everything that we currently pull from the sheet, but it's worth noting that some fields that do exist in the sheet are currently ignored – for example, notes and tags. We'll want to include them soon.
How to test
The automated tests should pass. They test the DB write/read logic.
Using the steps mentioned in https://github.com/guardian/typerighter/pull/229, make a POST request to the /refresh endpoint and inspect the database. It should contain all of the sheet's rules.
Have we considered potential risks?
We want to ensure that the same data is read from the DB as it is from the sheet, so we have a few checks –
a test writes random rules and reads them, and compares the result.
we compare the rules we've retrieved from the database to the ones we wrote, and halt execution with an error if there's any discrepancy.
What does this change?
Writes the rules pulled from our Google sheet into the database when
/refresh
endpoint is hit on the management service.We write everything that we currently pull from the sheet, but it's worth noting that some fields that do exist in the sheet are currently ignored – for example, notes and tags. We'll want to include them soon.
How to test
/refresh
endpoint and inspect the database. It should contain all of the sheet's rules.Have we considered potential risks?
We want to ensure that the same data is read from the DB as it is from the sheet, so we have a few checks –