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

Linting for K8s YAML files #1901

Merged
merged 8 commits into from
Jun 22, 2022
Merged

Linting for K8s YAML files #1901

merged 8 commits into from
Jun 22, 2022

Conversation

Rishit-dagli
Copy link
Contributor

What this PR does / why we need it:

This PR verifies the format of YAML files in this repo using yamllint as discussed in #1734 (comment) and #1859

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #1859

Checklist:

  • Docs included if any changes are user facing

@johnugeorge
Copy link
Member

Thanks @Rishit-dagli for the PR

Charmed-Katib is not maintained by community. You can create a new one.

@Rishit-dagli
Copy link
Contributor Author

Thanks @Rishit-dagli for the PR

Charmed-Katib is not maintained by community. You can create a new one.

Ah, thanks for the info. I'll create a new workflow.

@Rishit-dagli Rishit-dagli marked this pull request as ready for review June 21, 2022 16:42
@google-oss-prow google-oss-prow bot requested a review from tenzen-y June 21, 2022 16:42
@tenzen-y
Copy link
Member

@Rishit-dagli Thanks for creating this PR!

@johnugeorge
Should we add scripts to run on the local machines in another PR?

@johnugeorge
Copy link
Member

we can do the same as https://github.com/kubeflow/katib/blob/master/.github/workflows/test-shell-script.yaml#L17 using make

Also, should we treat warnings as errors using strict flag?

@tenzen-y
Copy link
Member

tenzen-y commented Jun 21, 2022

we can do the same as https://github.com/kubeflow/katib/blob/master/.github/workflows/test-shell-script.yaml#L17 using make

SGTM @johnugeorge
Can you update this PR like shellcheck? @Rishit-dagli

@Rishit-dagli Do we already have any manifests to hit line-length violations?

--------------------------- edit ---------------------------

Also, should we treat warnings as errors using strict flag?

It might be better not to use a strict flag.
What do you think? @anencore94 @johnugeorge

@coveralls
Copy link

coveralls commented Jun 21, 2022

Coverage Status

Coverage increased (+0.3%) to 73.232% when pulling a996aac on Rishit-dagli:Rishit-dagli-yamllint into 7bf3922 on kubeflow:master.

@anencore94
Copy link
Member

Also, should we treat warnings as errors using strict flag?

I agree with you @tenzen-y :) Lots of our example manifests might violates line-length rule because of useful comments for users

@johnugeorge
Copy link
Member

https://github.com/kubeflow/katib/runs/6989547788?check_suite_focus=true

I see two warnings here
warning missing document start "---" (document-start)
warning too few spaces before comment (comments)

@Rishit-dagli
Copy link
Contributor Author

Rishit-dagli commented Jun 22, 2022

@tenzen-y

Do we already have any manifests to hit line-length violations?

Yes, please see this output for a list of the files that violate line-length: out.txt

Can you update this PR like shellcheck?

Sure thing 👍

@Rishit-dagli
Copy link
Contributor Author

Rishit-dagli commented Jun 22, 2022

@johnugeorge

https://github.com/kubeflow/katib/runs/6989547788?check_suite_focus=true

I see two warnings here warning missing document start "---" (document-start) warning too few spaces before comment (comments)

I will edit the YAML files accordingly, I believe this should be done in a separate PR since it isn't actually "adding a linter", what do you think?

@johnugeorge
Copy link
Member

Please rebase

@Rishit-dagli
Copy link
Contributor Author

Please rebase

Done ✅

Copy link
Member

@tenzen-y tenzen-y left a comment

Choose a reason for hiding this comment

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

Thanks! @Rishit-dagli
/lgtm

@Rishit-dagli
Copy link
Contributor Author

This pull-request has been approved by: #1901, #1901 (review)
To complete the pull request process, please assign johnugeorge after the PR has been reviewed.

/assign @johnugeorge

@johnugeorge
Copy link
Member

Thanks @Rishit-dagli

/approve

@google-oss-prow
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: johnugeorge, Rishit-dagli, tenzen-y

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-prow google-oss-prow bot merged commit 9ee8fda into kubeflow:master Jun 22, 2022
@Rishit-dagli Rishit-dagli deleted the Rishit-dagli-yamllint branch June 22, 2022 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add linter for Kubernetes manifests
5 participants