CONTRIBUTING.md 4.0 KB
Newer Older
1 2 3 4
## Contributing to QuestDB

### Raise an Issue

T
TheTanc 已提交
5
Raising **[issues](https://github.com/questdb/questdb/issues)** on GitHub is super welcome. We aim to respond quickly and thoughtfully. This is a good place to start before deep diving into the code base.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65

### Contribute a PR

#### Requirements

- Java 8. You can use either Oracle JDK 8 or OpenJDK 8. Newer versions of Java are not yet supported.
- Maven 3 (https://maven.apache.org/download.cgi)
- C-compiler, CMake - to contribute to C libraries.
- Java IDE
- 64-bit Operating System (OSX, Windows or Linux) - QuestDB does not work on 32-bit platforms.

### Repository overview

Repository contains three components:
- QuestDB database and libraries source in Java (core/src/main/java)
- QuestDN database tests (core/src/test/java)
- QuestDB libraries in C (core/src/main/c)
- QuestDB Windows service wrapper (win64svc/)
- QuestDB Web Console (ui/)
- Micro benchmarks (benchmarks/)

QuestDB is packaged with maven, which packages everything under (core/src/). For this reason compilation output of
other packages is distributed as follows:

core/src/main/c -> core/src/main/resources/binaries
ui -> core/src/main/resources/site/public
win64svc -> core/src/main/bin

Compiled binaries are committed to git to make builk of development process Java-centric and simplified.

## Compiling Java

Unless your default Java is Java8 you may want to set JAVA_HOME to Java8 directory before running maven:

Linux/OSX
```text
export JAVA_HOME=/path/to/java/
mvn clean package
```

Windows
```text
set JAVA_HOME="c:\path\to\java directory"
mvn clean package
```

## Compiling C-libraries

C-libraries will have to be compiled for each platform separately. The following commands will compile on Linux/OSX:

```text
export JAVA_HOME=/path/to/java
cmake
make
```

on Windows we use Intellij CLion, which can open cmake files.

## Testing

T
TheTanc 已提交
66
We have a lot of unit tests, most of which are of "integration" type, e.g. test starts a server, interacts with it and asserts the outcome. We expect all contributors to submit PRs with tests. Please reach out to us via slack if you uncertain on how to test or you think existing test is inadequate and should be removed.
67 68 69

## Dependencies

70 71
QuestDB does not have dependencies. This may sound unorthodox but in reality we try not to reinvent the wheel but rather than using libraries we
implement best algorithms ourselves to ensure perfect fit with existing code. With that in mind we expect contributions that do not add third-party dependencies.
72 73 74 75

## Allocations, "new" operator and garbage collection

QuestDB is zero-GC along data pipelines. We expect contributions not to allocate if possible. That said we would like to help you to
T
TheTanc 已提交
76 77 78 79
contribute zero-GC code, do not hesitate to reach out!

## Committing

80
We use [Conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) to auto-generate release notes. We require all commit comments to conform. To that end commits have to be granular enough to be successfully described using this method.
V
Vlad Ilyushchenko 已提交
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100

## Squashing commits

When submitting a pull request to QuestDB, we ask that you squash your commits before we merge.

Some applications that interact with git repos will provide a user interface for squashing. Refer to your application's document for more information.

If you're familiar with Terminal, you can do the following:

* Make sure your branch is up to date with the master branch.
* Run `git rebase -i master`.
* You should see a list of commits, each commit starting with the word "pick".
* Make sure the first commit says "pick" and change the rest from "pick" to "squash".
-- This will squash each commit into the previous commit, which will continue until every commit is squashed into the first commit.
* Save and close the editor.
* It will give you the opportunity to change the commit message. 
* Save and close the editor again.
* Then you have to force push the final, squashed commit: `git push --force-with-lease origin`.

Squashing commits can be a tricky process but once you figure it out, it's really helpful and keeps our repo concise and clean.