Skip to content

Fix helm_import_repository canonical dict to avoid spurious DEBUG messages#520

Draft
agentydragon wants to merge 1 commit intodevelfrom
claude/debug-helm-charts-build-S6GSy
Draft

Fix helm_import_repository canonical dict to avoid spurious DEBUG messages#520
agentydragon wants to merge 1 commit intodevelfrom
claude/debug-helm-charts-build-S6GSy

Conversation

@agentydragon
Copy link
Copy Markdown
Owner

Summary

Apply a patch to rules_helm that fixes the helm_import_repository rule to return a canonical dict with only the relevant fields based on how the repository was configured, eliminating spurious DEBUG messages about unfollowable suggestions.

Key Changes

  • Added third_party/rules_helm/canonical-return.patch that modifies the return value of _helm_import_repository_impl in helm/private/import.bzl
  • The patch restructures the canonical dict to conditionally include fields:
    • Always includes: name and sha256
    • If url is provided: includes url only
    • If url is not provided: includes chart_name, repository, and version
  • Added third_party/rules_helm/BUILD.bazel to export the patch file
  • Updated MODULE.bazel to apply the patch to rules_helm version 0.21.0 via single_version_override

Implementation Details

The fix addresses a bug where the rule was returning all fields in the canonical dict regardless of configuration, causing Bazel to suggest setting chart_name and version attributes even when the repository was configured with a direct url. Since the rule forbids setting these attributes alongside url, the suggestions were impossible to follow. The patch makes the canonical dict reflect only the fields that are actually relevant to the repository's configuration.

https://claude.ai/code/session_01SEXMX7ncHpY2swVzggsYkd

helm_import_repository returns chart_name/version derived from the url
in its canonical return dict, but forbids setting those attrs alongside
url. This causes Bazel to emit unfollowable canonicalization suggestions.

Patch the return to only include attrs that were actually provided.

https://claude.ai/code/session_01SEXMX7ncHpY2swVzggsYkd
@agentydragon agentydragon force-pushed the devel branch 2 times, most recently from cb3df7d to 2a0568e Compare February 20, 2026 03:42
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