Thank you for your interest in contributing to k6provision!
Before you begin, make sure to familiarize yourself with the Code of Conduct. If you've previously contributed to other open source project, you may recognize it as the classic Contributor Covenant.
If you want to chat with the team or the community, you can join our community forums.
Don't be afraid to file issues! Nobody can fix a bug we don't know exists, or add a feature we didn't think of.
The worst that can happen is that someone closes it and points you in the right direction.
That said, "how do I..."-type questions are often more suited for community forums.
If you'd like to contribute code, this is the basic procedure.
-
Find an issue you'd like to fix. If there is none already, or you'd like to add a feature, please open one, and we can talk about how to do it. Out of respect for your time, please start a discussion regarding any bigger contributions either in a GitHub Issue, in the community forums before you get started on the implementation.
Remember, there's more to software development than code; if it's not properly planned, stuff gets messy real fast.
-
Create a fork and open a feature branch -
feature/my-cool-featureis the classic way to name these, but it really doesn't matter. -
Create a pull request!
-
We will discuss implementation details until everyone is happy, then a maintainer will merge it.
Prerequisites are listed in the tools section in addition to the go toolchain and git CLI.
The Makefile is generated from the task list defined in the CONTRIBUTING.md file using the cdo tool. If the contribution is made to the task list, the Makefile must be regenerated, which is why the cdo tool is needed. The cdo tool can most conveniently be installed using the eget tool.
eget szkiba/cdoThe tasks defined here can be executed manually or conveniently using the make or cdo tool.
Help about tasks
The command below lists the possible tasks.
using make:
makeusing cdo:
cdoExecute task
Tasks are executed by passing the name of the task as a parameter.
using make:
make tasknameusing cdo:
cdo tasknameContributing will require the use of some tools, which can be installed most easily with a well-configured eget tool.
eget szkiba/mdcode
eget golangci/golangci-lint
eget goreleaser/goreleaserThe golangci-lint tool is used for static analysis of the source code. It is advisable to run it before committing the changes.
golangci-lint run ./...The go test command is used to run the tests and generate the coverage report.
go test -count 1 -race -coverprofile=coverage.txt -timeout 60s ./...The go cover tool should be used to display the coverage report in the browser.
Requires : test
go tool cover -html=coverage.txtThis is the easiest way to create an executable binary (although the release process uses the goreleaser tool to create release versions).
go build -ldflags="-w -s" -o build/k6provision ./cmd/k6provisionThe goreleaser command-line tool is used during the release process. During development, it is advisable to create binaries with the same tool from time to time.
goreleaser build --snapshot --clean --single-target -o build/k6provisionUpdate the CLI documentation and the example code in README.md.
go run ./tools/gendoc README.md
mdcode updateDelete the work files created in the work directory (also included in .gitignore).
rm -rf ./coverage.txt ./buildPerforms the most important tasks. It can be used to check whether the CI workflow will run successfully.
Requires : clean, makefile, format, test, build, snapshot, readme
go fmt ./...cdo --makefile Makefile