Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Zebradil
Copy link
Member

@Zebradil Zebradil commented Jul 5, 2025

This adds support for global helm values. These values are considered during rendering of each and every chart in an application.

How to use: place a _global.yaml file in the helm directory on any level of the inheritance tree – in the same directory you'd place a helm-specific values file.
All global helm values files are collected and included in rending of the final helm values file for every chart of an application.
Global values files have lower priority than chart specific ones.

Summary by CodeRabbit

  • New Features

    • Added new YAML configuration files for integration and prototype environments, providing additional global and chart-specific settings for Helm charts.
  • Bug Fixes

    • Enhanced rendered output files with new flags and values to reflect more detailed rendering states.
  • Refactor

    • Improved internal logic for collecting values files, resulting in cleaner and more maintainable code.

Zebradil added 3 commits July 5, 2025 13:43
This adds support for global helm values. These values are considered during rendering of each and every chart in an application.
@coderabbitai
Copy link

coderabbitai bot commented Jul 5, 2025

Walkthrough

This change introduces new YAML configuration files for Helm chart integration tests, expands rendered output YAMLs with additional flags and values, and refactors the prepareValuesFile method in the codebase to modularize values file collection logic. No exported or public code entities are removed or fundamentally altered.

Changes

File(s) Change Summary
examples/integration-tests/envs/dev/_apps/multiple-sources/helm/_global.yaml Added new global Helm YAML config with static key-value pairs for integration tests.
examples/integration-tests/envs/dev/_apps/multiple-sources/helm/render-test-1.yaml Added new app-specific Helm YAML config with static key-value pairs for integration tests.
examples/integration-tests/prototypes/multiple-sources/helm/_global.yaml Added new prototype global Helm YAML config with static key-value pairs for integration tests.
examples/integration-tests/rendered/envs/mykso-dev/multiple-sources/rendering-helm-render-test-1.yaml Expanded output YAML with new flags and string values reflecting additional configuration sources.
examples/integration-tests/rendered/envs/mykso-dev/multiple-sources/rendering-helm-render-test-2.yaml Expanded output YAML with new flags and string values for global and prototype sources.
internal/myks/render.go Refactored: extracted values file collection logic into collectValuesFiles helper; updated method signatures.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Application
    participant FileSystem

    User->>Application: Trigger Helm values preparation
    Application->>FileSystem: collectValuesFiles(_global)
    FileSystem-->>Application: Return global values files
    Application->>FileSystem: collectValuesFiles(chartName)
    FileSystem-->>Application: Return chart-specific values files
    Application->>FileSystem: Write merged values to output file
    FileSystem-->>Application: Confirm write
    Application-->>User: Return output values file path
Loading

Possibly related PRs

Poem

A bunny hops through YAML fields,
With global flags and chart-y shields.
Refactored code, so neat and bright,
Collects the values, just so right.
🐰 Configs and charts in harmony dwell,
In integration tests, all is well!


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2cd1db8 and 7f31d66.

📒 Files selected for processing (6)
  • examples/integration-tests/envs/dev/_apps/multiple-sources/helm/_global.yaml (1 hunks)
  • examples/integration-tests/envs/dev/_apps/multiple-sources/helm/render-test-1.yaml (1 hunks)
  • examples/integration-tests/prototypes/multiple-sources/helm/_global.yaml (1 hunks)
  • examples/integration-tests/rendered/envs/mykso-dev/multiple-sources/rendering-helm-render-test-1.yaml (1 hunks)
  • examples/integration-tests/rendered/envs/mykso-dev/multiple-sources/rendering-helm-render-test-2.yaml (1 hunks)
  • internal/myks/render.go (3 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
internal/myks/render.go (1)
internal/myks/application.go (1)
  • Application (23-33)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: test / test
🔇 Additional comments (11)
examples/integration-tests/envs/dev/_apps/multiple-sources/helm/render-test-1.yaml (1)

1-3: Looks good – file is syntactically valid and follows the new layering convention
Nothing stands out as problematic. Values and booleans are well-formed and the path mirrors the other app-level files introduced in this PR.

examples/integration-tests/prototypes/multiple-sources/helm/_global.yaml (1)

1-4: Double-check the semantic intent of appSpecificChart value

Here appSpecificChart is deliberately set to prototypeGlobal, differing from the app-level file where it becomes appGlobal and from the chart-level file where it becomes appSpecificChart.
If the purpose is to verify precedence across the three layers, all good. Otherwise, consider aligning the value with the key name (e.g. prototypeSpecificChart) to avoid reader confusion.

examples/integration-tests/rendered/envs/mykso-dev/multiple-sources/rendering-helm-render-test-2.yaml (1)

5-9: Rendered output matches the expected merge order

The presence of both fromAppGlobal and fromPrototypeGlobal flags alongside the overridden appSpecificChart: appGlobal value demonstrates that the new collector correctly merged layers. No issues spotted.

examples/integration-tests/rendered/envs/mykso-dev/multiple-sources/rendering-helm-render-test-1.yaml (1)

5-10: Rendered YAML correctly aggregates all four sources

The final output includes defaults, prototype globals, app globals and chart-specific values, confirming the feature works end-to-end.

internal/myks/render.go (7)

164-164: LGTM: Parameter name clarification.

The parameter name change from resourceName to chartName improves code clarity and better reflects the method's purpose for Helm chart processing.


167-167: LGTM: Consistent variable usage.

The variable usage is correctly updated to use the new parameter name.


169-173: LGTM: Global values collection implementation.

The global values collection is well-implemented, correctly using "_global" as the resource identifier and maintaining proper error handling. The order of collecting global values first is correct for Helm's precedence rules.


175-179: LGTM: Chart-specific values collection.

The chart-specific values collection correctly uses the new helper method and maintains the proper precedence order by appending to the global values list.


182-182: LGTM: Consistent logging update.

The logging statement correctly uses the updated parameter name.


197-198: LGTM: File path construction update.

The file path construction correctly uses the updated parameter name.


219-239: LGTM: Well-structured helper method extraction.

The new collectValuesFiles helper method successfully extracts the duplicated logic, improving code organization and maintainability. The implementation correctly:

  • Collects values files from all the expected sources (base prototype, prototype overrides, and application directories)
  • Maintains the original logic and behavior
  • Follows Go conventions and consistent error handling patterns
  • Enables reuse for both global and chart-specific values collection

This refactoring enhances code readability while preserving existing functionality.

✨ Finishing Touches
  • 📝 Generate Docstrings

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@Zebradil Zebradil merged commit 67e1863 into main Jul 5, 2025
11 checks passed
@Zebradil Zebradil deleted the global-helm-values branch July 5, 2025 12:07
This was referenced Oct 20, 2025
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.

1 participant