We are thrilled to have you join us as a contributor! The Keptn Lifecycle Toolkit is a community-driven project and we greatly value collaboration. There are various ways to contribute to the Lifecycle Toolkit, and all contributions are highly valued. Please, explore the options below to learn more about how you can contribute.
Please make sure to read and observe our Code of Conduct.
-
Create an issue: If you have noticed a bug, want to contribute features, or simply ask a question that for whatever reason you do not want to ask in the Lifecycle Toolkit Channels in the CNCF Slack workspace, please search the issue tracker to see if someone else in the community has already created a ticket. If not, go ahead and create an issue.
-
Start contributing: We also have a list of good first issues. If you want to work on it, just post a comment on the issue.
-
Add yourself: Add yourself to the list of contributors along with your first pull request.
This document lays out how to get you started in contributing to Keptn Lifecycle Toolkit, so please read on.
If you are worried or don’t know where to start, check out our next section explaining what kind of help we could use and where you can get involved. You can reach out with the questions to Lifecycle Toolkit Channels on Slack and a mentor will surely guide you!
- Docker: a tool for containerization, which allows software applications to run in isolated environments and makes it easier to deploy and manage them.
- A Kubernetes
cluster >= Kubernetes 1.24
.If you don’t have one, we recommend Kubernetes-in-Docker(kind) to set up your local development environment. - kubectl: a command-line interface tool used for deploying and managing applications on Kubernetes clusters.
- kustomize: a tool used for customizing Kubernetes resource configurations and generating manifests.
- Helm: a package manager for Kubernetes that simplifies the deployment and management of applications on a Kubernetes cluster.
This project uses a set of linters to ensure good code quality. In order to make proper use of those linters inside an IDE, the following configuration is required.
Further information can also be found in
the golangci-lint
documentation.
In Visual Studio Code the Golang extension is required.
Adding the following lines to the Golang
extension
configuration file enables all linters used in this project.
"go.lintTool": {
"type": "string",
"default": "golangci-lint",
"description": "GolangGCI Linter",
"scope": "resource",
"enum": [
"golangci-lint",
]
},
"go.lintFlags": {
"type": "array",
"items": {
"type": "string"
},
"default": ["--fast", "--fix"],
"description": "Flags to pass to GCI Linter",
"scope": "resource"
},
-
Install either the GoLand or IntelliJ Integrated Development Environment (IDE) for the Go programming language, plus the Go Linter plugin.
-
The plugin can be installed via
Settings
>>Plugins
>>Marketplace
, search forGo Linter
and install it. Once installed, make sure that the plugin is using the.golangci.yml
file from the root directory. -
The configuration of
Go Linter
can be found in theTools
section of the settings.
If you are on Windows, you need to install make for the above process to complete.
Note When using the make command on Windows, you may receive an
unrecognized command
error for a command that is installed. This usually indicates thatPATH
for the binary is not set correctly).
We are using markdownlint to ensure consistent styling within our Markdown files. Specifically we are using markdownlint-cli.
We are using GNU MAKE
to ensure the same functionality locally and within our CI builds.
This should allow easier debugging and problem resolution.
To verify that your markdown code conforms to the rules, run the following on your local branch:
make markdownlint
To use the auto-fix option, run:
make markdownlint-fix
We use the default configuration values for markdownlint
.
This means:
- .markdownlint.yaml contains the rule configuration
- .markdownlintignore list files that markdown-lint ignores, using
.gitignore
conventions
We use the default values, so tools like markdownlint for VSCode can be used without additional configuration.
At this point, you should switch back to the main
branch in your repository,
and make sure it is up to date with main
branch of Keptn Lifecycle Toolkit:
git remote add upstream https://github.com/keptn/lifecycle-toolkit.git
git checkout main
git pull upstream main
Then update your feature branch from your local copy of main
and push it:
git checkout feature/123/foo
git rebase main
git push --set-upstream origin feature/123/foo
Note: All PRs must include a commit message with a description of the changes made!
Make sure you sign off your commits.
To do this automatically check this.
Finally, go to GitHub and create a Pull Request.
There should be a PR template already prepared for you.
If not, you will find it at .github/pull_request_template.md
.
Please describe what this PR is about and add a link to relevant GitHub issues.
If you changed something that is visible to the user, please add a screenshot.
Please follow the
conventional commit guidelines for your PR title.
If you only have one commit in your PR, please follow the guidelines for the message of that single commit, otherwise the PR title is enough. You can find a list of all possible feature types here.
An example for a pull request title would be:
feat(api): New endpoint for feature X (#1234)
If you have breaking changes in your PR, it is important to note them in the PR description but also in the merge commit for that PR.
When pressing "squash and merge", you have the option to fill out the commit message. Please use that feature to add the breaking changes according to the conventional commit guidelines. Also, please remove the PR number at the end and just add the issue number.
An example for a PR with breaking changes and the according merge commit:
feat(bridge): New button that breaks other things (#345)
BREAKING CHANGE: The new button added with #345 introduces new functionality that is not compatible with the previous type of sent events.
If your breaking change can be explained in a single line you can also use this form:
feat(bridge)!: New button that breaks other things (#345)
Following those guidelines helps us create automated releases where the commit and PR messages are directly used in the changelog.
In addition, please always ask yourself the following questions:
Based on the linked issue, what changes within the PR would you expect as a reviewer?
Your PR will usually be reviewed by the Keptn Lifecycle Toolkit team within a couple of days, but feel free to let us know about your PR via Slack.
Type can be:
feat
: a new featurefix
: a bug fixbuild
: changes that affect the build system or external dependencieschore
: other changes that don't modify source or test filesci
: changes to our CI configuration files and scriptsdocs
: documentation only changesperf
: a code change that improves performancerefactor
: a code change that neither fixes a bug nor adds a featurerevert
: reverts a previous commitstyle
: changes that do not affect the meaning of the codetest
: adding missing tests or correcting existing tests
We have a DCO check that runs on every PR to verify that the commit has been signed off.
To sign off the commits use -s
flag, you can can use
git commit -s -m "my awesome contribution"
To sign off the last commit you made, you can use
git commit --amend --signoff
or the command below to sign off the last 2 commits you made
git rebase HEAD~2 --signoff
This process is sometimes inconvenient but you can automate it by creating a pre-commit git hook as follows:
-
Create the hook:
touch .git/hooks/prepare-commit-msg
-
Add the following to the
prepare-commit-msg
file:SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1"
-
Give it execution permissions by calling:
chmod +x ./.git/hooks/prepare-commit-msg