Skip to content

How to make a release

Sylvain Wallez edited this page Nov 12, 2020 · 2 revisions

How to make a release

This document describes the process of releasing a new version of the client.

Branches and versions

The client tracks the supported major versions of the stack in the following branches:

  • master
  • 7.x
  • 6.x

During a feature-freeze phase, a new branch is created from the corresponding version branch. As an example, to prepare for a 7.10.0 release of the stack, a 7.10 branch is created from the 7.x branch and pushed to Github.

Generating the Go API

The Go API is generated from the Rest API specification. The important thing is to generate from the correct version of the specification.

Clone the https://github.com/elastic/elasticsearch repository locally in ./tmp/elasticsearch, so you can check out a specific revision of the code.

By default a snapshot of the current branch will be used. If needed, choose the specific version you want to generate APIs for by setting the version environment variable, e.g. export version="elasticsearch:7.10.0"

Launch the cluster with the following command:

$ make cluster-clean cluster-update cluster

Fetch the build hash from the cluster:

# For Elasticsearch
$ curl -ks -u elastic:elastic https://localhost:9200 | jq -r '.version.build_hash'
# For Elasticsearch-oss
$ curl -s http://localhost:9200 | jq -r '.version.build_hash'

# => 152ee3aca4d6f47637ff9062f6a064349026ed8c

Navigate to the cloned Elasticsearch repository, and checkout the Git commit corresponding to the build hash:

cd tmp/elasticsearch
git pull
git checkout 152ee3aca4d6f47637ff9062f6a064349026ed8c

Navigate back to the client repository and run the code generation:

make gen-api

Create the release

Inspect the changes in the repository and commit them:

git status --short --branch
git add esapi/
git commit --verbose --message='API: Update the APIs for Elasticsearch 8.x (152ee3ac)'

Push the changes to Github:

git push

In order to create a new release, you have to update the version in the internal/version/version.go file. Use the Make command for that:

make release version=7.10.0

The command will print the instructions for pushing the resulting tags to Github.

Finally, open the release page in your browser, and update the description with relevant changes for this version.

Clone this wiki locally