Open an issue on the issue list.
zentity is developed in IntelliJ IDEA and uses Maven to manage dependencies, tests, and builds.
- Install Git
- Install IntelliJ IDEA
- Install
JDK 11
3.1 Zulu/OpenJDK (recommended)
3.2 Oracle - Install Docker
4.1 Docker Compose (optional)
- File > New > Project from Version Control
- Version Control: Git
- URL: https://www.github.com/zentity-io/zentity
- Directory: Your local repository directory
- Navigate to File > Project Structure
- Navigate to Project Settings > Project Settings
- Set the Project SDK to the home path of JDK 11
- Navigate to Run > Edit Configurations
- Navigate to Maven
- Create configurations with the following values for "Command line":
clean install
- Runs all tests and builds zentity locally.clean install -e -X
- Runs all tests and builds zentity locally with extra debugging details.test -DskipIntegTests=true
- Runs unit tests locally.
- Run these frequently to ensure that your tests continue to pass as you modify the code.
The project uses testcontainers to spin up a local Docker Elasticsearch cluster for testing. This requires the Docker daemon to be present and running.
Integration tests can be run via Maven or through the IDE. If running outside of Maven, you must specify the following environment variables:
ELASTICSEARCH_VERSION
- The version of Elasticsearch to test against.PLUGIN_BUILD_DIR
- The directory where the compiled plugin lives, which should be${PROJECT ROOT}/target/releases
.
Since the plugin needs to be installed on the Elasticsearch cluster for integration tests, using a debugger can be tricky but is possible. There are a few environment variables that will configure and expose a remote debugger on the Elasticsearch container that can be attached to, for example via IntelliJ.
DEBUGGER_ENABLED
- Whether to enable the debugger, default:false
.DEBUGGER_PORT
- What local port to expose the debugger on, default: a random port.DEBUGGER_SLEEP
- Duration to sleep in milliseconds for after starting the debugger, so it can be attached to before tests run, default:5000
.
A docker-compose.yml
file is also provided to spin up an Elasticsearch and Kibana instance
with the locally-built plugin installed. This is helpful for playing around with local builds before publishing changes.
Ex:
mvn clean package -DskipTests=true # build the plugin
docker-compose up # Run both Elasticsearch and Kibana
docker-compose down # Tear down Elasticsearch and Kibana
# Run [email protected] with a debugger exposed on localhost port 5050
# and [email protected]
export DEBUGGER_PORT=5050
export ELASTICSEARCH_VERSION=7.10.0
export ELASTICSEARCH_PORT=9200
export KIBANA_VERSION=7.10.0
export KIBANA_PORT=5601
docker-compose up
There is also a docker-compose.cluster.yml
that replicates a 3 node cluster with one
primary node and two data nodes. The available environment variables are identical to the single-node docker-compose file.
- pom.xml - Maven configuration file that defines project settings, dependency versions, build behavior, and high level test behavior.
- src/main/resources/plugin-descriptor.properties - File required by all Elasticsearch plugins (source).
- src/test/java - Code for unit tests and integration tests. Unit tests are suffixed with
Test
. Integration test classes are suffixed withIT
. - src/test/resources - Data, entity models, and configurations used by tests.
- Input and outputs should mimic the experience of Elasticsearch.
This will make it easier for Elasticsearch users to work with the zentity. Here are some examples:
- zentity and Elasticsearch both display results under
hits.hits
. - zentity and Elasticsearch use the
pretty
URL parameter to format JSON.
- zentity and Elasticsearch both display results under
- Line separator: LF (
\n
) - File encoding: UTF-8
- Indentation: 4 spaces
- Automatically reformat code with your IDE before committing. zentity uses the default reformatting configuration of IntelliJ IDEA.
- Break up large chunks of code into smaller chunks, and preface each code chunk with a brief comment that explains its purpose.
The .editorconfig
file configures editors for these and other code-style preferences.
- Create a branch.
- Develop your changes.
- Rebase your changes with the master branch.
- Test your changes.
- Submit a pull request. If your contribution addresses a feature or bug from the issues list, please link your pull request to the issue.
zentity is maintained by davemoore-, and the @fintechstudios Team, who can help you with anything you need regarding this project.