Skip to content

Conversation

forquare
Copy link
Contributor

@forquare forquare commented Mar 20, 2025

What this PR does / why we need it:

The existing rule for validating dependency import-values worked well for either of these two cases:

1. Importing exports

dependencies:
- name: dep1
  version: 0.14.1
  repository: oci://myrepo
  import-values:
    - data

2. Importing child values into the parent

dependencies:
- name: dep1
  version: 0.14.1
  repository: oci://myrepo
  import-values:
    - child: default.data
      parent: myimports

However, it failed on the following valid usecase:

dependencies:
- name: dep1
  version: 0.14.1
  repository: oci://myrepo
  import-values:
    - data
    - child: default.data
      parent: myimports

Giving the following error:

dependencies.0.import-values.1: '{'parent': 'myimports', 'child': 'default.data'}' is not a str.
dependencies.0.import-values.0 : 'data' is not a map

This is because the Yamale is validating on a list of strings or a list of import-value, where a list containing both is also valid.

This commit changes the rule to allow both methods to be in the import-values list.

Copy link

github-actions bot commented May 6, 2025

This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.

@github-actions github-actions bot added the Stale label May 6, 2025
The existing rule for validating dependency import-values worked well for either of these two cases:

**1. Importing exports**

```yaml
dependencies:
- name: dep1
  version: 0.14.1
  repository: oci://myrepo
  import-values:
    - data
```

**2. Importing child values into the parent**

```yaml
dependencies:
- name: dep1
  version: 0.14.1
  repository: oci://myrepo
  import-values:
    - child: default.data
      parent: myimports
```

However, it failed on the following valid usecase:

```yaml
dependencies:
- name: dep1
  version: 0.14.1
  repository: oci://myrepo
  import-values:
    - data
    - child: default.data
      parent: myimports
```

Giving the following error:

```
dependencies.0.import-values.1: '{'parent': 'myimports', 'child': 'default.data'}' is not a str.
dependencies.0.import-values.0 : 'data' is not a map
```

This is because the Yamale is validating on a list of strings *or* a list of `import-value`, where a list containing both is also valid.

This commit changes the rule to allow both methods to be in the `import-values` list.

Signed-off-by: Ben Lavery-Griffiths <ben@lavery-griffiths.com>
@forquare forquare force-pushed the fix-chart-yaml-schema-import-values branch from 0d05531 to 0d5f4f4 Compare May 9, 2025 14:08
@forquare
Copy link
Contributor Author

forquare commented May 9, 2025

Today I have posted in the #helm-chart-testing Slack channel hoping to make some progress with the PR and to remove the stale label.

@github-actions github-actions bot removed the Stale label May 10, 2025
Copy link
Member

@cpanato cpanato left a comment

Choose a reason for hiding this comment

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

seems ok thanks!

@cpanato cpanato merged commit 5b4fb1a into helm:main Jun 2, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants