From 058debee67a9986c0a7df17f28166113631f86f4 Mon Sep 17 00:00:00 2001 From: bergquist Date: Wed, 13 Feb 2019 14:05:23 +0100 Subject: [PATCH 1/8] contributing: improve guide for bug fixes --- .github/PULL_REQUEST_TEMPLATE.md | 1 + CONTRIBUTING.md | 24 +++++++++++++++++++++--- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 4b4588eab21..830bbab24da 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,4 +1,5 @@ * Link the PR to an issue for new features * Rebase your PR if it gets out of sync with master +* Follow the contribution guidelines in `CONTRIBUTING.md` **REMOVE THE TEXT ABOVE BEFORE CREATING THE PULL REQUEST** diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8b2ba090fe1..a9e2e6fcc80 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -8,7 +8,7 @@ Contributions take the form of pull requests that will be reviewed by the core t * 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. ## Steps to Contribute @@ -49,8 +49,26 @@ go test -v ./pkg/... * 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. -* Commits should be as small as possible, while ensuring that each commit is correct independently (i.e., each commit should compile and pass tests). - * 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. + +### 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). + +### Bug fixes +Please make all changes in one commit if possible. Include `closes #12345` in bottom of the commit message. +A commit message for a bugfix should look something like this. + +```git +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 +``` + + From 0e6800495f06bafd781cbf0fee44af7f8f9db4c7 Mon Sep 17 00:00:00 2001 From: bergquist Date: Thu, 14 Feb 2019 09:02:51 +0100 Subject: [PATCH 2/8] mentioned closes/fixes for new features --- CONTRIBUTING.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a9e2e6fcc80..bcbd3edb6aa 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -56,11 +56,13 @@ go test -v ./pkg/... ### 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 #` or `fixes #` in the pull request description. + ### Bug fixes Please make all changes in one commit if possible. Include `closes #12345` in bottom of the commit message. -A commit message for a bugfix should look something like this. +A commit message for a bug fix should look something like this. -```git +``` avoid infinite loop in the dashboard provisioner if one dashboard with an uid is refered to by two @@ -71,4 +73,4 @@ default settings. closes #12864 ``` - +If the pull request needs changes before its merged the new commits should be rebased into one commit before its merged. \ No newline at end of file From 982f2620891e118a7305674f8a6bc1b1d3d67957 Mon Sep 17 00:00:00 2001 From: bergquist Date: Thu, 14 Feb 2019 09:13:58 +0100 Subject: [PATCH 3/8] make bug/feature titles more verbose --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bcbd3edb6aa..aa4e271daf8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -53,12 +53,12 @@ go test -v ./pkg/... * Add tests relevant to the fixed bug or new feature. -### New features +### 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 #` or `fixes #` in the pull request description. -### Bug fixes +### Pull requests with bug fixes Please make all changes in one commit if possible. Include `closes #12345` in bottom of the commit message. A commit message for a bug fix should look something like this. From e22cba67dc886ba2b7b5ae35acc0acde9f54f46a Mon Sep 17 00:00:00 2001 From: bergquist Date: Thu, 14 Feb 2019 14:26:25 +0100 Subject: [PATCH 4/8] removes testing instruction from contributing doc --- CONTRIBUTING.md | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index aa4e271daf8..95cdaf3d612 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -17,34 +17,6 @@ Should you wish to work on a GitHub issue, check first if it is not already assi Please check the [`beginner friendly`](https://github.com/grafana/grafana/issues?q=is%3Aopen+is%3Aissue+label%3A%22beginner+friendly%22) label 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. - - -## Setup - -Follow the setup guide in README.md - -### Rebuild frontend assets on source change -``` -yarn watch -``` - -### Rerun tests on source change -``` -yarn jest -``` - -### Run tests for backend assets before commit -``` -test -z "$(gofmt -s -l . | grep -v -E 'vendor/(github.com|golang.org|gopkg.in)' | tee /dev/stderr)" -``` - -### Run tests for frontend assets before commit -``` -yarn test -go test -v ./pkg/... -``` - - ## 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. From 681269b3fe1b9f865ea67deeccc91eeb737b04be Mon Sep 17 00:00:00 2001 From: bergquist Date: Thu, 14 Feb 2019 14:53:46 +0100 Subject: [PATCH 5/8] contributing: adds link to our CLA --- CONTRIBUTING.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 95cdaf3d612..00af4a482fa 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -10,6 +10,9 @@ Contributions take the form of pull requests that will be reviewed by the core t * 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/). + +* 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) ## Steps to Contribute From 3f714fbd1b7fb3ae5457d9a803035d726f51314c Mon Sep 17 00:00:00 2001 From: bergquist Date: Thu, 14 Feb 2019 14:54:09 +0100 Subject: [PATCH 6/8] contributing: adds link to help wanted label --- CONTRIBUTING.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 00af4a482fa..9f7808353b2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -18,7 +18,10 @@ Contributions take the form of pull requests that will be reviewed by the core t 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`](https://github.com/grafana/grafana/issues?q=is%3Aopen+is%3Aissue+label%3A%22beginner+friendly%22) label 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. +Please check the [`beginner friendly`](https://github.com/grafana/grafana/issues?q=is%3Aopen+is%3Aissue+label%3A%22beginner+friendly%22) and [`help wanted`](https://github.com/grafana/grafana/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22) 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](http://docs.grafana.org/project/building_from_source/) + ## Pull Request Checklist From b37e05714cd8994ad8723e86879d27563510aa60 Mon Sep 17 00:00:00 2001 From: bergquist Date: Thu, 14 Feb 2019 15:22:13 +0100 Subject: [PATCH 7/8] link to contributing guidelines in pr template --- .github/PULL_REQUEST_TEMPLATE.md | 4 ++-- CONTRIBUTING.md | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 830bbab24da..c0231bcbe18 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,5 +1,5 @@ -* Link the PR to an issue for new features * Rebase your PR if it gets out of sync with master -* Follow the contribution guidelines in `CONTRIBUTING.md` +* Follow the contribution guidelines in [`CONTRIBUTING.md`](https://github.com/grafana/grafana/blob/master/CONTRIBUTING.md) +* Include `closes #` or a link to the issue in the description **REMOVE THE TEXT ABOVE BEFORE CREATING THE PULL REQUEST** diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9f7808353b2..677a12831dc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -10,7 +10,7 @@ Contributions take the form of pull requests that will be reviewed by the core t * 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) @@ -34,7 +34,7 @@ To setup a local development environment we recommend reading [Building Grafana ### 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 #` or `fixes #` in the pull request description. +Make sure to include `closes #` or `fixes #` in the pull request description. ### Pull requests with bug fixes Please make all changes in one commit if possible. Include `closes #12345` in bottom of the commit message. @@ -51,4 +51,4 @@ default settings. closes #12864 ``` -If the pull request needs changes before its merged the new commits should be rebased into one commit before its merged. \ No newline at end of file +If the pull request needs changes before its merged the new commits should be rebased into one commit before its merged. \ No newline at end of file From 72f522bb51dec34c379ecd1a78d6c0d216c043cd Mon Sep 17 00:00:00 2001 From: bergquist Date: Thu, 14 Feb 2019 15:24:00 +0100 Subject: [PATCH 8/8] rearrange bullet points in PR template [skip ci] --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index c0231bcbe18..69ce3168730 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,5 +1,5 @@ -* Rebase your PR if it gets out of sync with master * Follow the contribution guidelines in [`CONTRIBUTING.md`](https://github.com/grafana/grafana/blob/master/CONTRIBUTING.md) +* Rebase your PR if it gets out of sync with master * Include `closes #` or a link to the issue in the description **REMOVE THE TEXT ABOVE BEFORE CREATING THE PULL REQUEST**