zonemaster / zonemaster-backend

The Zonemaster Backend - part of the Zonemaster project
Other
14 stars 23 forks source link

Add custom field to test_results table #1116

Open matsduf opened 1 year ago

matsduf commented 1 year ago

When we run a batch test on the entire .se zone (or a random selection of that) we need to add registrar information for the interpretation of the result. For best performance we need that in the test_results table, but there is currently not place for that. We would like to have an extra field, preferably in JSON format to be able to add whatever subfields that we might need.

No other API calls need to support the custom data. For the use case, direct database queries are used to access the test results.

mattias-p commented 8 months ago

The biggest complaint I have about this is that it makes Backend into a datastore for business data of other applications. IMHO that's just not sound architecture.

Should we, however, decide that we do want other applications to store their stuff inside Backend I have three other complaints, but those are technical in nature and I'm providing an alternative design proposal that remedies them.

Technical complaints:

  1. In effect this would make the database schema into a public API. I don't think that's acceptable. This really needs to be accompanied with an extraction API.
  2. When this proposal was created the batch feature was intended for internal only use, but since the F2F in January 2024 we're adapting the batch API for public use. I believe we don't want to expose this feature to public users.
  3. This feature is about attaching a piece of client data to each job, but only when creating jobs as part of batches. If jobs have client data in our data model, we should really allow attaching client data when creating singular jobs too.

Design proposal: