X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=XTesting%2Fkubespray%2FCONTRIBUTING.md;fp=XTesting%2Fkubespray%2FCONTRIBUTING.md;h=a6ebdb22be10b24fd4e54fae2e00751ddff6c7d6;hb=31af17bb5935b722dcf59d5800aaff9e789cfa93;hp=0000000000000000000000000000000000000000;hpb=c8bda4f07b7e87beb2aa3d8729f9b0b456d4da6f;p=it%2Ftest.git diff --git a/XTesting/kubespray/CONTRIBUTING.md b/XTesting/kubespray/CONTRIBUTING.md new file mode 100644 index 0000000..a6ebdb2 --- /dev/null +++ b/XTesting/kubespray/CONTRIBUTING.md @@ -0,0 +1,39 @@ +# Contributing guidelines + +## How to become a contributor and submit your own code + +### Environment setup + +It is recommended to use filter to manage the GitHub email notification, see [examples for setting filters to Kubernetes Github notifications](https://github.com/kubernetes/community/blob/master/communication/best-practices.md#examples-for-setting-filters-to-kubernetes-github-notifications) + +To install development dependencies you can set up a python virtual env with the necessary dependencies: + +```ShellSession +virtualenv venv +source venv/bin/activate +pip install -r tests/requirements.txt +``` + +#### Linting + +Kubespray uses `yamllint` and `ansible-lint`. To run them locally use `yamllint .` and `ansible-lint`. It is a good idea to add call these tools as part of your pre-commit hook and avoid a lot of back end forth on fixing linting issues (). + +#### Molecule + +[molecule](https://github.com/ansible-community/molecule) is designed to help the development and testing of Ansible roles. In Kubespray you can run it all for all roles with `./tests/scripts/molecule_run.sh` or for a specific role (that you are working with) with `molecule test` from the role directory (`cd roles/my-role`). + +When developing or debugging a role it can be useful to run `molecule create` and `molecule converge` separately. Then you can use `molecule login` to SSH into the test environment. + +#### Vagrant + +Vagrant with VirtualBox or libvirt driver helps you to quickly spin test clusters to test things end to end. See [README.md#vagrant](README.md) + +### Contributing A Patch + +1. Submit an issue describing your proposed change to the repo in question. +2. The [repo owners](OWNERS) will respond to your issue promptly. +3. Fork the desired repo, develop and test your code changes. +4. Sign the CNCF CLA () +5. Submit a pull request. +6. Work with the reviewers on their suggestions. +7. Ensure to rebase to the HEAD of your target branch and squash un-necessary commits () before final merger of your contribution.