Skip to content

[Misc] Conditional logging for helm chart generation message#89

Merged
anirudhprasad-sap merged 1 commit intomainfrom
logFix
Mar 30, 2026
Merged

[Misc] Conditional logging for helm chart generation message#89
anirudhprasad-sap merged 1 commit intomainfrom
logFix

Conversation

@anirudhprasad-sap
Copy link
Copy Markdown
Contributor

@anirudhprasad-sap anirudhprasad-sap commented Mar 30, 2026

Conditional Logging for Helm Chart Generation Message

Bug Fix

🐛 Fixed an unnecessary log message being displayed unconditionally during helm chart generation. The message instructing users to run cds build is now only shown when applicable — specifically when the chart is neither configurable nor generated with templates.

Changes

  • lib/add.js: Wrapped the "Once values.yaml is updated, run 'cds build'..." console log in a conditional check so it only prints when isConfigurable is false and withTemplates is false. This avoids showing a misleading or irrelevant message in configurable chart or template-based scenarios.
  • 🔄 Regenerate and Update Summary

📬 Subscribe to the Hyperspace PR Bot DL to get the latest announcements and pilot features!

PR Bot Information

Version: 1.19.9 | 📖 Documentation | 🚨 Create Incident | 💬 Feedback

  • LLM: anthropic--claude-4.6-sonnet
  • File Content Strategy: Full file content
  • Summary Prompt: Default Prompt
  • Event Trigger: pull_request.opened
  • Correlation ID: bd1d6ca0-2c3f-11f1-9133-bd2d10117470
  • Output Template: Default Template

Copy link
Copy Markdown
Contributor

@hyperspace-insights hyperspace-insights bot left a comment

Choose a reason for hiding this comment

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

Now I have a thorough understanding of the full context. Let me analyze the logic:

The new condition !isConfigurable && !withTemplates:

  1. isConfigurable (--with-configurable-templates): Creates a chart with embedded templates (chart/templates/). Since templates are already inlined, cds build is not needed to get the helm chart. Suppressing the message is correct.

  2. withTemplates (--with-templates): createSimpleChart is called with withTemplates=true, which also copies templates into chart/templates/. Same as above — cds build is not needed. Suppressing is correct.

  3. Neither flag (simple chart without templates): cds build is needed to generate the chart from values.yaml. Message should show. ✅

  4. --with-mta case: Note that --with-mta and --with-configurable-templates are not mutually exclusive per validateOptions. When --with-mta is used without --with-configurable-templates and without --with-templates, the "run cds build" message still shows. This is technically correct because a simple chart without templates does still require cds build. However, the MTA case already gives the user a different message ("Deriving values.yaml from mta.yaml cannot be done one to one..."), so showing the "run cds build" message afterward is also reasonable.

The logic looks correct. Let me also double-check: can isConfigurable be truthy when withTemplates is also truthy? No — validateOptions throws an error when both are specified together. So the || in the condition covers all valid cases.

One issue I do find: The condition !isConfigurable && !withTemplates uses negated logic which can be hard to parse. But more critically, it also means the message is suppressed when --with-mta is used with a template-related flag — but that's actually fine because --with-mta + --with-configurable-templates would produce a configurable chart (with inline templates, no cds build needed). This is correct.

The code looks logically sound. However, I notice one actual correctness issue: --with-mta with a plain (non-template, non-configurable) chart should arguably also not show the "run cds build" message because handleMtaIntegration already handles the output guidance and the MTA path populates values.yaml automatically. Let me reconsider — actually, the cds build step is still needed to generate the rendered Helm chart even with MTA. The message "Once values.yaml is updated, run 'cds build'..." still applies after MTA population. So this is correct.

The change looks correct. Let me verify if there's any issue with the --with-mta + --with-configurable-templates combination — validateOptions does NOT block this combination, so it's possible. In that case: isConfigurable=true, so the message is suppressed, which is right. ✅

No significant issues found with the logic of this change. The PR is simple and correct.

The change is straightforward and logically sound — the "run cds build" message is correctly suppressed only for --with-configurable-templates and --with-templates cases where the helm chart templates are already embedded in the chart/ folder and a separate cds build step is not needed. No issues to flag.

PR Bot Information

Version: 1.19.9 | 📖 Documentation | 🚨 Create Incident | 💬 Feedback

  • Correlation ID: bd1d6ca0-2c3f-11f1-9133-bd2d10117470
  • File Content Strategy: Full file content
  • LLM: anthropic--claude-4.6-sonnet
  • Event Trigger: pull_request.opened

Copy link
Copy Markdown
Contributor

@Pavan-SAP Pavan-SAP left a comment

Choose a reason for hiding this comment

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

@sonarqubecloud
Copy link
Copy Markdown

@anirudhprasad-sap anirudhprasad-sap merged commit 26a735e into main Mar 30, 2026
9 checks passed
@anirudhprasad-sap anirudhprasad-sap deleted the logFix branch March 30, 2026 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants