-
Notifications
You must be signed in to change notification settings - Fork 86
Release process
This page contains instructions for Pulsar committers on how to perform a release.
The steps for releasing are as follows:
- Check and Add TypeScript Types
- Create the release branch
- Update package version and tag
- Build and inspect the artifacts
- Publish the release candidate package
- Move master branch to next version
- Write release notes
- Run the vote
- Promote the release
- Update release notes
- Announce the release
In order to use added features and options in TypeScript code, we need to add their type definitions.
Check if there are any Pull Requests with the types-required
label or not.
If yes, add their type definitions.
If no, we can then proceed to next step.
We are going to create a branch from master
to branch-1.X
where the tag will be generated
and where new fixes will be applied as part of the maintenance for the release.
The branch needs only to be created when creating minor releases, and not for patch releases.
Eg: When creating v1.1.0
release, will be creating the branch branch-1.1
,
but for v1.1.1
we would keep using the old branch-1.1
.
In these instructions, I'm referring to an fictitious release 1.X.0
.
Change the release version in the examples accordingly with the real version.
It is recommended to create a fresh clone of the repository to avoid any local files to interfere in the process:
$ git clone [email protected]:apache/pulsar-client-node.git
$ cd pulsar-client-node
$ git checkout -b branch-1.X origin/master
During the release process, we are going to initially create "candidate" tags:
# Bump to the release candidate version
$ npm version prerelease --preid=rc
# Confirm that the "candidate" tag has been created
$ git tag -l
v1.X.0-rc.1
# Push both the branch and the tag to GitHub repo
$ git push origin branch-1.X
$ git push origin v1.X.0-rc.1
If you haven't done it, install the Pulsar C++ client according to the following document: https://pulsar.apache.org/docs/en/client-libraries-cpp/
Install dependent npm modules and build Pulsar Node.js client:
$ npm ci
After the build, inspect the artifacts:
- Run the following command to verify the license headers in the source files:
$ npm run license:addheader
# If there is a file that does not contain the license header,
# the header is inserted by the above command
$ git diff
- Run the standalone Pulsar service and check that the Node.js client can connect to it correctly:
# Download the Pulsar binary distribution to any directory
$ cd /path/to/anydir
$ PULSAR_BIN_VER='x.y.z'
$ curl -L -o apache-pulsar-${PULSAR_BIN_VER}-bin.tar.gz "https://www.apache.org/dyn/mirrors/mirrors.cgi?action=download&filename=pulsar/pulsar-${PULSAR_BIN_VER}/apache-pulsar-${PULSAR_BIN_VER}-bin.tar.gz"
# Run the standalone service
$ tar xvzf apache-pulsar-${PULSAR_BIN_VER}-bin.tar.gz
$ cd apache-pulsar-${PULSAR_BIN_VER}
$ bin/pulsar standalone
# Open a new terminal and subscribe my-topic
$ cd /path/to/pulsar-client-node
$ node consumer.js
###### consumer.js example ######
const Pulsar = require('./index.js');
(async () => {
const client = new Pulsar.Client({
serviceUrl: 'pulsar://localhost:6650',
});
const consumer = await client.subscribe({
topic: 'persistent://public/default/my-topic',
subscription: 'sub1',
});
for (let i = 0; i < 10; i += 1) {
const msg = await consumer.receive();
console.log(msg.getData().toString());
consumer.acknowledge(msg);
}
await consumer.close();
await client.close();
})();
#################################
# Open another new terminal to produce messages into my-topic
$ cd /path/to/pulsar-client-node
$ node producer.js
###### producer.js example ######
const Pulsar = require('./index.js');
(async () => {
const client = new Pulsar.Client({
serviceUrl: 'pulsar://localhost:6650',
});
const producer = await client.createProducer({
topic: 'persistent://public/default/my-topic',
});
for (let i = 0; i < 10; i += 1) {
const msg = `my-message-${i}`;
producer.send({
data: Buffer.from(msg),
});
console.log(`Sent message: ${msg}`);
}
await producer.flush();
await producer.close();
await client.close();
})();
#################################
Create or verify a user account in the npm registry:
$ npm adduser
Username: foobar
Password: ********
Email: (this IS public) [email protected]
Publish the package to the npm registry:
$ npm publish
If you don't have permission to publish pulsar-client
to the npm registry,
ask other committers to grant that permission.
We need to move master version to next iteration X + 1
.
$ git checkout master
$ npm version preminor --preid=rc
Since this needs to be merged in master
, we need to follow the regular process
and create a Pull Request on GitHub.
Check the milestone in GitHub associated with the release. https://github.com/apache/pulsar-client-node/milestones?closed=1
In the release item, add the list of most important changes that happened in the release and a link to the associated milestone, with the complete list of all the changes. https://github.com/apache/pulsar-client-node/releases
Send an email on the Pulsar Dev mailing list:
To: [email protected]
Subject: [VOTE] Pulsar Node.js Client Release 1.X.0 Candidate 1
This is the first release candidate for Apache Pulsar Node.js client, version 1.X.0.
It fixes the following issues:
https://github.com/apache/pulsar-client-node/milestone/1?closed=1
*** Please download, test and vote on this release. This vote will stay open
for at least 72 hours ***
Note that we are voting upon the source (tag), the npm package is provided
for convenience.
The tag to be voted upon:
v1.X.0-rc.1
https://github.com/apache/pulsar-client-node/releases/tag/v1.X.0-rc.1
The npm package:
https://www.npmjs.com/package/pulsar-client/v/1.X.0-rc.1
Please download the source files, and follow the README to build
and run the Pulsar Node.js client.
The vote should be open for at least 72 hours (3 days). Votes from Pulsar PMC members will be considered binding, while anyone else is encouraged to verify the release and vote as well.
If the release is approved here, we can then proceed to next step.
Bump to the release version and create the final git tag:
$ git checkout branch-1.X
$ npm version minor
$ git push origin branch-1.X
$ git push origin v1.X.0
Publish the package to the npm registry:
$ npm publish
Add the release notes there: https://github.com/apache/pulsar-client-node/releases
Once the release artifact is available in the npm registry, we need to announce the release.
Send an email on these lines:
To: [email protected], [email protected], [email protected]
Subject: [ANNOUNCE] Apache Pulsar Node.js client 1.X.0 released
The Apache Pulsar team is proud to announce Apache Pulsar Node.js client version 1.X.0.
Pulsar is a highly scalable, low latency messaging platform running on
commodity hardware. It provides simple pub-sub semantics over topics,
guaranteed at-least-once delivery of messages, automatic cursor management for
subscribers, and cross-datacenter replication.
For Pulsar Node.js client release details and downloads, visit:
https://www.npmjs.com/package/pulsar-client
Release Notes are at:
https://github.com/apache/pulsar-client-node/releases
We would like to thank the contributors that made the release possible.
Regards,
The Pulsar Team