fix(engine): require a template before rendering the chart#217
fix(engine): require a template before rendering the chart#217Aleksei Sviridkin (lexfrei) wants to merge 1 commit into
Conversation
Render rendered the entire chart and only afterwards checked that a template was actually requested. When none was, the render was wasted — its output is discarded — and online it first fired live lookups against the target node. An operator who forgot --file / --template therefore saw a misleading "connection refused" from discovery instead of the actionable "templates are not set" error. Move the empty-TemplateFiles guard ahead of the chart load and render (after the online multi-node precondition, which does no network I/O). The command now fails fast with the correct, actionable error in both offline and online modes, and never renders or dials a node when there is nothing to select. Assisted-By: Claude <noreply@anthropic.com> Signed-off-by: Aleksei Sviridkin <f@lex.la>
|
Warning Review limit reached
More reviews will be available in 629 minutes and 26 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request optimizes the Render function in pkg/engine/engine.go by moving the check for empty TemplateFiles earlier in the execution flow, before the chart is loaded and rendered. This prevents unnecessary rendering overhead and ensures that the 'templates are not set' error is returned immediately rather than being masked by potential rendering errors. A corresponding contract test has been added to verify this short-circuiting behavior. There are no review comments to address, and the changes look solid.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
What
talm templatewith no--file/--templaterendered the entire chart before checking that any template was actually requested. The render was wasted (its output is discarded), and online it fired live discovery first — so an operator who simply forgot--filesaw a misleadingconnection refusedfrom a node dial instead of the actionabletemplates are not seterror.How
Move the empty-
TemplateFilesguard ahead of the chart load and render, after the online multi-node precondition (which does no network I/O). The same error is now raised before any render or node dial, in both offline and online modes.Testing