Repository navigation
feat(list): warn on 'helm list' truncation with default --max limit - #31887
john-weathers wants to merge 2 commits into
Conversation
add a stderr warning when results are truncated by the default --max limit. Closes helm#31617 Signed-off-by: John Weathers <[email protected]>
There was a problem hiding this comment.
Pull request overview
Adds user-facing visibility to helm list pagination by tracking whether results were truncated by the default --max limit and emitting a warning for human-readable (table) output.
Changes:
- Introduces a
Truncatedfield on theaction.Liststruct and sets it during pagination/truncation. - Updates
helm listcommand to emit a stderr warning when truncation occurs due to the default--max(only for table output and only when--maxwasn’t explicitly set). - Adds unit tests to validate truncation detection across limit/offset scenarios.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| pkg/cmd/list.go | Prints a truncation warning after table output when default --max causes truncation. |
| pkg/action/list.go | Tracks truncation state in the list action via a new Truncated field. |
| pkg/action/list_test.go | Adds unit coverage for truncation behavior across multiple limit/offset combinations. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
📝 Documentation updates detected! New suggestion: Document helm list --max and --offset flags in CheatSheet Tip: Configure how Promptless handles changelogs in Agent Settings 📋 |
Reset Truncated on each Run(), use cmd.ErrOrStderr(), and reorder tests to cover early-return stale state. Signed-off-by: John Weathers <[email protected]>
|
Hi @gjenkins8, just wanted to follow up here since you helped triage the issue associated with this. It looks like this PR needs an additional review. I wanted to check if you could take a look or if you could suggest someone for a second review. Thanks! |
StantonMatt
left a comment
There was a problem hiding this comment.
I took a local validation pass on 1f77d24a.
The focused limit/truncation tests pass:
go test ./pkg/action -run 'TestList_(Truncation|Limit|LimitOffset|LimitOffsetOutOfBounds)$' -count=1
go test ./pkg/cmd -run 'TestList(Cmd|OutputFormats|StatusMapping|CustomTimeFormat)?$' -count=1I also ran the touched packages together:
go test ./pkg/action ./pkg/cmd -count=1That passed as well. To check the command-level behavior directly, I ran a temporary local probe with 257 in-memory deployed releases: plain list emitted the new default-limit warning, while list --max 256 and list --output json did not. I removed the probe afterward, and git diff --check origin/main...HEAD is clean.
The current shape looks right to me: the action layer tracks whether pagination actually omitted results, the command only warns for table output when the user did not explicitly set --max, and the warning goes through Cobra's stderr stream. I do not see a blocker from this pass.
|
This pull request has been marked as stale because it has been open for 90 days with no activity. This pull request will be automatically closed in 30 days if no further activity occurs. |
What this PR does / why we need it:
This PR adds a warning to
helm listwhen results are truncated due to the default--maxlimit (only when the user has not explicitly set--max).Currently,
helm listsilently truncates results (default max=256), which can make it appear as if releases are missing. This change improves clarity by informing users that more results may exist.The warning:
My intention in printing the warning to stderr and limiting it to table output was to preserve backward compatibility of structured and machine-readable output.
Closes #31617
Special notes for your reviewer:
Truncatedfield in the actionListstruct--maxand--offsetIf applicable:
docs neededlabel should be applied if so)