Skip to content

Latest commit

 

History

History
105 lines (62 loc) · 4.97 KB

CONTRIBUTING.md

File metadata and controls

105 lines (62 loc) · 4.97 KB

Contributing

Grafana uses GitHub to manage contributions. 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

  • 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 or create a new issue if it does not exist. This will avoid unnecessary work and surely give you and us a good deal of inspiration.

  • Sign our CLA.

  • For changes in the backend, follow the style guides used in Go Code Review Comments and Peter Bourgon's Go: Best Practices for Production Environments

Steps to Contribute

Should you wish to work on a GitHub issue, check first if it is not already assigned to someone. If it is free, you claim it by commenting on the issue that you want to work on it. This is to prevent duplicated efforts from contributors on the same issue.

Please check the beginner friendly and help wanted labels to find issues that are good for getting started. If you have questions about one of the issues, with or without the tag, please comment on them and one of the core team or the original poster will clarify it.

To setup a local development environment we recommend reading Building Grafana from source

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

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

If the pull request needs changes before its merged the new commits should be rebased into one commit before its merged.

Backend dependency management

The Grafana project uses Go modules to manage dependencies on external packages. This requires a working Go environment with version 1.11 or greater installed.

All dependencies are vendored in the vendor/ directory.

To add or update a new dependency, use the go get command:

# Pick the latest tagged release.
go get example.com/some/module/pkg

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

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

PR and commit messages guidelines

PR title and squash commit messages should follow guidelines below:

Area of changes: Message

Detailed description

The Area of changes is related either to functional domain (i.e. Build, Release) or feature domain (i.e. Explore, Plugins, BarGaugePanel).

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.

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