Skip to content

Commit

Permalink
Merge pull request traefik#1482 from ldez/docs/github-template
Browse files Browse the repository at this point in the history
doc: enhance GitHub template.
  • Loading branch information
ldez authored Apr 25, 2017
2 parents 4f2a2d5 + 972579e commit 34b21b9
Show file tree
Hide file tree
Showing 7 changed files with 141 additions and 36 deletions.
10 changes: 5 additions & 5 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
16 changes: 0 additions & 16 deletions .github/ISSUE_TEMPLATE

This file was deleted.

45 changes: 45 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<!--
How to write a good issue?
Read https://github.com/containous/traefik/blob/master/.github/how-to-write-a-good-issue.md
And the contributing guide: https://github.com/containous/traefik/blob/master/.github/CONTRIBUTING.md
-->

### 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)
```
<!--
Add more configuration information here.
-->


### If applicable, please paste the log output in debug mode (`--debug` switch)

```
(paste your output here)
```
13 changes: 13 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!--
How to write a good pull request?
Read https://github.com/containous/traefik/blob/master/.github/how-to-write-a-good-pull-request.md.
And the contributing guide: https://github.com/containous/traefik/blob/master/.github/CONTRIBUTING.md.
-->

### Description

<!--
Briefly describe the pull request in a few paragraphs.
-->
25 changes: 25 additions & 0 deletions .github/how-to-write-a-good-issue.md
Original file line number Diff line number Diff line change
@@ -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.


13 changes: 13 additions & 0 deletions .github/how-to-write-a-good-pull-request.md
Original file line number Diff line number Diff line change
@@ -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/).
55 changes: 40 additions & 15 deletions cmd/traefik/bug.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,51 @@ import (

var (
bugtracker = "https://github.com/containous/traefik/issues/new"
bugTemplate = `### What version of Traefik are you using?
` + "```" + `
{{.Version}}
` + "```" + `
bugTemplate = `<!--
How to write a good issue?
Read https://github.com/containous/traefik/blob/master/.github/how-to-write-a-good-issue.md
And the contributing guide: https://github.com/containous/traefik/blob/master/.github/CONTRIBUTING.md
-->
### 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}}
` + "```" + `
<!--
Add more configuration information here.
-->
### If applicable, please paste the log output in debug mode (` + "`" + `--debug` + "`" + ` switch)
` + "```" + `
(paste your output here)
` + "```" + `
`
)

Expand Down Expand Up @@ -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)
}
Expand All @@ -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")
}
Expand Down

0 comments on commit 34b21b9

Please sign in to comment.