cluster-api-provider-ibmcloud icon indicating copy to clipboard operation
cluster-api-provider-ibmcloud copied to clipboard

Add .yamllint config file to use yamllint to enhance linting for yaml files

Open yuanning6 opened this issue 1 year ago • 18 comments

… files

What this PR does / why we need it:

This PR adds a .yamllint config file which has rules to config yamllint to enhance linting for yaml files. The lint will be helpful to avoid issues like https://github.com/kubernetes-sigs/cluster-api-provider-ibmcloud/commit/7cd7fcc1c0448df9caae393fa63720a874b36c85.

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 #1497

Special notes for your reviewer:

This is a quick implementation just to give an overview and directions, I will continuously make improvements and changes as needed.

To install and use yamllint: Quickstart To see the behavior: Run yamllint . in the project root directory to lint all yaml files.

/area provider/ibmcloud

  1. Please confirm that if this PR changes any image versions, then that's the sole change this PR makes. This PR doesn't change any image versions.

Release note:


yuanning6 avatar Nov 29 '23 18:11 yuanning6

CLA Signed

The committers listed above are authorized under a signed CLA.

  • :white_check_mark: login: yuanning6 / name: Yuanning Liu (92765a29db4da7ad11b85a1e9af08230fcfded1b, 0c4bfa76de50564f4c8a89d4c87aae7d1360f4c0)

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: yuanning6 Once this PR has been reviewed and has the lgtm label, please assign jichenjc for approval. For more information see the Kubernetes Code Review Process.

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 /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

k8s-ci-robot avatar Nov 29 '23 18:11 k8s-ci-robot

Deploy Preview for kubernetes-sigs-cluster-api-ibmcloud ready!

Name Link
Latest commit 0c4bfa76de50564f4c8a89d4c87aae7d1360f4c0
Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-cluster-api-ibmcloud/deploys/65a857fe8333c30008bede5a
Deploy Preview https://deploy-preview-1521--kubernetes-sigs-cluster-api-ibmcloud.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

netlify[bot] avatar Nov 29 '23 18:11 netlify[bot]

Welcome @yuanning6!

It looks like this is your first PR to kubernetes-sigs/cluster-api-provider-ibmcloud 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/cluster-api-provider-ibmcloud has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. :smiley:

k8s-ci-robot avatar Nov 29 '23 18:11 k8s-ci-robot

Hi @yuanning6. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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/test-infra repository.

k8s-ci-robot avatar Nov 29 '23 18:11 k8s-ci-robot

/cc @Prajyot-Parab

mkumatag avatar Nov 30 '23 06:11 mkumatag

/easycla

Prajyot-Parab avatar Nov 30 '23 07:11 Prajyot-Parab

/ok-to-test

Prajyot-Parab avatar Nov 30 '23 07:11 Prajyot-Parab

@yuanning6 Few Pointers -

  1. Include a Makefile target to install yamllint
  2. Skip autogenerated config dir from liniting (config dir)
  3. lets fix all the linting issues seen

Prajyot-Parab avatar Dec 01 '23 05:12 Prajyot-Parab

@yuanning6 Few Pointers -

  1. Include a Makefile target to install yamllint
  2. Skip autogenerated config dir from liniting (config dir)
  3. lets fix all the linting issues seen

@Prajyot-Parab Thank you for taking the review! I'll work on them after the busy finals :')

yuanning6 avatar Dec 07 '23 17:12 yuanning6

@Prajyot-Parab Hi! I made some changes based on your pointers: https://github.com/kubernetes-sigs/cluster-api-provider-ibmcloud/pull/1521/commits/d1ab3ea2bd8ad15642a4e5a76fec0925f37d671b

I removed one rule which was to check the Document Start Marker from yaml files. Now it gives warning: "missing document start "---"", it used to give another warning when the Document Start Marker is not asked: "found forbidden document start "---"". Not sure whether this rule should be included or not, it gives a warning no matter what. To output only error level problems we can use --no-warnings flag.

Regarding the Makefile part, I'm not sure if I completely understood your requirements. Please let me know if there's anything I need to change!

There's also a conflict: https://github.com/kubernetes-sigs/cluster-api-provider-ibmcloud/pull/1521/conflicts. Do I have the permission to resolve it?

yuanning6 avatar Dec 19 '23 21:12 yuanning6

@yuanning6: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-cluster-api-provider-ccm-image db52cded47b760123471ca411a38963851e45aea link true /test pull-cluster-api-provider-ccm-image

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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/test-infra repository. I understand the commands that are listed here.

k8s-ci-robot avatar Jan 14 '24 02:01 k8s-ci-robot

Hi @Prajyot-Parab , hope you had a great holiday!

I updated my branch to make it keep up with the main branch, but there's still the conflict. And After updating, it shows I want to merge 40 commits into main, I'm not sure whether something went wrong or not... t-t

Could you please give me some guidance? Thank you!!

yuanning6 avatar Jan 14 '24 02:01 yuanning6

Hi @Prajyot-Parab , hope you had a great holiday!

I updated my branch to make it keep up with the main branch, but there's still the conflict. And After updating, it shows I want to merge 40 commits into main, I'm not sure whether something went wrong or not... t-t

Could you please give me some guidance? Thank you!!

Step 1 - You should be on your commit Step 2 - Fetch latest upstream code git fetch upstream Step 3 - Rebase your branch with upstream/main git rebase upstream/main Step 4 (Only incase of conflicts) - Fix conflicts if any, git add fixed files, git rebase --continue Step 5 - Push code to your brach on forked repo git push origin main --force

Prajyot-Parab avatar Jan 16 '24 05:01 Prajyot-Parab

Hi @Prajyot-Parab , I followed your instruction, it worked! Thank you so much! I would be very grateful if you could take a look at the code at your convenience. :))

yuanning6 avatar Jan 17 '24 23:01 yuanning6

PR needs rebase.

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/test-infra repository.

k8s-ci-robot avatar Mar 24 '24 16:03 k8s-ci-robot

@yuanning6 any update on this one.

Prajyot-Parab avatar Apr 04 '24 18:04 Prajyot-Parab

@Prajyot-Parab Sorry I'm a bit busy these days, will look into it next week!

yuanning6 avatar Apr 05 '24 15:04 yuanning6

Hi @Prajyot-Parab !

I made another PR: https://github.com/kubernetes-sigs/cluster-api-provider-ibmcloud/pull/1727 (because I messed up with commits in the previous one...). This one has the targets to run yamllint outputting warnings level problems or not outputting.

Please let me know if any improvements are needed!

yuanning6 avatar Apr 15 '24 20:04 yuanning6

/close in favor of #1727

Prajyot-Parab avatar May 03 '24 20:05 Prajyot-Parab

/close

Prajyot-Parab avatar May 03 '24 20:05 Prajyot-Parab

@Prajyot-Parab: Closed this PR.

In response to this:

/close

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.

k8s-ci-robot avatar May 03 '24 20:05 k8s-ci-robot