Loading
feat(df): render firewall summary in a colored unicode box
What
Redesigns the GitLab Dependency Firewall summary that glab df <manager> ...
wrappers and glab df ci-summary print after a run.
- Draws a rounded Unicode box (
╭─╮ │ ├─┤ ╰─╯) tinted by the worst verdict in the run (red / yellow / green). - Two-line header: a colored status icon plus a bold title, then a summary
line with counts colored by severity (e.g.
1 blocked, 1 warning). - Table with an icon column (
✖ ▲ ✔), left-alignedPACKAGE, right-alignedVERSION, and grayREASON(an em dash when empty). - Box characters are always drawn; ANSI color is gated by color support
or
GITLAB_CI, so CI job logs keep their color even off a TTY. This lives in a small local palette (palette.go) so global iostreams color behavior is unchanged. - A blank line is emitted before and after the box so it stands apart from surrounding wrapper / CI output.
Also suppresses the duplicate fang ERROR block that used to print after a
wrapper run: when the child package manager exits non-zero, the wrapper now
wraps SilentError (preserving the child's exit code) instead of a verbose
error, because the summary already explains what happened.
Why
Initially we used the glab output patterns so we matched other commands. During review with product we determined it was too hard to notice in the CI output, and something different was needed. This new version has been approved by Dep FW PM.
Test plan
go test ./internal/dependencyfirewall/summary/... ./internal/commands/df/dfcmd/...- New tests pin: leading and trailing blank line, box characters present, every box border line is the same visible width, status icons, and the empty-reason dash.
- Verified end-to-end in a real CI pipeline (pip demo): warn (yellow box),
block (red box), and mixed
ci-summary, all rendering color in CI with no trailingERRORblock.
Screenshots
Block (red) box, from a CI run:
Edited by Michael Eddington
