This is the monorepo for InfluxData Platform, a.k.a. Influx 2.0 OSS.
This project requires Go 1.11 and Go module support. Set GO111MODULE=on
or build the project outside of your GOPATH
for it to succeed.
For information about modules, please refer to the wiki.
We recently announced Flux, the MIT-licensed data scripting language (and rename for IFQL). The source for Flux is in this repository under query
. Learn more about Flux from CTO Paul Dix's presentation.
All pull requests will run through CI, which is currently hosted by Circle. Community contributors should be able to see the outcome of this process by looking at the checks on their PR. Please fix any issues to ensure a prompt review from members of the team.
The Platform project is used internally in a number of proprietary InfluxData products, and as such, PRs and changes need to be tested internally. This can take some time, and is not really visible to community contributors.
This project uses the following static analysis tools. Failure during the running of any of these tools results in a failed build. Generally, code must be adjusted to satisfy these tools, though there are exceptions.
- go vet checks for Go code that should be considered incorrect.
- go fmt checks that Go code is correctly formatted.
- go mod tidy ensures that the source code and go.mod agree.
- staticcheck checks for things like: unused code, code that can be simplified, code that is incorrect and code that will have performance issues.
If your PR fails staticcheck
it is easy to dig into why it failed, and also to fix the problem.
First, take a look at the error message in Circle under the staticcheck
build section, e.g.,
tsdb/tsm1/encoding.gen.go:1445:24: func BooleanValues.assertOrdered is unused (U1000)
tsdb/tsm1/encoding.go:172:7: receiver name should not be an underscore, omit the name if it is unused (ST1006)
Next, go and take a look here for some clarification on the error code that you have received, e.g., U1000
.
The docs will tell you what's wrong, and often what you need to do to fix the issue.
Sometimes generated code will contain unused code or occasionally that will fail a different check.
staticcheck
allows for entire files to be ignored, though it's not ideal.
A linter directive, in the form of a comment, must be placed within the generated file.
This is problematic because it will be erased if the file is re-generated.
Until a better solution comes about, below is the list of generated files that need an ignores comment.
If you re-generate a file and find that staticcheck
has failed, please see this list below for what you need to put back:
File | Comment |
---|---|
query/promql/promql.go | //lint:file-ignore SA6001 Ignore all unused code, it's generated |