Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation-related sources to helm_chart #15638

Merged
merged 3 commits into from
Apr 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/python/pants/backend/helm/target_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,15 +121,20 @@ class HelmChartMetaSourceField(SingleSourceField):

class HelmChartSourcesField(MultipleSourcesField):
default = (
".helmignore",
"README.md",
"LICENSE",
"values.yaml",
"values.yml",
"values.schema.json",
"templates/*.yaml",
"templates/*.yml",
"templates/*.tpl",
"templates/NOTES.txt",
"crds/*.yaml",
"crds/*.yml",
)
expected_file_extensions = (".yaml", ".yml", ".tpl")
expected_file_extensions = (".helmignore", ".yaml", ".yml", ".tpl", ".json", ".md", ".txt", "")
help = generate_multiple_sources_field_help_message(
"Example: `sources=['values.yaml', 'templates/*.yaml', '!values_ignore.yaml']`"
)
Expand Down
10 changes: 9 additions & 1 deletion src/python/pants/backend/helm/util_rules/sources_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def test_can_not_auto_detect_source_root(rule_runner: RuleRunner) -> None:
rule_runner.request(HelmChartRoot, [HelmChartRootRequest(field_set.chart)])


def test_source_templates_are_always_included(rule_runner: RuleRunner) -> None:
def test_standard_sources_are_always_included(rule_runner: RuleRunner) -> None:
rule_runner.write_files(
{
"BUILD": dedent(
Expand All @@ -86,9 +86,13 @@ def test_source_templates_are_always_included(rule_runner: RuleRunner) -> None:
),
"Chart.yaml": HELM_CHART_FILE,
"values.yaml": HELM_VALUES_FILE,
"values.schema.json": "",
"README.md": "",
"LICENSE": "",
"crds/foo.yml": K8S_CRD_FILE,
"templates/_helpers.tpl": HELM_TEMPLATE_HELPERS_FILE,
"templates/service.yaml": K8S_SERVICE_TEMPLATE,
"templates/NOTES.txt": "",
"resource.xml": "",
"file.txt": "",
}
Expand All @@ -106,9 +110,13 @@ def test_source_templates_are_always_included(rule_runner: RuleRunner) -> None:
)

assert source_files.snapshot.files == (
"LICENSE",
"README.md",
"crds/foo.yml",
"templates/NOTES.txt",
"templates/_helpers.tpl",
"templates/service.yaml",
"values.schema.json",
"values.yaml",
)

Expand Down
Loading