3.8 KiB
Contributing to the Elasticsearch Node.js client
The Elasticsearch Node.js client is open source and we love to receive contributions from our community — you!
There are many ways to contribute, from writing tutorials or blog posts, improving the documentation, submitting bug reports and feature requests or writing code.
Repository structure
The master branch is considered unstable, and it's compatible with Elasticsearch master. Unless you are patching an issue, new features should always be sent to the master branch, in case of a bugfix, it depends if the bug affects all the release lines.
There is a branch for every supported release line, such as 7.x or 6.x. We release bugfixes as soon as possible, while minor and major releases are published at the same time of the Elastic Stack.
Usually for every release line there will be a published version and a next version. Eg: the 7.x branch contains the version published on npm, and bugfixes should be sent there, while 7.2 (assuming that 7.1.x is released) contains the next version, and new features should be sent there.
Code contributions
If you have a bugfix or new feature that you would like to contribute, please find or open an issue about it first. Talk about what you would like to do. It may be that somebody is already working on it, or that there are particular issues that you should know about before implementing the change.
Note that we strictly follow the Elastic EOL schedule.
Submitting your changes
Generally, we require that you test any code you are adding or modifying. Once your changes are ready to submit for review:
-
Test your changes
Run the test suite to make sure that nothing is broken. Usually run
npm testis enough, our CI will take care of running the integration test. If you want to run them on your own, you should spin up and Elasticsearch instance via the scripts that you can find inside thescriptsfolder, and then runnpm run test:integration.
If you want to run the integration test for the Elastic licensed APIs, you should run theplatinumscript, and then runTEST_ES_SERVER=https://elastic:changeme@localhost:9200 npm run test:integration. -
Submit a pull request
Push your local changes to your forked copy of the repository and submit a pull request. In the pull request, choose a title which sums up the changes that you have made, and in the body provide more details about what your changes do. Also mention the number of the issue where discussion has taken place, eg "Closes #123".
-
Sign the Contributor License Agreement
Please make sure you have signed our Contributor License Agreement. We are not asking you to assign copyright to us, but to give us the right to distribute your code without restriction. We ask this of all contributors in order to assure our users of the origin and continuing existence of the code. You only need to sign the CLA once.
-
Be patient
We might not be able to review your code as fast as we would like to, but we'll do our best to dedicate it the attention it deserves. Your effort is much appreciated!
Releasing
If you have access to make releases, the process is as follows:
- Update the version in
package.jsonaccording to the scale of the change. (major, minor or patch) - Commit changes with message
Bumped vx.y.zwherex.y.zis the version inpackage.json - Create a release via the GitHub UI.
- Wait for CI to finish running the test.
- Publish to npm with
npm publish(see publish and dist-tag docs)