From ccff8a80f535eee6cce5223dcb19c1f60fa99be5 Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Sat, 22 Apr 2017 17:49:26 +0200 Subject: [PATCH 1/2] doc: enhance GitHub template. - add issue and PR guide. - rewrite templates --- .github/CONTRIBUTING.md | 10 ++--- .github/ISSUE_TEMPLATE | 16 -------- .github/ISSUE_TEMPLATE.md | 45 +++++++++++++++++++++ .github/PULL_REQUEST_TEMPLATE.md | 13 ++++++ .github/how-to-write-a-good-issue.md | 25 ++++++++++++ .github/how-to-write-a-good-pull-request.md | 13 ++++++ 6 files changed, 101 insertions(+), 21 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE create mode 100644 .github/ISSUE_TEMPLATE.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/how-to-write-a-good-issue.md create mode 100644 .github/how-to-write-a-good-pull-request.md diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 626b8501e..fea086637 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -33,7 +33,7 @@ traefik* - You need `go` v1.7+ - It is recommended you clone Træfik into a directory like `~/go/src/github.com/containous/traefik` (This is the official golang workspace hierarchy, and will allow dependencies to resolve properly) - This will allow your `GOPATH` and `PATH` variable to be set to `~/go` via: -``` +```bash $ export GOPATH=~/go $ export PATH=$PATH:$GOPATH/bin ``` @@ -95,7 +95,7 @@ Test success ``` For development purposes, you can specify which tests to run by using: -``` +```bash # Run every tests in the MyTest suite TESTFLAGS="-check.f MyTestSuite" make test-integration @@ -124,7 +124,7 @@ The [documentation site](http://docs.traefik.io/) is built with [mkdocs](http:// First make sure you have python and pip installed -``` +```shell $ python --version Python 2.7.2 $ pip --version @@ -133,13 +133,13 @@ pip 1.5.2 Then install mkdocs with pip -``` +```shell $ pip install mkdocs ``` To test documentation locally run `mkdocs serve` in the root directory, this should start a server locally to preview your changes. -``` +```shell $ mkdocs serve INFO - Building documentation... WARNING - Config value: 'theme'. Warning: The theme 'united' will be removed in an upcoming MkDocs release. See http://www.mkdocs.org/about/release-notes/ for more details diff --git a/.github/ISSUE_TEMPLATE b/.github/ISSUE_TEMPLATE deleted file mode 100644 index fc377a34b..000000000 --- a/.github/ISSUE_TEMPLATE +++ /dev/null @@ -1,16 +0,0 @@ -### What version of Traefik are you using (`traefik version`)? - - -### What is your environment & configuration (arguments, toml...)? - - -### What did you do? - - -### What did you expect to see? - - -### What did you see instead? - - -### If applicable, please paste the log output in debug mode (`--debug` switch) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 000000000..9793f916e --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,45 @@ + + +### Do you want to request a *feature* or report a *bug*? + + + +### What did you do? + + + +### What did you expect to see? + + + +### What did you see instead? + + + +### Output of `traefik version`: (_What version of Traefik are you using?_) + +``` +(paste your output here) +``` + +### What is your environment & configuration (arguments, toml, provider, platform, ...)? + +```toml +# (paste your configuration here) +``` + + + +### If applicable, please paste the log output in debug mode (`--debug` switch) + +``` +(paste your output here) +``` diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 000000000..d31463dc1 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,13 @@ + + +### Description + + \ No newline at end of file diff --git a/.github/how-to-write-a-good-issue.md b/.github/how-to-write-a-good-issue.md new file mode 100644 index 000000000..eec4e93af --- /dev/null +++ b/.github/how-to-write-a-good-issue.md @@ -0,0 +1,25 @@ +# How to write a good issue + +Please keep in mind that the GitHub issue tracker is not intended as a general support forum, but for reporting bugs and feature requests. + +For other type of questions, consider using one of: + +- the [Traefik community Slack channel](https://traefik.herokuapp.com) +- [StackOverflow](https://stackoverflow.com/questions/tagged/traefik) + +## Title + +The title must be short and descriptive. + +## Description of the issue + +- Explain the conditions which led you to write this issue: the context. +- The context should lead to something, an idea or a problem that you’re facing. +- Remain clear and concise. + +## Format your messages + +Help the reader focus on what matters and understand the structure of your message. +[GitHub flavored markdown](https://help.github.com/articles/github-flavored-markdown) has a simple but effective syntax: make use of bold text, lists, check-boxes, syntax highlighting, headers, lists, links and images. + + diff --git a/.github/how-to-write-a-good-pull-request.md b/.github/how-to-write-a-good-pull-request.md new file mode 100644 index 000000000..5d4155ce3 --- /dev/null +++ b/.github/how-to-write-a-good-pull-request.md @@ -0,0 +1,13 @@ +# How to write a good pull request + +- Make it small +- Do only one thing +- Avoid re-formatting +- Make sure the code builds +- Make sure all tests pass +- Add tests +- Write useful descriptions and titles +- Address review comments in terms of additional commits. +- Do not amend/squash existing ones unless the PR is trivial. + +Read [10 tips for better pull requests](http://blog.ploeh.dk/2015/01/15/10-tips-for-better-pull-requests/). From 972579e2a093a48a83a92e0563828b95f2912893 Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Mon, 24 Apr 2017 11:38:05 +0200 Subject: [PATCH 2/2] refactor(bugCmd): update issue template. - fix collides with imported package name. --- cmd/traefik/bug.go | 55 +++++++++++++++++++++++++++++++++------------- 1 file changed, 40 insertions(+), 15 deletions(-) diff --git a/cmd/traefik/bug.go b/cmd/traefik/bug.go index b4bce78c0..e76a30091 100644 --- a/cmd/traefik/bug.go +++ b/cmd/traefik/bug.go @@ -16,26 +16,51 @@ import ( var ( bugtracker = "https://github.com/containous/traefik/issues/new" - bugTemplate = `### What version of Traefik are you using? -` + "```" + ` -{{.Version}} -` + "```" + ` + bugTemplate = ` + +### Do you want to request a *feature* or report a *bug*? -### What is your environment & configuration (arguments, toml...)? -` + "```" + ` -{{.Configuration}} -` + "```" + ` ### What did you do? + ### What did you expect to see? + ### What did you see instead? -### If applicable, please paste the log output in debug mode ('--debug' switch) + +### Output of ` + "`" + `traefik version` + "`" + `: (_What version of Traefik are you using?_) + +` + "```" + ` +{{.Version}} +` + "```" + ` + +### What is your environment & configuration (arguments, toml, provider, platform, ...)? + +` + "```" + `toml +{{.Configuration}} +` + "```" + ` + + + +### If applicable, please paste the log output in debug mode (` + "`" + `--debug` + "`" + ` switch) + +` + "```" + ` +(paste your output here) +` + "```" + ` + ` ) @@ -78,8 +103,8 @@ func newBugCmd(traefikConfiguration interface{}, traefikPointersConfiguration in } body := bug.String() - url := bugtracker + "?body=" + url.QueryEscape(body) - if err := openBrowser(url); err != nil { + URL := bugtracker + "?body=" + url.QueryEscape(body) + if err := openBrowser(URL); err != nil { fmt.Print("Please file a new issue at " + bugtracker + " using this template:\n\n") fmt.Print(body) } @@ -92,15 +117,15 @@ func newBugCmd(traefikConfiguration interface{}, traefikPointersConfiguration in } } -func openBrowser(url string) error { +func openBrowser(URL string) error { var err error switch runtime.GOOS { case "linux": - err = exec.Command("xdg-open", url).Start() + err = exec.Command("xdg-open", URL).Start() case "windows": - err = exec.Command("rundll32", "url.dll,FileProtocolHandler", url).Start() + err = exec.Command("rundll32", "url.dll,FileProtocolHandler", URL).Start() case "darwin": - err = exec.Command("open", url).Start() + err = exec.Command("open", URL).Start() default: err = fmt.Errorf("unsupported platform") }