thoth-station / prescriptions-refresh-job

A periodic job to refresh Thoth's prescriptions
GNU General Public License v3.0
0 stars 7 forks source link

Validate prescriptions with adviser schema before creation #208

Closed VannTen closed 1 year ago

VannTen commented 1 year ago

Related Issues and Dependencies

related to #205

This introduces a breaking change

This should yield a new module release

This Pull Request implements

Validate the prescriptions before writing them. Crash otherwise

Follow-ups

Ideally, we should rather not use yaml at all in the Python code in the various handlers, but Python dicts/prescriptions dataclass (and yaml.dump() to the prescriptions files). However, this should at least stop the refresh job to add invalid prescriptions.

Currently the exception thrown if the content does not validate is not handled. How should we do that, log at CRITICAL then return false ?

codificat commented 1 year ago

/lgtm /approve

thanks!

sesheta commented 1 year ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: codificat

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/thoth-station/prescriptions-refresh-job/blob/master/OWNERS)~~ [codificat] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment