You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+102-36
Original file line number
Diff line number
Diff line change
@@ -1,22 +1,29 @@
1
1
# Contributing to Flux
2
2
3
-
## Bug reports
4
-
Before you file an issue, please search existing issues in case it has already
5
-
been filed, or perhaps even fixed. If you file an issue, please include the following.
6
-
7
-
* Full details of your operating system (or distribution) e.g. 64-bit Ubuntu 14.04.
8
-
* The version of Flux you are running.
9
-
* Whether you installed it using a pre-built package, or built it from source.
10
-
* A small test case, if applicable, that demonstrates the issues.
11
-
12
-
Remember the golden rule of bug reports: **The easier you make it for us to reproduce
13
-
the problem, the faster it will get fixed.** If you have never written a bug report
14
-
before, or if you want to brush up on your bug reporting skills, we recommend reading
15
-
[Simon Tatham's essay "How to Report Bugs Effectively."](http://www.chiark.greenend.org.uk/~sgtatham/bugs.html)
16
-
17
-
Please note that issues are *not the place to file general questions* such as
18
-
"how do I use InfluxDB with Flux?" Questions of this nature should be sent to the
19
-
[InfluxData Community](https://community.influxdata.com/), not filed as issues.
3
+
## Community Slack Channel
4
+
When contributing to Flux, it is a good idea to join the [community Slack channel](https://www.influxdata.com/slack).
5
+
The development team for Flux is in the `#flux` channel and we will be able to answer any questions or give any recommendations for development work from there.
6
+
7
+
## Filing issues
8
+
Filing issues on GitHub is one of the easiest and most useful ways to contribute to Flux.
9
+
We value every request and we intend to triage every community issue within a week after it has been created.
10
+
If it takes us longer than a week, then please try to contact us in the community Slack channel.
11
+
12
+
Before you file an issue, please search existing issues in case it has already been filed or perhaps even resolved.
13
+
14
+
### Bug reports
15
+
When submitting a bug report, please include the following:
16
+
17
+
- Full details of your operating system (or distribution) e.g. 64-bit Ubuntu 14.04.
18
+
- The version of Flux you are running.
19
+
- Whether you installed it using a pre-built package or built it from source.
20
+
- A small test case that demonstrates the issue or steps to reproduce the issue.
21
+
22
+
Remember the golden rule of bug reports: **The easier you make it for us to reproduce the problem, the faster it will get fixed.
23
+
**If you have never written a bug report before, or if you want to brush up on your bug reporting skills, we recommend reading [Simon Tatham's essay "How to Report Bugs Effectively."](http://www.chiark.greenend.org.uk/~sgtatham/bugs.html)
24
+
25
+
Please note that issues are *not the place to file general questions* such as "how do I use InfluxDB with Flux?"
26
+
Questions of this nature should be sent to the [InfluxData Community](https://community.influxdata.com/), not filed as issues.
20
27
Issues like this will be closed.
21
28
22
29
## Feature requests
@@ -25,6 +32,17 @@ Please be clear about your requirements. Incomplete feature requests may simply
25
32
be closed if we don't understand what you would like to see added to Flux.
26
33
27
34
## Contributing to the source code
35
+
36
+
### Signing the CLA
37
+
In order to contribute back to Flux, you must sign the
The Flux team regularly adds the [community](https://github.com/influxdata/flux/issues?q=is%3Aopen+is%3Aissue+label%3Acommunity) label to issues that we think would be accessible for a community member to take.
42
+
Before starting to work on an issue, please inform us on GitHub about your intention to work on the issue by leaving a comment on the issue.
43
+
This allows us to know that you want to work on the issue, that the issue is updated with the needed information, and to be ready for a pull request when the work is done.
44
+
45
+
### Contributing to the source code
28
46
Flux uses Go modules and requires modules to be enabled to build from source.
29
47
Please refer to the Go documentation on [modules](https://golang.org/cmd/go/#hdr-Modules__module_versions__and_more) for more information about how to enable module builds.
30
48
To build and test the software, the following developer dependencies are required:
@@ -46,30 +64,21 @@ $ go test ./...
46
64
47
65
If you use `go generate` on the scanner package, then the Ragel version above is needed to correctly generate the files.
48
66
49
-
## Submitting a pull request
50
-
To submit a pull request you should fork the Flux repository and make your change
51
-
on a feature branch of your fork. Then generate a pull request from your branch
52
-
against **master** of the Flux repository. Include in your pull request details of
53
-
your change -- the **why***and* the **how** -- as well as the testing you performed.
54
-
Also, be sure to run the test suite with your change in place. Changes that cause
55
-
tests to fail cannot be merged.
67
+
### Regenerating the standard library
68
+
If you modify any `.flux` files in the repository, the standard library must be regenerated.
69
+
This is done by running `go generate` in the following way.
56
70
57
-
There will usually be some back and forth as we finalize the change, but once
58
-
that completes, it may be merged.
59
-
60
-
To assist in review for the PR, please add the following to your pull request comment:
61
-
62
-
```md
63
-
- [ ] Sign [CLA](https://www.influxdata.com/legal/cla/) (if not already signed)
71
+
```bash
72
+
$ go generate ./stdlib
64
73
```
65
74
66
-
Flux uses _conventional commit message_ formats: https://www.conventionalcommits.org/en/v1.0.0-beta.3/. Please use this commit message format for commits that will be visible in influxdata/flux history.
75
+
## Pull request guidelines
67
76
68
-
##Signing the CLA
69
-
In order to contribute back to Flux, you must sign the
The Flux codebase follows the guidelines from [Effective Go](https://golang.org/doc/effective_go.html).
79
+
Please familiarize yourself with these guidelines before submitting a pull request.
71
80
72
-
## Use of third-party packages
81
+
###Use of third-party packages
73
82
A third-party package is defined as one that is not part of the standard Go distribution.
74
83
Generally speaking, we prefer to minimize our use of third-party packages and avoid
75
84
them unless absolutely necessarily. We'll often write a little bit of code rather
@@ -78,6 +87,63 @@ use only the standard libraries, or the third-party packages we have decided to
78
87
79
88
For rationale, check out the post [The Case Against Third Party Libraries](http://blog.gopheracademy.com/advent-2014/case-against-3pl/).
80
89
90
+
### Writing unit tests
91
+
Unit tests for Go code should be in the same package as the code itself.
92
+
It should be in a file named `filename_test.go` with the package name `mypackage_test` as the name of the package.
93
+
The tests should test functionality through public functions and methods.
94
+
95
+
If access to internal members or functions is needed, then the test file should be named `filename_internal_test.go` and use the same package name as the package itself.
96
+
The tests written in this file will have access to the internals of the package.
97
+
This file can also be used to create testing-specific functions that can be exposed to the tests in `mypackage_test`.
98
+
99
+
Pull requests require tests to be written for them and must pass our code coverage checks.
100
+
101
+
### Public functions and methods
102
+
When writing code, try to avoid making functions and methods used by the code public.
103
+
When creating a library that needs to be used by multiple packages within the Flux repository, an internal package is preferred.
104
+
A public function or method should only be used if using the Flux library would require the function or method to be public.
105
+
106
+
### Comments and documentation
107
+
Every new public function or method requires a valid GoDoc.
108
+
Comments within the code should be written with proper capitalization and punctuation at the end of the sentence.
109
+
Please refer to [this blog post](https://blog.golang.org/godoc-documenting-go-code) about documenting Go code.
110
+
111
+
### Updating markdown files for documentation
112
+
The Flux team uses markdown for our documentation.
113
+
When writing markdown, please use the following guidelines:
114
+
115
+
- Each sentence in a paragraph is on its own line.
116
+
- Use the `#` symbol for header sections.
117
+
- Use the `-` symbol for bullet points.
118
+
119
+
## Submitting a pull request
120
+
To submit a pull request you should fork the Flux repository and make your change on a feature branch of your fork.
121
+
Then generate a pull request from your branch against **master** of the Flux repository.
122
+
Include in your pull request details of your change -- the **why***and* the **how** -- as well as the testing you performed.
123
+
Also, be sure to run the test suite with your change in place.
124
+
Changes that cause tests to fail cannot be merged.
125
+
The code you write must be unit tested within the same package as the code that you changed.
126
+
127
+
There will usually be some back and forth as we finalize the change, but once that completes, it may be merged.
128
+
When making changes based on the code review, please add new commits and please refrain from amending the original commit.
129
+
This helps us keep track of the changes that have been made during the course of the review.
130
+
131
+
When your change is ready to be merged, the Flux developer who is reviewing your code will approve the pull request and squash your commits into a single commit.
132
+
The first commit in your changeset will be used as the final commit message.
133
+
This first commit must follow the _conventional commit message_ format: https://www.conventionalcommits.org/en/v1.0.0-beta.3/.
134
+
Please use this commit message format for commits that will be visible in influxdata/flux history.
135
+
136
+
If your pull request only requires trivial changes before being approved and merged, the reviewer may make the change themselves and push to the branch in your fork.
137
+
This makes it easier for us to fix a small nitpick such as formatting without requiring an additional back and forth.
138
+
If the changes are non-trivial, we will always ask before changing any code.
139
+
If you do not want us to do this at all under any circumstance, then you can disable this by unselecting **Allow edits from maintainers** in the pull request itself.
140
+
141
+
To assist in review for the PR, please add the following to your pull request comment:
142
+
143
+
```md
144
+
- [ ] Sign [CLA](https://www.influxdata.com/legal/cla/) (if not already signed)
145
+
```
146
+
81
147
## Useful links
82
148
-[Useful techniques in Go](https://arslan.io/2015/10/08/ten-useful-techniques-in-go/)
83
149
-[Go in production](http://peter.bourgon.org/go-in-production/)
0 commit comments