Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VCIO-next: Design new Improver #1395

Closed
pombredanne opened this issue Jan 11, 2024 · 6 comments
Closed

VCIO-next: Design new Improver #1395

pombredanne opened this issue Jan 11, 2024 · 6 comments

Comments

@pombredanne
Copy link
Member

pombredanne commented Jan 11, 2024

Context

Improvers are scripts that take a bunch of objects as an input and can selectively improve the data about packages and vulnerabilities. The current design is that Importers create Advisories and then a "Default Improver" does an actual proper Import of the data through an intermediate "Inference" object.

Other improvers have the same overall model:

  • An Improver subclass implements an "interesting_advisories" method
  • And then implements a "get_inferences" method that takes AvisoryData (a plain object not a model instance) and yields Inferences

The management command will control all this.

Problem

With the current design, we cannot do several things:

  • We cannot improve if there are no advisories. For instance we cannot loop through some Package or Vulnerabilities
  • We cannot do arbitrary operations on the data: we must go through an Inference
  • We cannot control the frequency/periodicity at which we run improvers

Because of all this, there is also confusion in the community about how to add new improvers.

Solution

We should simplify improvers to the max.

An Improver should be a class that has a label, description and some run frequency and should have just an improve() method that can do ANYTHING it likes.

The default improver should be retired and its code merged in the Importer loop instead.

See also these related issues:

@pombredanne pombredanne changed the title Design new Improver RFC: Design new Improver Jan 11, 2024
@pombredanne
Copy link
Member Author

@pombredanne
Copy link
Member Author

Should we wait for the model refactoring?

I think not. In all cases we will have to amend improvers to work with the new models. We have many improvement work blocked by this current issue #1395 ... we may end up doing a bit more work if we do not wait, but this is marginal IMHO compared to waiting

@armijnhemel
Copy link
Contributor

Another solution is to create "pseudo-advisories", for example, one per purl.

@pombredanne
Copy link
Member Author

@keshav-space is this what you are working on with the pipelines?

@keshav-space
Copy link
Member

@keshav-space is this what you are working on with the pipelines?

@pombredanne yes!

keshav-space added a commit that referenced this issue Aug 26, 2024
Add improver pipeline to flag ghost packages #644 #917 #1395
@pombredanne pombredanne added 2-next and removed 9-next labels Oct 15, 2024
@pombredanne pombredanne assigned keshav-space and unassigned TG1999 Oct 15, 2024
@TG1999 TG1999 added 3-next and removed 2-next labels Nov 12, 2024
@pombredanne pombredanne changed the title RFC: Design new Improver VCIO-next: Design new Improver Dec 23, 2024
@pombredanne
Copy link
Member Author

The design has been completed: we are now using the aboutcode.pipelines library extracted from scancode.io for both importers and improvers. Migrations is in progress and tracked in:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

4 participants