Skip to content

fix(filters): remove max_lines cap from helm filter that truncates template output - #1645

Merged
aeppling merged 1 commit into
rtk-ai:developfrom
KuaaMU:master
Jun 7, 2026
Merged

aeppling merged 1 commit into
rtk-ai:developfrom
KuaaMU:master

Conversation

@KuaaMU

@KuaaMU KuaaMU commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #1626 — rtk helm template silently truncates output to ~40 lines, dropping remaining Kubernetes manifests.

Root Cause

The helm filter in src/filters/helm.toml had max_lines = 40. This caps ALL helm output at 40 lines. For short commands like helm status this is fine, but helm template produces hundreds of lines of YAML manifests that get silently truncated — no warning, no error, exit code 0.

Fix

Remove max_lines = 40. The filter retains its other output hygiene settings:

  • strip_ansi = true — removes ANSI escape codes
  • strip_lines_matching — removes blank lines and glog warnings
  • truncate_lines_at = 120 — truncates individual long lines

These are sufficient. The max_lines cap is too aggressive for commands with legitimately long output.

Testing

Added regression test "helm template output is not truncated" that verifies multi-document YAML output (6 Kubernetes manifests) is preserved in full.

All 1687 tests pass. cargo fmt and cargo clippy clean.

Impact

Without this fix, CI/CD pipelines that pipe rtk helm template output to kubectl apply would apply an incomplete set of manifests — silently dropping deployments, PVCs, secrets, etc.

@CLAassistant

CLAassistant commented Apr 30, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@pszymkowiak pszymkowiak added bug Something isn't working effort-small Quelques heures, 1 fichier filter-quality Filter produces incorrect/truncated signal good first issue Good for newcomers labels Apr 30, 2026
@pszymkowiak

Copy link
Copy Markdown
Collaborator

[w] wshm · Automated triage by AI

📊 Automated PR Analysis

🐛 Type bug-fix
🟢 Risk low

Summary

Removes the max_lines = 40 cap from the helm filter configuration, which was silently truncating helm template output beyond 40 lines. Adds a regression test with 6 Kubernetes manifests to verify long output is preserved in full.

Review Checklist

  • Tests present
  • Breaking change
  • Docs updated

Linked issues: #1626


Analyzed automatically by wshm · This is an automated analysis, not a human review.

@KuaaMU
KuaaMU changed the base branch from master to develop April 30, 2026 11:53
…mplate output

The helm filter had `max_lines = 40` which silently truncates output
from commands like `helm template` that legitimately produce hundreds
of lines of YAML manifests. This caused CI/CD pipelines to apply
incomplete sets of manifests (only first ~40 lines).

Other filter settings (strip_ansi, strip_lines_matching for blanks and
glog warnings, truncate_lines_at for individual line length) provide
sufficient output hygiene without capping total line count.

Added regression test verifying multi-document YAML output is preserved
in full without truncation.

Fixes #1626

@YOMXXX YOMXXX left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed this against #1626. Removing the global max_lines = 40 cap is the right tradeoff here: helm template output is correctness-sensitive, and silently dropping manifests is worse than keeping more YAML in the output. The filter still strips blank/glog noise and keeps per-line truncation, so this does not remove all output hygiene.

No blocking concerns from my side.

@aeppling

aeppling commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Hey, LGTM

As a follow-up we should allow using tee and hint features for the toml filters truncations

@aeppling
aeppling merged commit 63a76de into rtk-ai:develop Jun 7, 2026
1 check passed
@aeppling aeppling mentioned this pull request Jun 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working effort-small Quelques heures, 1 fichier filter-quality Filter produces incorrect/truncated signal good first issue Good for newcomers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: helm template output truncated - only first ~41 lines returned, remaining templates silently dropped

5 participants