From 3653817068d8345f8b63b338c2b676b18a75f26b Mon Sep 17 00:00:00 2001 From: Shubham Chaudhary Date: Wed, 13 Oct 2021 12:56:00 +0530 Subject: [PATCH] chore(charts): update readme, contributor guide and github actions (#31) Signed-off-by: shubham chaudhary --- .github/CODEOWNERS | 5 +++ .github/ISSUE_TEMPLATE.md | 27 ++++++++++++++ .github/PULL_REQUEST_TEMPLATE.md | 18 ++++++++++ .github/auto-merge.yml | 23 ++++++++++++ .github/workflows/build.yml | 11 ++++++ CONTRIBUTING.md | 60 ++++++++++++++++++++++++++++++++ README.md | 35 ++++++++++++------- 7 files changed, 166 insertions(+), 13 deletions(-) create mode 100644 .github/CODEOWNERS create mode 100644 .github/ISSUE_TEMPLATE.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/auto-merge.yml create mode 100644 CONTRIBUTING.md diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 00000000..fa08998c --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,5 @@ +# Lines starting with '#' are comments. +# Each line is a file pattern followed by one or more owners. + +# These owners will be the default owners for everything in the repo. +* @ispeakc0de @ksatchit @uditgaurav diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 00000000..6716fbdb --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,27 @@ + + + +## Is this a BUG REPORT or FEATURE REQUEST? + + Choose one: BUG REPORT or FEATURE REQUEST + + + +**What happened**: + +**What you expected to happen**: + +**How to reproduce it (as minimally and precisely as possible)**: + +**Anything else we need to know?**: \ No newline at end of file diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..21d9554b --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,18 @@ + + +**What this PR does / why we need it**: + +**Which issue this PR fixes** *(optional, in `fixes #(, fixes #, ...)` format, will close that issue when PR gets merged)*: fixes # + +**Special notes for your reviewer**: + +**Checklist:** +- [ ] Fixes # +- [ ] PR messages has document related information +- [ ] Labelled this PR & related issue with `breaking-changes` tag +- [ ] PR messages has breaking changes related information +- [ ] Labelled this PR & related issue with `requires-upgrade` tag +- [ ] PR messages has upgrade related information +- [ ] Commit has unit tests +- [ ] Commit has integration tests +- [ ] E2E run Required for the changes diff --git a/.github/auto-merge.yml b/.github/auto-merge.yml new file mode 100644 index 00000000..5d951100 --- /dev/null +++ b/.github/auto-merge.yml @@ -0,0 +1,23 @@ +# Configuration for probot-auto-merge - https://github.com/bobvanderlinden/probot-auto-merge + +reportStatus: true +updateBranch: false +deleteBranchAfterMerge: true +mergeMethod: squash + +minApprovals: + COLLABORATOR: 0 +maxRequestedChanges: + NONE: 0 +blockingLabels: +- DO NOT MERGE +- WIP +- blocked + +# Will merge whenever the above conditions are met, but also +# the owner has approved or merge label was added. +rules: +- minApprovals: + OWNER: 1 +- requiredLabels: + - merge diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2017264a..c522969a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,6 +24,17 @@ jobs: - name: unused-package check run: make unused-package-check + security: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: Run Snyk to check for vulnerabilities + uses: snyk/actions/golang@master + env: + SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} + with: + args: --severity-threshold=high + trivy: needs: pre-checks runs-on: ubuntu-latest diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..c1e031f2 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,60 @@ +# Contributing to Litmus-Go + +Litmus is an Apache 2.0 Licensed project and uses the standard GitHub pull requests process to review and accept contributions. + +There are several areas of Litmus that could use your help. For starters, you could help in improving the sections in this document by either creating a new issue describing the improvement or submitting a pull request to this repository. + +- If you are a first-time contributor, please see [Steps to Contribute](#steps-to-contribute). +- If you would like to suggest new tests to be added to litmus, please go ahead and [create a new issue](https://github.com/litmuschaos/litmus/issues/new) describing your test. All you need to do is specify the workload type and the operations that you would like to perform on the workload. +- If you would like to work on something more involved, please connect with the Litmus Contributors. +- If you would like to make code contributions, all your commits should be signed with Developer Certificate of Origin. See [Sign your work](#sign-your-work). + +## Steps to Contribute + +- Find an issue to work on or create a new issue. The issues are maintained at [litmuschaos/litmus](https://github.com/litmuschaos/litmus/issues). You can pick up from a list of [good-first-issues](https://github.com/litmuschaos/litmus/labels/good%20first%20issue). +- Claim your issue by commenting your intent to work on it to avoid duplication of efforts. +- Fork the repository on GitHub. +- Create a branch from where you want to base your work (usually master). +- Make your changes. +- Relevant coding style guidelines are the [Go Code Review Comments](https://code.google.com/p/go-wiki/wiki/CodeReviewComments) and the _Formatting and style_ section of Peter Bourgon's [Go: Best Practices for Production Environments](http://peter.bourgon.org/go-in-production/#formatting-and-style). +- Commit your changes by making sure the commit messages convey the need and notes about the commit. +- Push your changes to the branch in your fork of the repository. +- Submit a pull request to the original repository. See [Pull Request checklist](#pull-request-checklist) + +## Pull Request Checklist + +- Rebase to the current master branch before submitting your pull request. +- Commits should be as small as possible. Each commit should follow the checklist below: + - For code changes, add tests relevant to the fixed bug or new feature + - Pass the compile and tests - includes spell checks, formatting, etc + - Commit header (first line) should convey what changed + - Commit body should include details such as why the changes are required and how the proposed changes + - DCO Signed + +- If your PR is not getting reviewed or you need a specific person to review it, please reach out to the Litmus contributors at the [Litmus slack channel](https://app.slack.com/client/T09NY5SBT/CNXNB0ZTN) + +## Sign your work + +We use the Developer Certificate of Origin (DCO) as an additional safeguard for the LitmusChaos project. This is a well established and widely used mechanism to assure that contributors have confirmed their right to license their contribution under the project's license. Please add a line to every git commit message: + + ```sh + Signed-off-by: Random J Developer + ``` + +Use your real name (sorry, no pseudonyms or anonymous contributions). The email id should match the email id provided in your GitHub profile. +If you set your `user.name` and `user.email` in git config, you can sign your commit automatically with `git commit -s`. + +You can also use git [aliases](https://git-scm.com/book/tr/v2/Git-Basics-Git-Aliases) like `git config --global alias.ci 'commit -s'`. Now you can commit with `git ci` and the commit will be signed. + +## Setting up your Development Environment + +This project is implemented using Go and uses the standard golang tools for development and build. In addition, this project heavily relies on Docker and Kubernetes. It is expected that the contributors. + +- are familiar with working with Go +- are familiar with Docker containers +- are familiar with Kubernetes and have access to a Kubernetes cluster or Minikube to test the changes. + +## Community + +The litmus community will have a monthly community sync-up on 3rd Wednesday 22.00-23.00IST / 18.30-19.30CEST +- The community meeting details are available [here](https://hackmd.io/a4Zu_sH4TZGeih-xCimi3Q). Please feel free to join the community meeting. diff --git a/README.md b/README.md index e51e8fdb..f334f926 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,13 @@ - # Litmus chaos-scheduler for injecting chaos experiments on Kubernetes + +[![Slack Channel](https://img.shields.io/badge/Slack-Join-purple)](https://slack.litmuschaos.io) +![GitHub Workflow](https://github.com/litmuschaos/chaos-scheduler/actions/workflows/push.yml/badge.svg?branch=master) +[![Docker Pulls](https://img.shields.io/docker/pulls/litmuschaos/chaos-scheduler.svg)](https://hub.docker.com/r/litmuschaos/chaos-scheduler) +[![GitHub issues](https://img.shields.io/github/issues/litmuschaos/chaos-scheduler)](https://github.com/litmuschaos/chaos-scheduler/issues) +[![Twitter Follow](https://img.shields.io/twitter/follow/litmuschaos?style=social)](https://twitter.com/LitmusChaos) +[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/5299/badge)](https://bestpractices.coreinfrastructure.org/projects/5299) +[![Go Report Card](https://goreportcard.com/badge/github.com/litmuschaos/chaos-scheduler)](https://goreportcard.com/report/github.com/litmuschaos/chaos-scheduler) +[![YouTube Channel](https://img.shields.io/badge/YouTube-Subscribe-red)](https://www.youtube.com/channel/UCa57PMqmz_j0wnteRa9nCaw) Litmus chaos scheduler is used by Kubernetes application developers and SREs to inject chaos into the applications and Kubernetes infrastructure periodically based on the specified schedule. Perform the following steps to use the chaos scheduler: @@ -78,22 +86,22 @@ spec: ## What is a chaos engine? -Refer -- https://github.com/litmuschaos/chaos-operator -- https://docs.litmuschaos.io/docs/getstarted/ +The ChaosEngine is the main user-facing chaos custom resource with a namespace scope and is designed to hold information around how the chaos experiments are executed. It connects an application instance with one or more chaos experiments, + +For more details [refer](https://v1-docs.litmuschaos.io/docs/chaosengine/) ## What is a litmus chaos chart and how can I use it? -Refer -- https://github.com/litmuschaos/chaos-charts -- https://hub.litmuschaos.io/ +Litmus chaos chart is the heart of litmus and contains the low-level execution information. They serve as off-the-shelf templates that one needs to "pull" (install on the cluster) before including them as part of a chaos run against any target applications (the binding being defined in the ChaosEngine). + +For more details refer [litmus docs](https://v1-docs.litmuschaos.io/docs/chaosexperiment/) and [hub](https://hub.litmuschaos.io/). ## What are the steps to get started? - Install Operator Components and RBAC and CRDs ```bash - kubectl apply -f https://litmuschaos.github.io/pages/litmus-operator-latest.yaml + kubectl apply -f https://litmuschaos.github.io/litmus/litmus-operator-latest.yaml ``` - Install Scheduler and it's CRDs @@ -107,13 +115,13 @@ Refer - Create the pod delete Chaos Experiment in default namespace ``` - kubectl apply -f https://raw.githubusercontent.com/litmuschaos/chaos-charts/1.4.0/charts/generic/pod-delete/experiment.yaml + kubectl apply -f https://raw.githubusercontent.com/litmuschaos/chaos-charts/master/charts/generic/pod-delete/experiment.yaml ``` - Create the RBAC for execute the pod-delete chaos ```bash - kubectl apply -f https://raw.githubusercontent.com/litmuschaos/chaos-charts/1.4.0/charts/generic/pod-delete/rbac.yaml + kubectl apply -f https://raw.githubusercontent.com/litmuschaos/chaos-charts/master/charts/generic/pod-delete/rbac.yaml ``` - Annotate your application to enable chaos. For ex: @@ -233,9 +241,10 @@ Refer ## Where are the docs? -They are available at [litmus docs](https://docs.litmuschaos.io) +They are available at [litmus docs](https://docs.litmuschaos.io) and [experiment docs](https://litmuschaos.github.io/litmus/experiments/concepts/chaos-resources/contents/) ## How do I contribute? -The Chaos scheduler is in _alpha_ stage and needs all the help you can provide! Please contribute by raising issues, -improving the documentation, contributing to the core framework and tooling, etc. +You can contribute by raising issues, improving the documentation, contributing to the core framework and tooling, etc. + +Head over to the [Contribution guide](CONTRIBUTING.md)