Skip to content

Commit

Permalink
Renamed docs/developer-guide.md to docs/CONTRIBUTING.md (#353)
Browse files Browse the repository at this point in the history
Added Pull Request, Code Review and Best Practices sections to CONTRIBUTING.md
Added examples for running and excluding tests matching a regex
- Note, the CONTRIBUTING.MD is referenced in the github checks under the DCO details link

Signed-off-by: Eran Cohen <[email protected]>
  • Loading branch information
eranco74 authored and kubevirt-bot committed Jan 27, 2020
1 parent f719189 commit 2cf2d31
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 36 deletions.
66 changes: 66 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Design

The system is implemented as an k8s operator using the [operator-sdk](https://github.com/operator-framework/operator-sdk)
but is deployed as a DaemonSet instead of Deployment with [filtering](https://github.com/operator-framework/operator-sdk/blob/master/doc/user/event-filtering.md) only events for the DaemonSet pod node.

There are two controllers one for [Node](https://godoc.org/k8s.io/api/core/v1#Node)
and the other for the CRD NodeNeworkState.

## Components

- [Node Controller](docs/developer-guide-node.md) - developer guide and design of `Node` handler.
- [NodeNetworkState Controller](docs/developer-guide-state.md) - developer guide and design of `NodeNetworkState` handler.
- [NodeNetworkConfigurationPolicy Controller](docs/developer-guide-policy.md) - developer guide and design of `NodeNetworkConfigurationPolicy` handler.

# Development

[Development guide](docs/developer-guide-commands.md) is a go-to reference point for
development helper commands, building, testing, container images and local
cluster.

# Open a Pull Request
Kubernetes-nmstate generally follows the [standard github pull request process](https://gist.github.com/Chaser324/ce0505fbed06b947d962), but there is a layer of additional specific differences:

The first difference you'll see is that a bot will begin applying structured labels to your PR.

The bot may also make some helpful suggestions for commands to run in your PR to facilitate review.
These /command options can be entered in comments to trigger auto-labeling and notifications. Refer to its command reference documentation.

Common new contributor PR issues are:

Missing DCO sign-off:
Developers Certificate of Origin (DCO) Sign-off is a requirement for getting patches into the project (see [Developers Certificate of Origin](https://developercertificate.org/)).
You can "sign" this certificate by including a line in the git commit of "Signed-off-by: Legal Name <email-address>".
If you forgot to add the sign-off, you can also amend your commit with the sign-off:
`git commit --amend -s`.

## Code Review

To make it easier for your PR to receive reviews, consider the reviewers will need you to:

- Follow the project [coding conventions](https://github.com/golang/go/wiki/CodeReviewComments).
- Write [good commit messages](https://chris.beams.io/posts/git-commit/).
- Break large changes into a logical series of smaller patches which individually make easily understandable changes, and in aggregate solve a broader issue.

## Best Practices

- Write clear and meaningful git commit messages.
- If the PR will *completely* fix a specific issue, include `fixes #123` in the PR body (where 123 is the specific issue number the PR will fix. This will automatically close the issue when the PR is merged.
- Make sure you don't include `@mentions` or `fixes` keywords in your git commit messages. These should be included in the PR body instead.
- When you make a PR for small change (such as fixing a typo, style change, or grammar fix), please squash your commits so that we can maintain a cleaner git history.
- Make sure you include a clear and detailed PR description explaining the reasons for the changes, and ensuring there is sufficient information for the reviewer to understand your PR.

# Releasing

To cut a release, push images to quay and publish it on GitHub
the command `make release` do all this automatically, the version is at
`version/version.go` and the description at `version/description`.

So the step would be:
- Change version/version.go and versions/description
- Create a PR to review it
- Merge it to master
- Call `make release` from master

The environment variable GITHUB_TOKEN is needed to publish at GitHub and it must
point to a token generated by github to access projects.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,4 @@ through node state reporting and interface configuration.
## Development and Contributing
Contributions are welcome! Find details about the project's design and
development workflow in the [developer guide](docs/developer-guide.md).
development workflow in the [developer guide](CONTRIBUTING.md).
2 changes: 1 addition & 1 deletion docs/deployment-local-cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ the [deployment on arbitrary cluster guide](deployment-arbitrary-cluster.md).

Start your local cluster. If you want to use OpenShift instead of Kubernetes or
a different amount of nodes, check the
[development guide](developer-guide.md#local-cluster).
[development guide](../CONTRIBUTING.md#local-cluster).

Start the local cluster

Expand Down
6 changes: 6 additions & 0 deletions docs/developer-guide-commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ make test/unit
# Run e2e tests
# you need a running k8s/openshift cluster with with kubernets-nmstate running
make test/e2e

# Run tests matching the regex "NodeSelector"
make test/e2e E2E_TEST_ARGS='-ginkgo.focus=NodeSelector'

# Conversely, exclude tests that match the regex "Simple\ OVS*"
make test/e2e E2E_TEST_ARGS='--ginkgo.skip="Simple\ OVS*"'
```

## Containers
Expand Down
34 changes: 0 additions & 34 deletions docs/developer-guide.md

This file was deleted.

0 comments on commit 2cf2d31

Please sign in to comment.