-
Notifications
You must be signed in to change notification settings - Fork 117
container lint: option to not truncate #1260
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
I looked into this preparing to make this patch, and it appears that https://github.com/bootc-dev/bootc/blob/main/utils/src/iterators.rs#L17 is the culprit and happens in a few spots. Perhaps a |
Sure, though in practice that's equivalent to simply not filtering the iterator at all i.e. not calling the function 😄 I think we can fix two problems at once here though...there's also duplication here with the "print the results" logic, and so I think if we had a wrapper for this in the cli code it could also handle the "full results" logic. This all said...we didn't define here what the "option to not truncate" looks like. What I'd actually strawman instead is we have a If we talk about writing a log file then of course we probably want to think too about outputting structured data (maybe YAML?)... |
Useful when running automatic reports and analyses where all issues need to be visible at once without truncation. To do this we needed to add a LintExecutionConfig to propagate configuration through the lint system. Also, refactor how we print things so there's a shared helper functions for consistent formatting with and without truncation. Closes: bootc-dev#1260 Signed-off-by: Colin Walters <walters@verbum.org>
Useful when running automatic reports and analyses where all issues need to be visible at once without truncation. To do this we needed to add a LintExecutionConfig to propagate configuration through the lint system. Also, refactor how we print things so there's a shared helper functions for consistent formatting with and without truncation. Closes: bootc-dev#1260 Signed-off-by: Colin Walters <walters@verbum.org>
Actually, I disagree with the statement "This is a perfectly sane default". All or nothing are the only reasonable defaults. A particular
followed by several more packages. Would any of us suggest that
Actually, in the case of an often manual user command like A lint is a lint. The purpose is to automatically find all problems of a particular type. Actually reporting everything that it finds is not "verbose", it's the norm. "Verbose" would be, for example, printing the line number within If I think outside of the box, I can imagine a scenario or two where one would ant to run the lint but not "waste" tty space on the full output (just get the return value - did it pass or not?). In this scenario, even the truncated output is undesirable. In typical container workflows, what is the use case for a truncated output? I see there's a problem, I get some of the details. So I fix those, re-run the containerfile, and repeat that process (which may involve installing hundreds of packages), which is unnecessarily convoluted; or I enter the container and use a command to get the full list of relevant files, which obviates the utility of the lint output, and is not convenient in any iteration loop that involves orchestration (and probably requires re-running the step at least 1 more time). Putting the full output in a log file is also not convenient in most Containerfile workflows, where failed steps leave the developer with nothing more than log output to diagnose what went wrong (getting a running shell in a container running from the post-failure state requires extra steps). After all, it appears that this is not an intentional design decision, so much as a convenient implementation decision stemming from the iterator design. |
No it is intentional, we had to go to some effort to trim it. The rationale for the status quo is that - especially with the I totally get your perspective though. I think the most useful thing for us to do here though is #216 which would greatly help with the biggest source for lint spam from the |
bootc container lint
truncates the output, for instance, by only listing the first N paths as shown below. This is a perfectly sane default but I am seeking an option to list everything and not truncate. This would be especially helpful for running automated analyses and reports (which I am doing at the moment).The text was updated successfully, but these errors were encountered: