-
Notifications
You must be signed in to change notification settings - Fork 312
Add yamllint checks #8461
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
base: main
Are you sure you want to change the base?
Add yamllint checks #8461
Conversation
Add a yamllint config to enforce yaml formatting standards. Since infra-deployments hasn't had a standard until now, different components follow different conventions for formatting. In particular, both the indentation and line-length rules were causing a lot of noise in yamllint's output. Until we have a better solution in place to fix these conventions, ignore those rules. Futhermore, ignore a few paths that are a common cause for lint warnings: - Helm charts, which may not necessarily follow our style guides. Since there's little we can actually do to fix them in this repository, ignore them for yaml linting purposes. - Templates ususally are invalid for one reason or another, and there's little we should do to fix them. Ignore them. Part-of: KFLUXINFRA-2285 Signed-off-by: Andy Sadler <[email protected]>
Run yamlfixer[^1] on our manifests. There are still some manifests that require fixing, but this takes care of most of the outliers. [^1]: https://pypi.org/project/yamlfixer-opt-nc/ Part-of: KFLUXINFRA-2285 Signed-off-by: Andy Sadler <[email protected]>
After autoformatting, some of our manifests still don't pass yamllint checks due to invalid syntax. Fix the remaining errors. Part-of: KFLUXINFRA-2285 Signed-off-by: Andy Sadler <[email protected]>
To ensure our manifests remain valid and comply with our linting rules, run yaml linting checks as a part of CI. Part-of: KFLUXINFRA-2284 Signed-off-by: Andy Sadler <[email protected]>
🤖 Gemini AI Assistant AvailableHi @sadlerap! I'm here to help with your pull request. You can interact with me using the following commands: Available Commands
How to Use
PermissionsOnly OWNER, MEMBER, or COLLABORATOR users can trigger my responses. This ensures secure and appropriate usage. This message was automatically added to help you get started with the Gemini AI assistant. Feel free to delete this comment if you don't need assistance. |
🤖 Hi @sadlerap, I've received your request, and I'm working on it now! You can track my progress in the logs for more details. |
/retest |
kind: ApplicationSet | ||
version: v1alpha1 | ||
name: has | ||
- path: production-overlay-patch.yaml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIUC this will result in a functional change, not just a yaml lint autofix, no?
kind: ApplicationSet | ||
version: v1alpha1 | ||
name: has | ||
- path: production-overlay-patch.yaml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: aThorp96, sadlerap The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@sadlerap: The following tests failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Add and enforce some rules on yaml manifest styles.
Since most manifests were added by different teams following their own style conventions, we're not going to enforce a lot of strict rules, since that's just churn. However, we do want to have some rules, so we're only disabling the rules causing the most issues and aren't able to be autofixed:
line-length
andindentation
lints.Not all manifests will be checked. Helm charts aren't controlled by us, so there's little we can do to fix any warnings yamllint informs us about. Templates also usually have special characters that are technically invalid yaml syntax, so most of those should be ignored to avoid false positives.
While we're at it, yamllint caught some manifests with invalid syntax, so fix those. Let's also enforce these checks as a part of our CI checks so that we don't introduce manifests with syntax errors into our production environments.