Skip to content

Conversation

viveksinghggits
Copy link
Contributor

@viveksinghggits viveksinghggits commented Sep 11, 2025

Summary

Whenever we raise a PR to the https://github.com/mongodb/helm-charts/ repo to release the helm chart, as part of the CI linting of the chart is done.
And that linting fails because there are some issues in our chart. The issue is a space character at the end of this file here.
To get the PR in, in the helm-charts repo we just fixed the problem in that repo and didn't make the changes here in the MCK repo. This PR makes the change in MCK repo and in the next PR I am going to add chart linting as part of the lint_repo task so that we will always lint of charts.

When we just go ahead and remove the trailing space from the mentioned line, our pre-commit hook doesn't pass. And the reason is when pre-commit hooks tries to update the version is chart.yaml here, the library (ruamel.yaml.YAML()) that is used to update the yaml automatically adds a trailing space in that line. So, in other words, even if we manually remove the trailing space, our CI complains that there are some files that are not added after running pre-commit, and when we run pre-commit, the extra trailing space is added automatically.

To fix that problem we are slightly changing the way we were adding description to the chart.yaml, and now we are using the correct way of adding multi line values in a yaml file.

Proof of Work

ct lint  --charts=helm_chart/                                                                 vivek.s@M-HYXVRF7WDG
Linting charts...
Version increment checking disabled.

------------------------------------------------------------------------------------------------------------------------
 Charts to be processed:
------------------------------------------------------------------------------------------------------------------------
 mongodb-kubernetes => (version: "1.3.0", path: "helm_chart/")
------------------------------------------------------------------------------------------------------------------------

Linting chart "mongodb-kubernetes => (version: \"1.3.0\", path: \"helm_chart/\")"
Validating helm_chart/Chart.yaml...
Validation success! 👍
Validating maintainers...
==> Linting helm_chart/

1 chart(s) linted, 0 chart(s) failed

------------------------------------------------------------------------------------------------------------------------
 ✔︎ mongodb-kubernetes => (version: "1.3.0", path: "helm_chart/")
------------------------------------------------------------------------------------------------------------------------
All charts linted successfully

Checklist

  • Have you linked a jira ticket and/or is the ticket in the title?
  • Have you checked whether your jira ticket required DOCSP changes?
  • Have you added changelog file?

@viveksinghggits viveksinghggits requested a review from a team as a code owner September 11, 2025 15:34
@viveksinghggits viveksinghggits added the skip-changelog Use this label in Pull Request to not require new changelog entry file label Sep 11, 2025
Copy link

⚠️ (this preview might not be accurate if the PR is not rebased on current master branch)

MCK 1.3.1 Release Notes

@viveksinghggits viveksinghggits merged commit f0f4584 into master Sep 12, 2025
32 of 37 checks passed
@viveksinghggits viveksinghggits deleted the fix-chart-linting-issues branch September 12, 2025 10:31
viveksinghggits added a commit that referenced this pull request Sep 23, 2025
…_repo`) (#450)

# Summary

Whenever we raised PR in to helm chart repo CI failed there because we
had linting issues in our helm chart. A previous PR that [I
raised](#445) fixed
the linting problem. But we should have a linting mechanism in our CI
that would consistently check if we have made any mistake in our charts.
This PR does that.

The `chart_schema.yaml` and `lintconf.yaml` are the default yaml files
using which `ct` should be run. And `ct` is the tool that is used for
linting in our helm charts repo.

## Proof of Work

Passing `lint_repo` task here
https://spruce.mongodb.com/version/68c43aae1d5d5d000770c624/tasks?sorts=STATUS%3AASC%3BBASE_STATUS%3ADESC
and in this PR as well.

## Checklist

- [x] Have you linked a jira ticket and/or is the ticket in the title?
- [x] Have you checked whether your jira ticket required DOCSP changes?
- [x] Have you added changelog file?
    - use `skip-changelog` label if not needed
- refer to [Changelog files and Release
Notes](https://github.com/mongodb/mongodb-kubernetes/blob/master/CONTRIBUTING.md#changelog-files-and-release-notes)
section in CONTRIBUTING.md for more details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changelog Use this label in Pull Request to not require new changelog entry file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants