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

Generated prescription do not match the expected schema #205

Closed codificat closed 1 year ago

codificat commented 1 year ago

Describe the bug

Currently, this job is generating prescriptions that do not match the schema

To Reproduce

See PRs generated by recent executions of this job, for example https://github.com/thoth-station/prescriptions/pull/38943/files

Expected behavior

Prescriptions generated by this job should not fail validation

Screenshots

The prescription file referenced above:

units:
  wraps:
  - name: PydeconzGitHubURLWrap
    type: wrap
    should_include:
      adviser_pipeline: true
    match:
      state:
        resolved_dependencies:
        - name: pydeconz
    run:
      justification:
      - type: INFO
        message: Package 'pydeconz' is hosted on GitHub
        link: https://github.com/Kane610/deconz
        package_name: pydeconz
        metadata:
        - prescriptions_repository: git@github.com:thoth-station/prescriptions.git
          prescriptions_version: 0.8.0

Note that the metadata is not in the location expected by the schema.

Additional context

Prescription metadata was introduced in #155.

Currently, the prescriptions in the prescription repo do not match validation. thoth-adviser is stuck at using v0.22.0. See https://github.com/thoth-station/adviser/issues/2402

VannTen commented 1 year ago

Do we have other errors than just the metadata being in the wrong place ?

codificat commented 1 year ago

Do we have other errors than just the metadata being in the wrong place ?

Not that I'm aware of. But I have only checked a very limited number of prescriptions.

One problem/challenge here is that, as far as I can tell, thoth-adviser validate-prescriptions errors out on the first validation failure and stops. If there was a way to make it show all the errors, we would be sure

VannTen commented 1 year ago

Do we have other errors than just the metadata being in the wrong place ?

Not that I'm aware of. But I have only checked a very limited number of prescriptions.

One problem/challenge here is that, as far as I can tell, thoth-adviser validate-prescriptions errors out on the first validation failure and stops. If there was a way to make it show all the errors, we would be sure

No problems with that, with the pre-commit modification it does not error out (when using the --pre-commit flag). Even if it does not work in the CI with adviser packaging problems I can make it work locally to validate we have a sane DB once I figure out the magic yq recipe to fixing the metadata ones.

VannTen commented 1 year ago

We do in fact have other errors. Scorecards related stuff is in prescription but not in the schemas... Other metadata but in other places...

It's going to be tricky.

One solution is to delete all faulty prescriptions. Too radical ?