From 9ab7f587620d69e4e8fc98faabce6417c35f7497 Mon Sep 17 00:00:00 2001 From: Thomas Schuetz Date: Thu, 23 Mar 2023 16:43:18 +0100 Subject: [PATCH 1/4] docs: add some important information to contributing Signed-off-by: Thomas Schuetz --- CONTRIBUTING.md | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f5d47fe..82020a2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,5 +1,30 @@ # Contributing ## Requirements - - Golang `1.20` +- An OpenAI API key + * OpenAI API keys can be obtained from [OpenAI](https://platform.openai.com/account/api-keys) + * You can set the API key for k8sgpt using `./k8sgpt auth key` +- If you want to build the container image, you need to have a container engine (docker, podman, rancher, etc.) installed + +## Building +Building the binary is as simple as running `go build .` in the root of the repository. If you want to build the container image, you can run `docker build -t k8sgpt -f container/Dockerfile .` in the root of the repository. + +## Releasing +Releases of k8sgpt are done using [Release Please](https://github.com/googleapis/release-please) and [GoReleaser](https://goreleaser.com/). The workflow looks like this: + +* A PR is merged to the `main` branch: + * Release please is triggered, creates or updates a new release PR + * This is done with every merge to main, the current release PR is updated every time + +* Merging the 'release please' PR to `main`: + * Release please is triggered, creates a new release and updates the changelog based on the commit messages + * GoReleaser is triggered, builds the binaries and attaches them to the release + * Containers are created and pushed to the container registry + +> With the next relevant merge, a new release PR will be created and the process starts again + +### Manually setting the version +If you want to manually set the version, you can create a PR with an empty commit message that contains the version number in the commit message. For example: + +Such a commit can get produced as follows: `git commit --allow-empty -m "chore: release 0.0.3" -m "Release-As: 0.0.3` \ No newline at end of file From c69d1ba696ec6dc8507641b1cecdbffe53df773b Mon Sep 17 00:00:00 2001 From: Thomas Schuetz Date: Thu, 23 Mar 2023 17:07:59 +0100 Subject: [PATCH 2/4] doc: add information about some processes Signed-off-by: Thomas Schuetz --- CONTRIBUTING.md | 77 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 76 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 82020a2..68be5e9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,4 +1,5 @@ # Contributing +We're happy that you want to contribute to this project. Please read the sections to make the process as smooth as possible. ## Requirements - Golang `1.20` @@ -7,6 +8,78 @@ * You can set the API key for k8sgpt using `./k8sgpt auth key` - If you want to build the container image, you need to have a container engine (docker, podman, rancher, etc.) installed +## Getting Started + +**Where should I start?** +- If you are new to the project, please check out the [good first issue](https://github.com/k8sgpt-ai/k8sgpt/labels/good%20first%20issue) label. +- If you are looking for something to work on, check out our [open issues](https://github.com/k8sgpt-ai/k8sgpt/issues). + +**Getting in touch with the community** +* Join our [#k8sgpt slack channel](https://slack.cloud-native.io/channels/k8sgpt) + +**How do I contribute?** +- Fork the repository +- Create a new branch +- Make your changes +- Create a pull request +- Wait for a review and address any comments + +**Opening PRs** +- As long as you are working on your PR, please mark it as a draft +- Please make sure that your PR is up to date with the latest changes in `main` +- Fill out the PR template +- Mention the issue that your PR is addressing (closes: #) +- Make sure that your PR passes all checks + +**Reviewing PRs** +- Be respectful and constructive +- Assign yourself to the PR +- Check if all checks are passing + - If not, request changes +- Suggest changes instead of simply commenting on found issues +- If you are unsure about something, ask the author +- If you are not sure if the changes work, try them out +- Reach out to other reviewers if you are unsure about something +- If you are happy with the changes, approve the PR +- Merge the PR once it has all approvals and the checks are passing + +## DCO +We have a DCO check which runs on every PR to verify that the commit has been signed off. + +To sign off the last commit you made, you can use + +``` +git commit --amend --signoff +``` + +You can also automate signing off your commits by adding the following to your `.zshrc` or `.bashrc`: + +``` +git() { + if [ $# -gt 0 ] && [[ "$1" == "commit" ]] ; then + shift + command git commit --signoff "$@" + else + command git "$@" + fi +} +``` + +## Semantic commits +We use [Semantic Commits](https://www.conventionalcommits.org/en/v1.0.0/) to make it easier to understand what a commit does and to build pretty changelogs. Please use the following prefixes for your commits: +- `feat`: A new feature +- `fix`: A bug fix +- `docs`: Documentation changes +- `chores`: Changes to the build process or auxiliary tools and libraries such as documentation generation +- `refactor`: A code change that neither fixes a bug nor adds a feature +- `test`: Adding missing tests or correcting existing tests +- `ci`: Changes to our CI configuration files and scripts + +An example for this could be: +``` +git commit -m "docs: add a new section to the README" +``` + ## Building Building the binary is as simple as running `go build .` in the root of the repository. If you want to build the container image, you can run `docker build -t k8sgpt -f container/Dockerfile .` in the root of the repository. @@ -27,4 +100,6 @@ Releases of k8sgpt are done using [Release Please](https://github.com/googleapis ### Manually setting the version If you want to manually set the version, you can create a PR with an empty commit message that contains the version number in the commit message. For example: -Such a commit can get produced as follows: `git commit --allow-empty -m "chore: release 0.0.3" -m "Release-As: 0.0.3` \ No newline at end of file +Such a commit can get produced as follows: `git commit --allow-empty -m "chore: release 0.0.3" -m "Release-As: 0.0.3` + + From 26449e10efd8926cccd4a2eaa4e9dc3afa8bd01a Mon Sep 17 00:00:00 2001 From: Thomas Schuetz Date: Thu, 23 Mar 2023 17:55:44 +0100 Subject: [PATCH 3/4] docs: update CONTRIBUTING Signed-off-by: Thomas Schuetz --- CONTRIBUTING.md | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 68be5e9..247a3df 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -13,20 +13,28 @@ We're happy that you want to contribute to this project. Please read the section **Where should I start?** - If you are new to the project, please check out the [good first issue](https://github.com/k8sgpt-ai/k8sgpt/labels/good%20first%20issue) label. - If you are looking for something to work on, check out our [open issues](https://github.com/k8sgpt-ai/k8sgpt/issues). +- If you have an idea for a new feature, please open an issue, and we can discuss it. +- We are also happy to help you find something to work on. Just reach out to us. **Getting in touch with the community** * Join our [#k8sgpt slack channel](https://slack.cloud-native.io/channels/k8sgpt) +* Introduce yourself on the slack channel or open an issue to let us know that you are interested in contributing + +**Discuss issues** +* Before you start working on something, propose and discuss your solution on the issue +* If you are unsure about something, ask the community **How do I contribute?** -- Fork the repository -- Create a new branch +- Fork the repository and clone it locally +- Create a new branch and follow [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) guidelines for work undertaken - Make your changes -- Create a pull request +- Keep pull requests small and focused, if you have multiple changes, please open multiple PRs +- Create a pull request back to the upstream repository and follow follow the [pull request template](.github/pull_request_template.md) guidelines. - Wait for a review and address any comments **Opening PRs** - As long as you are working on your PR, please mark it as a draft -- Please make sure that your PR is up to date with the latest changes in `main` +- Please make sure that your PR is up-to-date with the latest changes in `main` - Fill out the PR template - Mention the issue that your PR is addressing (closes: #) - Make sure that your PR passes all checks @@ -35,7 +43,6 @@ We're happy that you want to contribute to this project. Please read the section - Be respectful and constructive - Assign yourself to the PR - Check if all checks are passing - - If not, request changes - Suggest changes instead of simply commenting on found issues - If you are unsure about something, ask the author - If you are not sure if the changes work, try them out From 05a787d53dfe5e625c6449ac1e21ec36e66ddd28 Mon Sep 17 00:00:00 2001 From: Thomas Schuetz Date: Thu, 23 Mar 2023 18:09:39 +0100 Subject: [PATCH 4/4] docs: update CONTRIBUTING Signed-off-by: Thomas Schuetz --- CONTRIBUTING.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 247a3df..1c00217 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -27,6 +27,7 @@ We're happy that you want to contribute to this project. Please read the section **How do I contribute?** - Fork the repository and clone it locally - Create a new branch and follow [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) guidelines for work undertaken +- Assign yourself to the issue, if you are working on it (if you are not a member of the organization, please leave a comment on the issue) - Make your changes - Keep pull requests small and focused, if you have multiple changes, please open multiple PRs - Create a pull request back to the upstream repository and follow follow the [pull request template](.github/pull_request_template.md) guidelines.