|
@@ -1,18 +1,19 @@
|
|
|
-
|
|
|
|
|
# Contributing
|
|
# Contributing
|
|
|
|
|
|
|
|
Grafana uses GitHub to manage contributions.
|
|
Grafana uses GitHub to manage contributions.
|
|
|
Contributions take the form of pull requests that will be reviewed by the core team.
|
|
Contributions take the form of pull requests that will be reviewed by the core team.
|
|
|
|
|
|
|
|
-* If you are a new contributor see: [Steps to Contribute](#steps-to-contribute)
|
|
|
|
|
|
|
+- If you are a new contributor see: [Steps to Contribute](#steps-to-contribute)
|
|
|
|
|
|
|
|
-* If you have a trivial fix or improvement, go ahead and create a pull request.
|
|
|
|
|
|
|
+- If you have a trivial fix or improvement, go ahead and create a pull request.
|
|
|
|
|
|
|
|
-* If you plan to do something more involved, discuss your idea on the respective [issue](https://github.com/grafana/grafana/issues) or create a [new issue](https://github.com/grafana/grafana/issues/new) if it does not exist. This will avoid unnecessary work and surely give you and us a good deal of inspiration.
|
|
|
|
|
|
|
+- If you plan to do something more involved, discuss your idea on the respective [issue](https://github.com/grafana/grafana/issues) or create a [new issue](https://github.com/grafana/grafana/issues/new) if it does not exist. This will avoid unnecessary work and surely give you and us a good deal of inspiration.
|
|
|
|
|
|
|
|
-* Sign our [CLA](http://docs.grafana.org/contribute/cla/).
|
|
|
|
|
|
|
+- Sign our [CLA](http://docs.grafana.org/contribute/cla/).
|
|
|
|
|
|
|
|
-* For changes in the backend, follow the style guides used in Go [Code Review Comments](https://code.google.com/p/go-wiki/wiki/CodeReviewComments) and Peter Bourgon's [Go: Best Practices for Production Environments](http://peter.bourgon.org/go-in-production/#formatting-and-style)
|
|
|
|
|
|
|
+- Make sure to follow the code style guides
|
|
|
|
|
+ - [Backend](https://github.com/grafana/grafana/tree/master/pkg)
|
|
|
|
|
+ - [Frontend](https://github.com/grafana/grafana/tree/master/style_guides)
|
|
|
|
|
|
|
|
## Steps to Contribute
|
|
## Steps to Contribute
|
|
|
|
|
|
|
@@ -22,84 +23,40 @@ Please check the [`beginner friendly`](https://github.com/grafana/grafana/issues
|
|
|
|
|
|
|
|
To setup a local development environment we recommend reading [Building Grafana from source](http://docs.grafana.org/project/building_from_source/)
|
|
To setup a local development environment we recommend reading [Building Grafana from source](http://docs.grafana.org/project/building_from_source/)
|
|
|
|
|
|
|
|
-
|
|
|
|
|
## Pull Request Checklist
|
|
## Pull Request Checklist
|
|
|
|
|
|
|
|
-* Branch from the master branch and, if needed, rebase to the current master branch before submitting your pull request. If it doesn't merge cleanly with master you may be asked to rebase your changes.
|
|
|
|
|
-
|
|
|
|
|
-* If your patch is not getting reviewed or you need a specific person to review it, you can @-reply a reviewer asking for a review in the pull request or a comment.
|
|
|
|
|
-
|
|
|
|
|
-* Add tests relevant to the fixed bug or new feature.
|
|
|
|
|
-
|
|
|
|
|
-* Follow [PR and commit messages guidelines](#PR-and-commit-messages-guidelines)
|
|
|
|
|
-
|
|
|
|
|
-### Pull requests with new features
|
|
|
|
|
-Commits should be as small as possible, while ensuring that each commit is correct independently (i.e., each commit should compile and pass tests).
|
|
|
|
|
-
|
|
|
|
|
-Make sure to include `Closes #<issue number>` or `Fixes #<issue number>` in the pull request description.
|
|
|
|
|
-
|
|
|
|
|
-### Pull requests with bug fixes
|
|
|
|
|
-Please make all changes in one commit if possible. Include `Closes #<issue number>` in bottom of the commit message.
|
|
|
|
|
-A commit message for a bug fix should look something like this:
|
|
|
|
|
-
|
|
|
|
|
-```
|
|
|
|
|
-Dashboard: Avoid infinite loop in the dashboard provisioner
|
|
|
|
|
-
|
|
|
|
|
-If one dashboard with an uid is refered to by two
|
|
|
|
|
-provsioners each provisioner overwrite each other.
|
|
|
|
|
-filling up dashboard_versions quite fast if using
|
|
|
|
|
-default settings.
|
|
|
|
|
-
|
|
|
|
|
-Closes #12864
|
|
|
|
|
-```
|
|
|
|
|
-
|
|
|
|
|
-For more details about PR naming and commit messages please see [PR and commit messages guidelines](#PR-and-commit-messages-guidelines)
|
|
|
|
|
|
|
+- Branch from the master branch and, if needed, rebase to the current master branch before submitting your pull request. If it doesn't merge cleanly with master you may be asked to rebase your changes.
|
|
|
|
|
|
|
|
-If the pull request needs changes before its merged the new commits should be rebased into one commit before its merged.
|
|
|
|
|
|
|
+- If your patch is not getting reviewed or you need a specific person to review it, you can @-reply a reviewer asking for a review in the pull request or a comment.
|
|
|
|
|
|
|
|
-## Backend dependency management
|
|
|
|
|
|
|
+- Add tests relevant to the fixed bug or new feature.
|
|
|
|
|
|
|
|
-The Grafana project uses [Go modules](https://golang.org/cmd/go/#hdr-Modules__module_versions__and_more) to manage dependencies on external packages. This requires a working Go environment with version 1.11 or greater installed.
|
|
|
|
|
|
|
+- Follow [PR and commit messages guidelines](#PR-and-commit-messages-guidelines)
|
|
|
|
|
|
|
|
-All dependencies are vendored in the `vendor/` directory.
|
|
|
|
|
|
|
+### Pull Requests titles and message
|
|
|
|
|
|
|
|
-To add or update a new dependency, use the `go get` command:
|
|
|
|
|
|
|
+Pull request titles should follow this format: `Area: Name of the change`.
|
|
|
|
|
+Titles are used to generate the changelog so they should be as descriptive as possible in one line.
|
|
|
|
|
|
|
|
-```bash
|
|
|
|
|
-# Pick the latest tagged release.
|
|
|
|
|
-go get example.com/some/module/pkg
|
|
|
|
|
|
|
+Good Examples
|
|
|
|
|
|
|
|
-# Pick a specific version.
|
|
|
|
|
-go get example.com/some/module/pkg@vX.Y.Z
|
|
|
|
|
-```
|
|
|
|
|
-
|
|
|
|
|
-Tidy up the `go.mod` and `go.sum` files and copy the new/updated dependency to the `vendor/` directory:
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-```bash
|
|
|
|
|
-# The GO111MODULE variable can be omitted when the code isn't located in GOPATH.
|
|
|
|
|
-GO111MODULE=on go mod tidy
|
|
|
|
|
-
|
|
|
|
|
-GO111MODULE=on go mod vendor
|
|
|
|
|
-```
|
|
|
|
|
-
|
|
|
|
|
-You have to commit the changes to `go.mod`, `go.sum` and the `vendor/` directory before submitting the pull request.
|
|
|
|
|
|
|
+- `Explore: Adds Live option for supported datasources`
|
|
|
|
|
+- `GraphPanel: Don't sort series when legend table & sort column is not visible`
|
|
|
|
|
+- `Build: Support publishing MSI to grafana.com`
|
|
|
|
|
|
|
|
-## PR and commit messages guidelines
|
|
|
|
|
-PR title and squash commit messages should follow guidelines below:
|
|
|
|
|
|
|
+The message in the Pull requests should contain a reference so the issue if there is one. Ex `Closes #<issue number>`, `Fixes #<issue number>`, or `Ref #<issue number>` if the change is related to an issue but does not close it. Make sure to explain what problem the pull request is solving and why its implemented this way. As a new contributor its often better to overcommunicate to avoid back and forth communication, as it consumes time and energy.
|
|
|
|
|
|
|
|
-```
|
|
|
|
|
-Area of changes: Message
|
|
|
|
|
|
|
+### GIT commit formating.
|
|
|
|
|
|
|
|
-Detailed description
|
|
|
|
|
-```
|
|
|
|
|
|
|
+Grafana Squash Pull requests when merging them into master. This means the maintainer will be responsible for the title in the git commit message.
|
|
|
|
|
+The commit message of the commits in the Pull Request can still be part of the git commit body. So it's always encouraged to write informative commit messages.
|
|
|
|
|
|
|
|
-The `Area of changes` is related either to functional domain (i.e. Build, Release) or feature domain (i.e. Explore, Plugins, BarGaugePanel).
|
|
|
|
|
|
|
+The Git commit title should be short, descriptive and include the Pull Request ID.
|
|
|
|
|
|
|
|
|
|
+Good Examples
|
|
|
|
|
|
|
|
-`Message` should be concise, written in present tense and start with capitalised verb. Detailed description should be provided as commit message body, by entering a blank line between commit title and the description.
|
|
|
|
|
|
|
+- `Explore: Live supprt in datasources (#12345)`
|
|
|
|
|
+- `GraphPanel: Fix legend sorting issues (#12345)`
|
|
|
|
|
+- `Build: Support publishing MSI to grafana.com (#12345)`
|
|
|
|
|
|
|
|
-### Examples of good PR titles/commit messages:
|
|
|
|
|
-- `Explore: Adds Live option for supported datasources`
|
|
|
|
|
-- `GraphPanel: Don't sort series when legend table & sort column is not visible`
|
|
|
|
|
-- `Build: Support publishing MSI to grafana.com`
|
|
|
|
|
|
|
+Its also good practice to include a reference to the issue in the git commit body when possible.
|