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

Replace commas in error messages #150

Closed
m1kola opened this issue Oct 24, 2023 · 2 comments · Fixed by #158
Closed

Replace commas in error messages #150

m1kola opened this issue Oct 24, 2023 · 2 comments · Fixed by #158
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines.
Milestone

Comments

@m1kola
Copy link
Member

m1kola commented Oct 24, 2023

We need to make errrors more readable for human consumption.

Currently with commans it is difficult to read the error when there is DependencyConstraint or AtMostConstraint constraint in the problem as they also use a comma to separate ids:

constraints not satisfiable: installed package prometheus is mandatory, installed package prometheus requires at least one of test-catalog-prometheus-prometheus-operator.1.2.0, test-catalog-prometheus-prometheus-operator.1.0.1, test-catalog-prometheus-prometheus-operator.1.0.0, prometheus package uniqueness permits at most 1 of test-catalog-prometheus-prometheus-operator.2.0.0, test-catalog-prometheus-prometheus-operator.1.2.0, test-catalog-prometheus-prometheus-operator.1.0.1, test-catalog-prometheus-prometheus-operator.1.0.0, required package prometheus is mandatory, required package prometheus requires at least one of test-catalog-prometheus-prometheus-operator.2.0.0

AtMostConstraint is in bold.

We should explore different formatting options (such as semicolon or new lines).

Semicolon will already be a big improvement:

constraints not satisfiable: installed package prometheus is mandatory; installed package prometheus requires at least one of test-catalog-prometheus-prometheus-operator.1.2.0, test-catalog-prometheus-prometheus-operator.1.0.1, test-catalog-prometheus-prometheus-operator.1.0.0; prometheus package uniqueness permits at most 1 of test-catalog-prometheus-prometheus-operator.2.0.0, test-catalog-prometheus-prometheus-operator.1.2.0, test-catalog-prometheus-prometheus-operator.1.0.1, test-catalog-prometheus-prometheus-operator.1.0.0; required package prometheus is mandatory; required package prometheus requires at least one of test-catalog-prometheus-prometheus-operator.2.0.0

@m1kola m1kola added the good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. label Oct 24, 2023
@m1kola m1kola added this to the v0.0.2 milestone Oct 24, 2023
@joelanford
Copy link
Member

I know I originally suggested semi-colons, but what do you think about new lines instead of semi-colons? How does that end up looking in kubectl get operators -o yaml or kubectl describe operators.

Semi-colons are definitely an improvement over commas, but if newline based output is more readable using the above commands, maybe we jump straight to that?

If not, or if there is more than trivial discussion, +1 on semi-colons over commas.

@m1kola m1kola changed the title Use semicolon instead of a comma in error messages Replace commas in error messages Oct 24, 2023
@m1kola
Copy link
Member Author

m1kola commented Oct 24, 2023

Happy for us to explore new lines. I'm pretty sure that kubectl will be ok with new lines, but it is worth double checking. I updated the description of the issue to be less prescriptive.

I also created #151 for the bigger effort of making errors more concise and useful. Let's keep the scope of this issue to tweaks for separators.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines.
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants