operator-framework / deppy

Deppy: The dependency resolver for Kubernetes
Apache License 2.0
14 stars 21 forks source link

Simplified formatting for `deppy.NotSatisfiable` error #151

Open m1kola opened 6 months ago

m1kola commented 6 months ago

Today deppy.NotSatisfiable is being formated in a not very human friendly way: it is challenging to understand what exactly went wrong from the error message.

We need to explore error formatting options which:

This probably should be plugable.

m1kola commented 6 months ago

I really like how pip does it. Few examples I found on the internet (probably from different pip versions):

pandas-profiling 3.6.1 requires numpy<1.24,>=1.16.0, but you have numpy 1.24.1 which is incompatible.
numba 0.54.1 requires numpy<1.21,>=1.17, but you have numpy 1.24.1 which is incompatible.

Or more complex one:

The conflict is caused by:
    The user requested six==1.10.0
    bcrypt 3.2.0 depends on six>=1.4.1
    cvxpy 1.0.25 depends on six
    django-anymail 0.5 depends on six
    django-compat 1.0.15 depends on six>=1.10.0
    django-extensions 2.2.1 depends on six>=1.2
    drf-yasg 1.16.1 depends on six>=1.10.0
    fake-factory 0.6.0 depends on six
    google-api-core 1.26.0 depends on six>=1.13.0
m1kola commented 6 months ago

This repo with examples on how to format errors might be useful: https://github.com/perdasilva/deconflictor.

m1kola commented 6 months ago

I updated the description of the issue beucase it was initially not factually true: I origianlly said that deppy.NotSatisfiable contains description of the whole problem. It is not true: Deppy (thanks to Gini) only produces a minimised list of assumptions which together caused unsat.

I think readability of deppy.NotSatisfiable will be greatly influenced by the approach taken to building the constraints on the users side (e.g. IDs used, and how dependencies structured).

joelanford commented 6 months ago

IDs used

I think we have overlooked this particular aspect as well. We should define a standard for how to structure IDs and perhaps add a package (not sure where) to help users build IDs that will be easier to reason about.

github-actions[bot] commented 4 months ago

This issue has become stale because it has been open 60 days with no activity. The maintainers of this repo will remove this label during issue triage or it will be removed automatically after an update. Adding the lifecycle/frozen label will cause this issue to ignore lifecycle events.