thoth-station / prescriptions

⚕️💊 Prescriptions to heal your applications and application dependencies 💊⚕️
https://thoth-station.ninja/docs/developers/adviser/prescription.html
GNU Affero General Public License v3.0
17 stars 10 forks source link

Fix existing prescriptions #38952

Closed VannTen closed 1 year ago

VannTen commented 1 year ago

Related Issues and Dependencies

part of thoth-station/adviser#2402 …

This introduces a breaking change

This should yield a new module release

This Pull Request implements

Thix fixes a bunch o files containing metadata in incorrect places

There is still 274 other invalid prescriptions files in the repo, which appears to be mostly scorecard prescriptions, (for which we have no schema in adviser). For example:

2023-01-24 11:55:50,051 79753 ERROR    thoth.adviser.prescription.v1.prescription:305: prescriptions/up_/update-checker/scorecards_code_review.yaml is invalid:
extra keys not allowed @ data['units']['wraps'][0]['run']['justification'][0]['project_revision']. Got '2f3b1db5ae816cb3d9c7ad65c3d3a955e4b8197d'
extra keys not allowed @ data['units']['wraps'][0]['run']['justification'][0]['project_url']. Got 'github.com/bboe/update_checker'
extra keys not allowed @ data['units']['wraps'][0]['run']['justification'][0]['scorecard_score']. Got 1
extra keys not allowed @ data['units']['wraps'][0]['run']['justification'][0]['tag']. Got 'no-code-review'
2023-01-24 11:55:50,138 79753 ERROR    thoth.adviser.prescription.v1.prescription:305: prescriptions/su_/subprocess32/scorecards_cii_best_practices.yaml is invalid:
extra keys not allowed @ data['units']['wraps'][0]['run']['justification'][0]['project_revision']. Got 'b63954f56166eca312afb70b6d3a4af1128f81f3'
extra keys not allowed @ data['units']['wraps'][0]['run']['justification'][0]['project_url']. Got 'github.com/google/python-subprocess32'
extra keys not allowed @ data['units']['wraps'][0]['run']['justification'][0]['scorecard_score']. Got 0
extra keys not allowed @ data['units']['wraps'][0]['run']['justification'][0]['tag']. Got 'no-cii'
2023-01-24 11:55:50,153 79753 ERROR    thoth.adviser.prescription.v1.prescription:305: prescriptions/as_/astroplan/scorecards_branch_protection.yaml is invalid:
extra keys not allowed @ data['units']['wraps'][0]['run']['justification'][0]['project_revision']. Got '920f189701b03f13ff3328bca51d95cc858bcd34'
extra keys not allowed @ data['units']['wraps'][0]['run']['justification'][0]['project_url']. Got 'github.com/astropy/astroplan'
extra keys not allowed @ data['units']['wraps'][0]['run']['justification'][0]['scorecard_score']. Got 0
extra keys not allowed @ data['units']['wraps'][0]['run']['justification'][0]['tag']. Got 'no-branch-protection'

(if you want to test the validation : get latest master of adviser, merge thoth-station/adviser#2411 in your local branch, then run pre-commit try-repo path/to/adviser/repo validate-prescriptions --verbose --all-files in the prescription repo )

@goern

What do we do with the scorecards prescriptions for now ?

VannTen commented 1 year ago

Fixed some other oddities in the last commit and confirmed : we have 264 scorecards prescriptions with no schema, which are currently by definition invalid.

Proposed solution: Remove all of them temporarily, once we had validation support revert the removal commit. @goern @codificat @harshad16 advices ?

goern commented 1 year ago

sounds good to me, pls create a tracker issue for the backlog so that we don't forget about adding them again...

goern commented 1 year ago

/lgtm /approve

sesheta commented 1 year ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: goern

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/blob/master/OWNERS)~~ [goern] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment