helm / chart-testing

CLI tool for linting and testing Helm charts
Apache License 2.0
1.35k stars 215 forks source link

Inconsistent configuration options between CLI, `ct.yaml` and `--print-config` #672

Open JuryA opened 2 months ago

JuryA commented 2 months ago

Is this a BUG REPORT or FEATURE REQUEST? (choose one): BUG REPORT

Version of Helm and Kubernetes: Not relevant (Kubernetes: v1.30, Helm: v3.15.3)

Version of ct:

What happened:

There is an inconsistency in the configuration syntax between the output of the ct lint --print-config command and the required format for the ct.yaml configuration file. This discrepancy confuses and necessitates a "trial and error" approach rather than a straightforward configuration.

For example, the output from ct lint --print-config displays the following:

Using config file: /home/uzijaltman/usm-chart/.ct/ct.yaml
------------------------------------------------------------------------------------------------------------------------
 Configuration
------------------------------------------------------------------------------------------------------------------------
Remote: origin
TargetBranch: main
Since: HEAD
BuildID:
LintConf: .ct/lintconf.yaml
ChartYamlSchema: .ct/chart_schema.yaml
ValidateMaintainers: true
ValidateChartSchema: true
ValidateYaml: true
AdditionalCommands: [helm unittest {{ .Path }} -t JUnit -o helm-unittest.xml]
CheckVersionIncrement: false
ProcessAllCharts: false
Charts: []
ChartRepos: []
ChartDirs: [helm]
ExcludedCharts: []
HelmExtraArgs: --timeout 800s
HelmLintExtraArgs:
HelmRepoExtraArgs: []
HelmDependencyExtraArgs: []
Debug: false
Upgrade: false
SkipMissingValues: false
SkipCleanUp: false
Namespace:
ReleaseLabel:
ExcludeDeprecated: false
KubectlTimeout: 30s
PrintLogs: true
GithubGroups: false

However, the ct.yaml file requires a different format for the same configuration options—not just a difference in case style, but entirely different option names—which is counterintuitive. For instance:

This discrepancy is both confusing and frustrating for users who expect consistency between the output of the ct lint --print-config command and the ct.yaml configuration file format.

What you expected to happen:

I expected the configuration format in the ct.yaml file to be consistent with the output from ct lint --print-config. Specifically, the options and their naming conventions should match, enabling users to easily translate the printed configuration into a working ct.yaml file without needing to cross-reference different formats or option names.

Moreover, it would be reasonable to expect that the output from --print-config could be directly saved as the current configuration. Unfortunately, this is not the case. As a result, the --print-config option becomes redundant since it cannot be directly applied or saved as a valid configuration file without manual adjustments.

How to reproduce it (as minimally and precisely as possible):

  1. Create a ct.yaml configuration file using the output from ct lint --print-config.
  2. Attempt to run ct lint using this configuration file.
  3. Observe that the configuration is missing due to mismatched option names and formats.

Anything else we need to know:

No additional information is required at this time, but this issue significantly impacts usability, particularly for inexperienced users or those unfamiliar with the tool.

github-actions[bot] commented 1 month ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

JuryA commented 4 weeks ago

/nostale