Skip to content

Commit

Permalink
Merge pull request #361 from openebs/lvm-vm
Browse files Browse the repository at this point in the history
docs: improve contribution guides
  • Loading branch information
tiagolobocastro authored Jan 21, 2025
2 parents 76706be + f4cd440 commit 0d782d4
Show file tree
Hide file tree
Showing 14 changed files with 650 additions and 265 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_and_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ jobs:
- name: Running tests
env:
OPENEBS_NAMESPACE: "openebs"
run: ./ci/ci-test.sh
run: ./ci/ci-test.sh run

- name: Upload Coverage Report
uses: codecov/codecov-action@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ jobs:
- name: Running tests
env:
OPENEBS_NAMESPACE: "openebs"
run: ./ci/ci-test.sh
run: ./ci/ci-test.sh run

- name: Upload Coverage Report
uses: codecov/codecov-action@v4
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ tags
*.test
coverage.txt
/tests/bdd_coverage.txt
/nixos.qcow2
42 changes: 24 additions & 18 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# Contributing Guidelines

<BR>

## Umbrella Project

OpenEBS is an "umbrella project". Every project, repository and file in the OpenEBS organization adopts and follows the policies found in the Community repo umbrella project files.
<BR>

This project follows the [OpenEBS Contributor Guidelines](https://github.com/openebs/community/blob/HEAD/CONTRIBUTING.md)

# Contributing to LocalPV-LVM
## Contributing to LocalPV-LVM

LVM LocalPV uses the standard GitHub pull requests process to review and accept contributions. There are several areas 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. The issues are maintained at [lvm-localpv/issues](https://github.com/openebs/lvm-localpv/issues) repository.

Expand All @@ -16,7 +18,7 @@ LVM LocalPV uses the standard GitHub pull requests process to review and accept
* If you would like to make code contributions, please start with [Setting up the Development Environment](#setting-up-your-development-environment).
* If you would like to work on something more involved, please connect with the OpenEBS Contributors. See [OpenEBS Community](https://github.com/openebs/openebs/tree/HEAD/community)

## Steps to Contribute
### Steps to Contribute

LocalPV-LVM is an Apache 2.0 Licensed project and all your commits should be signed with Developer Certificate of Origin. See [Sign your work](#sign-your-work).

Expand All @@ -30,27 +32,29 @@ LocalPV-LVM is an Apache 2.0 Licensed project and all your commits should be sig
* 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

## Pull Request Checklist
* Rebase to the current develop 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.
- Before committing your code, make sure you have run `make format` and `make manifests`, to format the code and autogenerate the CRDs yaml.
- Pass the compile and tests - includes spell checks, formatting, etc.
- Commit header (first line) should convey what changed and it should follow the commit [guideline](https://github.com/openebs/openebs/blob/HEAD/contribute/git-commit-message.md)
- Commit body should include details such as why the changes are required and how the proposed changes help
- DCO Signed
* For code changes, add tests relevant to the fixed bug or new feature.
* Before committing your code, make sure you have run `make format` and `make manifests`, to format the code and autogenerate the CRDs yaml.
* Pass the compile and tests - includes spell checks, formatting, etc.
* Commit header (first line) should convey what changed and it should follow the commit [guideline](https://github.com/openebs/openebs/blob/HEAD/contribute/git-commit-message.md)
* Commit body should include details such as why the changes are required and how the proposed changes help
* DCO Signed
* If your PR is not getting reviewed or you need a specific person to review it, please reach out to the OpenEBS Contributors. See [OpenEBS Community](https://github.com/openebs/openebs/tree/HEAD/community)

---
## Sign your work

### Sign your work

We use the Developer Certificate of Origin (DCO) as an additional safeguard for the OpenEBS projects. 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 read [dcofile](https://github.com/openebs/openebs/blob/HEAD/contribute/developer-certificate-of-origin). If you can certify it, then just add a line to every git commit message:

Please certify it by just adding a line to every git commit message. Any PR with Commits which does not have DCO Signoff will not be accepted:
````

```text
Signed-off-by: Random J Developer <[email protected]>
````
```

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`.
Expand All @@ -59,19 +63,21 @@ You can also use git [aliases](https://git-scm.com/book/tr/v2/Git-Basics-Git-Ali

---

## Adding a changelog
### Adding a changelog

If PR is about adding a new feature or bug fix then the Author of the PR is expected to add a changelog file with their pull request. This changelog file should be a new file created under the `changelogs/unreleased` folder. Name of this file must be in `pr_number-username` format and contents of the file should be the one-liner text which explains the feature or bug fix.

```sh
lvm-localpv/changelogs/unreleased <- folder
12-github_user_name <- file
```
## Setting up your Development Environment

### 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.

For setting up a Development environment on your local host, see the detailed instructions [here](./docs/developer-setup.md).
* 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.

For setting up a Development environment on your local host, see the detailed instructions [here](./docs/developer-setup.md).
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ clean:
@echo "--> Cleaning Directory" ;
go clean -testcache
rm -rf bin
CLEANUP_ONLY=1 ./ci/ci-test.sh
./ci/ci-test.sh clean
chmod -R u+w ${GOPATH}/bin/${CSI_DRIVER} 2>/dev/null || true
chmod -R u+w ${GOPATH}/pkg/* 2>/dev/null || true
rm -rf ${GOPATH}/bin/${CSI_DRIVER}
Expand Down Expand Up @@ -231,6 +231,14 @@ lvm-driver-image: lvm-driver
cd buildscripts/${CSI_DRIVER} && docker build -t ${IMAGE_ORG}/${CSI_DRIVER}:${IMAGE_TAG} ${DBUILD_ARGS} . && docker tag ${IMAGE_ORG}/${CSI_DRIVER}:${IMAGE_TAG} quay.io/${IMAGE_ORG}/${CSI_DRIVER}:${IMAGE_TAG}
@rm buildscripts/${CSI_DRIVER}/${CSI_DRIVER}

.PHONY: image-tag
image-tag:
@echo ${IMAGE_TAG}

.PHONY: image-ref
image-ref:
@echo docker.io/${IMAGE_ORG}/${CSI_DRIVER}:${IMAGE_TAG}

.PHONY: ci
ci:
@echo "--> Running ci test";
Expand Down
7 changes: 1 addition & 6 deletions buildscripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,9 @@ if [ "$GOOS" = "windows" ]; then
output_name+='.exe'
fi

if command -v musl-gcc; then
CC="musl-gcc"
fi

env CC="$CC" GOOS="$GOOS" GOARCH="$GOARCH" go build -ldflags \
env CC="$CC" GOOS="$GOOS" GOARCH="$GOARCH" CGO_ENABLED=0 go build -ldflags \
"-X github.com/openebs/lvm-localpv/pkg/version.GitCommit=${GIT_COMMIT} \
-X main.CtlName='${CTLNAME}' \
-linkmode external -extldflags -static \
-X github.com/openebs/lvm-localpv/pkg/version.Version=${VERSION} \
-X github.com/openebs/lvm-localpv/pkg/version.VersionMeta=${VERSION_META}" \
-o "$output_name" \
Expand Down
Loading

0 comments on commit 0d782d4

Please sign in to comment.