Skip to content

Commit

Permalink
Merge branch 'release-1.2' into node/tjz-example
Browse files Browse the repository at this point in the history
  • Loading branch information
cyip10 authored Nov 27, 2024
2 parents ab2d840 + 7bd4dcd commit e7a974e
Show file tree
Hide file tree
Showing 13 changed files with 530 additions and 79 deletions.
4 changes: 2 additions & 2 deletions .github/json_matrices/build-matrix.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"ARCH": "arm64",
"TARGET": "aarch64-unknown-linux-musl",
"RUNNER": ["self-hosted", "Linux", "ARM64"],
"IMAGE": "node:lts-alpine3.19",
"IMAGE": "node:lts-alpine",
"CONTAINER_OPTIONS": "--user root --privileged --rm",
"PACKAGE_MANAGERS": ["npm"],
"languages": ["node"]
Expand All @@ -44,7 +44,7 @@
"ARCH": "x64",
"TARGET": "x86_64-unknown-linux-musl",
"RUNNER": "ubuntu-latest",
"IMAGE": "node:lts-alpine3.19",
"IMAGE": "node:lts-alpine",
"CONTAINER_OPTIONS": "--user root --privileged",
"PACKAGE_MANAGERS": ["npm"],
"languages": ["node"]
Expand Down
76 changes: 63 additions & 13 deletions .github/workflows/npm-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -181,18 +181,22 @@ jobs:
working-directory: ./node
run: |
npm pkg fix
set +e
# 2>&1 1>&3- redirects stderr to stdout and then redirects the original stdout to another file descriptor,
# effectively separating stderr and stdout. The 3>&1 at the end redirects the original stdout back to the console.
# https://github.com/npm/npm/issues/118#issuecomment-325440 - ignoring notice messages since currentlly they are directed to stderr
{ npm_publish_err=$(npm publish --tag ${{ env.NPM_TAG }} --access public 2>&1 1>&3- | grep -Ev "notice|ExperimentalWarning") ;} 3>&1
if [[ "$npm_publish_err" == *"You cannot publish over the previously published versions"* ]]
then
echo "Skipping publishing, package already published"
elif [[ ! -z "$npm_publish_err" ]]
then
echo "Failed to publish with error: ${npm_publish_err}"
exit 1
set +e # Disable immediate exit on non-zero exit codes
# Redirect stderr to stdout, filter out notices and warnings
{ npm_publish_err=$(npm publish --tag "${NPM_TAG}" --access public --loglevel=error 2>&1 1>&3- | grep -Ev "notice|ExperimentalWarning|WARN") ;} 3>&1
publish_exit_code=$?
# Re-enable immediate exit
set -e
if [[ $publish_exit_code -eq 0 ]]; then
echo "Package published successfully."
elif echo "$npm_publish_err" | grep -q "You cannot publish over the previously published versions"; then
echo "Skipping publishing, package already published."
elif [[ ! -z "$npm_publish_err" ]]; then
echo "Failed to publish with error: $npm_publish_err"
exit 1
fi
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
Expand Down Expand Up @@ -375,10 +379,56 @@ jobs:
npm install --no-save @valkey/valkey-glide@${{ env.NPM_TAG }}
npm run test
- name: Deprecating packages on failure
if: ${{ failure() }}
shell: bash
env:
GH_EVENT_NAME: ${{ github.event_name }}
GH_EVENT_INPUT_VERSION: ${{ github.event.inputs.version }}
GH_REF: ${{ github.ref }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
PLATFORM_MATRIX: ${{ needs.load-platform-matrix.outputs.PLATFORM_MATRIX }}
run: |
# Detect OS and install jq
if [[ "${OSTYPE}" == "darwin"* ]]; then
brew install jq || true
elif command -v apk > /dev/null; then
apk add --no-cache jq
else
sudo apt-get update && sudo apt-get install -y jq
fi
# Set RELEASE_VERSION correctly using environment variables
if [[ "${GH_EVENT_NAME}" == "workflow_dispatch" ]]; then
RELEASE_VERSION="${GH_EVENT_INPUT_VERSION}"
else
RELEASE_VERSION="${GH_REF#refs/tags/v}"
fi
# Validate RELEASE_VERSION
if [[ ! "${RELEASE_VERSION}" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-rc[0-9]+)?$ ]]; then
echo "Invalid release version format: ${RELEASE_VERSION}"
exit 1
fi
echo "Release version for Deprecating: ${RELEASE_VERSION}"
# Deprecating base package
npm deprecate "@valkey/valkey-glide@${RELEASE_VERSION}" "This version has been deprecated" --force || true
# Process platform matrix
echo "${PLATFORM_MATRIX}" > platform_matrix.json
while read -r pkg; do
package_name="@valkey/valkey-glide-${pkg}"
echo "Deprecating ${package_name}@${RELEASE_VERSION}"
npm deprecate "${package_name}@${RELEASE_VERSION}" "This version has been deprecated" --force || true
done < <(jq -r '.[] | "\(.NAMED_OS)\(.TARGET | test("musl") | if . then "-musl" else "" end)-\(.ARCH)"' platform_matrix.json)
# Reset the repository to make sure we get the clean checkout of the action later in other actions.
# It is not required since in other actions we are cleaning before the action, but it is a good practice to do it here as well.
- name: Reset repository
if: ${{ contains(matrix.build.RUNNER, 'self-hosted') }}
if: ${{ always() }} && ${{ contains(matrix.build.RUNNER, 'self-hosted') }}
shell: bash
run: |
git reset --hard
Expand Down
42 changes: 21 additions & 21 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,26 @@
* Python: Client API for retrieving internal statistics ([#2707](https://github.com/valkey-io/valkey-glide/pull/2707))
* Node, Python, Java: Adding support for replacing connection configured password ([#2651](https://github.com/valkey-io/valkey-glide/pull/2651), [#2659](https://github.com/valkey-io/valkey-glide/pull/2659), [#2677](https://github.com/valkey-io/valkey-glide/pull/2677))
* Node, Python, Java: AZ Affinity - Python Wrapper Support ([#2686](https://github.com/valkey-io/valkey-glide/pull/2686), [#2676](https://github.com/valkey-io/valkey-glide/pull/2676), [#2678](https://github.com/valkey-io/valkey-glide/pull/2678))
* Node: Add FT._ALIASLIST command([#2652](https://github.com/valkey-io/valkey-glide/pull/2652))
* Python: Python: `FT._ALIASLIST` command added([#2638](https://github.com/valkey-io/valkey-glide/pull/2638))
* Node: alias commands added: FT.ALIASADD, FT.ALIADDEL, FT.ALIASUPDATE([#2596](https://github.com/valkey-io/valkey-glide/pull/2596))
* Node: Add `FT._ALIASLIST` command ([#2652](https://github.com/valkey-io/valkey-glide/pull/2652))
* Python: Add `FT._ALIASLIST` command ([#2638](https://github.com/valkey-io/valkey-glide/pull/2638))
* Node: Add `FT.ALIASADD`, `FT.ALIADDEL`, `FT.ALIASUPDATE` ([#2596](https://github.com/valkey-io/valkey-glide/pull/2596))
* Python code cleanup ([#2573](https://github.com/valkey-io/valkey-glide/pull/2573))
* Python: Python: FT.PROFILE command added ([#2543](https://github.com/valkey-io/valkey-glide/pull/2543))
* Python: Python: FT.AGGREGATE command added([#2530](https://github.com/valkey-io/valkey-glide/pull/2530))
* Python: Add JSON.OBJLEN command ([#2495](https://github.com/valkey-io/valkey-glide/pull/2495))
* Python: FT.EXPLAIN and FT.EXPLAINCLI commands added([#2508](https://github.com/valkey-io/valkey-glide/pull/2508))
* Python: Python FT.INFO command added([#2429](https://github.com/valkey-io/valkey-glide/pull/2494))
* Python: Add FT.SEARCH command([#2470](https://github.com/valkey-io/valkey-glide/pull/2470))
* Python: Add commands FT.ALIASADD, FT.ALIASDEL, FT.ALIASUPDATE([#2471](https://github.com/valkey-io/valkey-glide/pull/2471))
* Python: Python FT.DROPINDEX command ([#2437](https://github.com/valkey-io/valkey-glide/pull/2437))
* Python: Python: Added FT.CREATE command([#2413](https://github.com/valkey-io/valkey-glide/pull/2413))
* Python: Add JSON.MGET command ([#2507](https://github.com/valkey-io/valkey-glide/pull/2507))
* Python: Add JSON.ARRLEN command ([#2403](https://github.com/valkey-io/valkey-glide/pull/2403))
* Python: Add JSON.CLEAR command ([#2418](https://github.com/valkey-io/valkey-glide/pull/2418))
* Python: Add JSON.TYPE command ([#2409](https://github.com/valkey-io/valkey-glide/pull/2409))
* Python: Add JSON.NUMINCRBY command ([#2448](https://github.com/valkey-io/valkey-glide/pull/2448))
* Python: Add JSON.NUMMULTBY command ([#2458](https://github.com/valkey-io/valkey-glide/pull/2458))
* Python: Add JSON.ARRINDEX command ([#2528](https://github.com/valkey-io/valkey-glide/pull/2528))
* Python: Add `FT.PROFILE` command ([#2543](https://github.com/valkey-io/valkey-glide/pull/2543))
* Python: Add `FT.AGGREGATE` command ([#2530](https://github.com/valkey-io/valkey-glide/pull/2530))
* Python: Add `JSON.OBJLEN` command ([#2495](https://github.com/valkey-io/valkey-glide/pull/2495))
* Python: Add `FT.EXPLAIN` and `FT.EXPLAINCLI` commands ([#2508](https://github.com/valkey-io/valkey-glide/pull/2508))
* Python: Add `FT.INFO` command ([#2429](https://github.com/valkey-io/valkey-glide/pull/2494))
* Python: Add `FT.SEARCH` command ([#2470](https://github.com/valkey-io/valkey-glide/pull/2470))
* Python: Add commands `FT.ALIASADD`, `FT.ALIASDEL`, `FT.ALIASUPDATE` ([#2471](https://github.com/valkey-io/valkey-glide/pull/2471))
* Python: Add `FT.DROPINDEX` command ([#2437](https://github.com/valkey-io/valkey-glide/pull/2437))
* Python: Add `FT.CREATE` command ([#2413](https://github.com/valkey-io/valkey-glide/pull/2413))
* Python: Add `JSON.MGET` command ([#2507](https://github.com/valkey-io/valkey-glide/pull/2507))
* Python: Add `JSON.ARRLEN` command ([#2403](https://github.com/valkey-io/valkey-glide/pull/2403))
* Python: Add `JSON.CLEAR` command ([#2418](https://github.com/valkey-io/valkey-glide/pull/2418))
* Python: Add `JSON.TYPE` command ([#2409](https://github.com/valkey-io/valkey-glide/pull/2409))
* Python: Add `JSON.NUMINCRBY` command ([#2448](https://github.com/valkey-io/valkey-glide/pull/2448))
* Python: Add `JSON.NUMMULTBY` command ([#2458](https://github.com/valkey-io/valkey-glide/pull/2458))
* Python: Add `JSON.ARRINDEX` command ([#2528](https://github.com/valkey-io/valkey-glide/pull/2528))
* Python: Add `FT._LIST` command ([#2571](https://github.com/valkey-io/valkey-glide/pull/2571))
* Python: Add `JSON.DEBUG_MEMORY` and `JSON.DEBUG_FIELDS` commands ([#2481](https://github.com/valkey-io/valkey-glide/pull/2481))
* Java: Added `FT.CREATE` ([#2414](https://github.com/valkey-io/valkey-glide/pull/2414))
Expand Down Expand Up @@ -72,7 +72,7 @@
* Python: Add `JSON.STRAPPEND`, `JSON.STRLEN` commands ([#2372](https://github.com/valkey-io/valkey-glide/pull/2372))
* Node: Added `JSON.ARRINDEX` ([#2559](https://github.com/valkey-io/valkey-glide/pull/2559))
* Node: Added `JSON.OBJLEN` and `JSON.OBJKEYS` ([#2563](https://github.com/valkey-io/valkey-glide/pull/2563))
* Python: Add `JSON.STRAPPEND` , `JSON.STRLEN` commands ([#2372](https://github.com/valkey-io/valkey-glide/pull/2372))
* Python: Add `JSON.STRAPPEND`, `JSON.STRLEN` commands ([#2372](https://github.com/valkey-io/valkey-glide/pull/2372))
* Python: Add `JSON.OBJKEYS` command ([#2395](https://github.com/valkey-io/valkey-glide/pull/2395))
* Python: Add `JSON.ARRINSERT` command ([#2464](https://github.com/valkey-io/valkey-glide/pull/2464))
* Python: Add `JSON.ARRTRIM` command ([#2457](https://github.com/valkey-io/valkey-glide/pull/2457))
Expand All @@ -89,7 +89,7 @@
* Core: Fix list of readonly commands ([#2634](https://github.com/valkey-io/valkey-glide/pull/2634), [#2649](https://github.com/valkey-io/valkey-glide/pull/2649))
* Core: Improve retry logic and update unmaintained dependencies for Rust lint CI ([#2673](https://github.com/valkey-io/valkey-glide/pull/2643))
* Core: Release the read lock while creating connections in `refresh_connections` ([#2630](https://github.com/valkey-io/valkey-glide/issues/2630))
* Core: SlotMap refactor - Added NodesMap, Update the slot map upon MOVED errors ([#2682](https://github.com/valkey-io/valkey-glide/issues/2682))
* Core: SlotMap refactor - Added NodesMap, Update the slot map upon MOVED errors ([#2682](https://github.com/valkey-io/valkey-glide/issues/2682))

#### Breaking Changes

Expand Down
17 changes: 0 additions & 17 deletions java/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ Additionally, consider installing the Gradle plugin, [OS Detector](https://githu
There are 4 types of classifiers for Valkey GLIDE which are
```
osx-aarch_64
osx-x86_64
linux-aarch_64
linux-x86_64
```
Expand All @@ -71,11 +70,6 @@ dependencies {
implementation group: 'io.valkey', name: 'valkey-glide', version: '1.+', classifier: 'osx-aarch_64'
}
// osx-x86_64
dependencies {
implementation group: 'io.valkey', name: 'valkey-glide', version: '1.+', classifier: 'osx-x86_64'
}
// linux-aarch_64
dependencies {
implementation group: 'io.valkey', name: 'valkey-glide', version: '1.+', classifier: 'linux-aarch_64'
Expand Down Expand Up @@ -107,14 +101,6 @@ Maven:
<version>[1.0.0,2.0.0)</version>
</dependency>

<!--osx-x86_64-->
<dependency>
<groupId>io.valkey</groupId>
<artifactId>valkey-glide</artifactId>
<classifier>osx-x86_64</classifier>
<version>[1.0.0,2.0.0)</version>
</dependency>

<!--linux-aarch_64-->
<dependency>
<groupId>io.valkey</groupId>
Expand All @@ -138,9 +124,6 @@ SBT:
// osx-aarch_64
libraryDependencies += "io.valkey" % "valkey-glide" % "1.+" classifier "osx-aarch_64"

// osx-x86_64
libraryDependencies += "io.valkey" % "valkey-glide" % "1.+" classifier "osx-x86_64"

// linux-aarch_64
libraryDependencies += "io.valkey" % "valkey-glide" % "1.+" classifier "linux-aarch_64"

Expand Down
1 change: 0 additions & 1 deletion java/client/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ dependencies {
// At the moment, Windows is not supported
implementation group: 'io.netty', name: 'netty-transport-native-epoll', version: '4.1.100.Final', classifier: 'linux-x86_64'
implementation group: 'io.netty', name: 'netty-transport-native-epoll', version: '4.1.100.Final', classifier: 'linux-aarch_64'
implementation group: 'io.netty', name: 'netty-transport-native-kqueue', version: '4.1.100.Final', classifier: 'osx-x86_64'
implementation group: 'io.netty', name: 'netty-transport-native-kqueue', version: '4.1.100.Final', classifier: 'osx-aarch_64'

// junit
Expand Down
2 changes: 1 addition & 1 deletion java/integTest/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ dependencies {
// https://github.com/netty/netty/wiki/Native-transports
// At the moment, Windows is not supported
implementation group: 'io.netty', name: 'netty-transport-native-epoll', version: '4.1.100.Final', classifier: 'linux-x86_64'
implementation group: 'io.netty', name: 'netty-transport-native-kqueue', version: '4.1.100.Final', classifier: 'osx-x86_64'
implementation group: 'io.netty', name: 'netty-transport-native-epoll', version: '4.1.100.Final', classifier: 'linux-aarch_64'
implementation group: 'io.netty', name: 'netty-transport-native-kqueue', version: '4.1.100.Final', classifier: 'osx-aarch_64'

// junit
Expand Down
23 changes: 16 additions & 7 deletions node/DEVELOPER.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,28 +126,37 @@ To run tests, use the following command:
npm test
```
To execute a specific test, include the [`testNamePattern`](https://jestjs.io/docs/cli#--testnamepatternregex) option. For example:
Simplified test suite skips few time consuming tests and runs faster:
```bash
npm run test -- --testNamePattern="transaction"
npm test-minimum
```
To execute a specific test, use the [`testNamePattern`](https://jestjs.io/docs/cli#--testnamepatternregex) option with `test-dbg` script. For example:
```bash
npm run test-dbg -- --testNamePattern="transaction"
```
IT suite starts the server for testing - standalone and cluster installation using `cluster_manager` script.
To run the integration tests with existing servers, run the following command:
```bash
npm run test -- --cluster-endpoints=localhost:7000 --standalone-endpoints=localhost:6379
npm run test-dbg -- --cluster-endpoints=localhost:7000 --standalone-endpoints=localhost:6379
# If those endpoints use TLS, add `--tls=true` (applies to both endpoints)
npm run test -- --cluster-endpoints=localhost:7000 --standalone-endpoints=localhost:6379 --tls=true
npm run test-dbg -- --cluster-endpoints=localhost:7000 --standalone-endpoints=localhost:6379 --tls=true
```
By default, the server_modules tests do not run using `npm run test`. After pointing to a server with JSON and VSS modules setup,
run the following command:
Parameters `cluster-endpoints`, `standalone-endpoints` and `tls` could be used with all test suites.
By default, the server modules tests do not run using `npm run test`. This test suite also does not start the server.
In order to run these tests, use:
```bash
npm run test-modules
npm run test-modules -- --cluster-endpoints=<address>:<port>
```
Note: these tests don't run with standalone server as of now.

### REPL (interactive shell)

Expand Down
4 changes: 2 additions & 2 deletions node/npm/glide/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"clean": "rm -rf build-ts/",
"copy-declaration-files": "cp ../../build-ts/*.d.ts build-ts/ && cp ../../build-ts/src/*.d.ts build-ts/src/",
"build": "tsc && mkdir -p build-ts/src && npm run copy-declaration-files"
"copy-declaration-files": "cp ../../build-ts/*.d.ts build-ts/ && cp ../../build-ts/src/*.d.ts build-ts/src/ && cp ../../build-ts/src/server-modules/*.d.ts build-ts/src/server-modules/",
"build": "tsc && mkdir -p build-ts/src && mkdir -p build-ts/src/server-modules && npm run copy-declaration-files"
},
"files": [
"/build-ts"
Expand Down
9 changes: 5 additions & 4 deletions node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@
"clean": "rm -rf build-ts rust-client/target docs glide-logs rust-client/glide-rs.*.node rust-client/index.* src/ProtobufMessage.*",
"fix-protobuf-file": "replace 'this\\.encode\\(message, writer\\)\\.ldelim' 'this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim' src/ProtobufMessage.js",
"test": "npm run build-test-utils && jest --verbose --testPathIgnorePatterns='ServerModules'",
"test-minimum": "npm run build-test-utils && jest --verbose --runInBand --testNamePattern='^(.(?!(GlideJson|GlideFt|pubsub|kill)))*$'",
"test-modules": "npm run build-test-utils && jest --verbose --runInBand --testNamePattern='(GlideJson|GlideFt)'",
"test-dbg": "npm run build-test-utils && jest --runInBand",
"test-minimum": "npm run build-test-utils && jest --verbose --testNamePattern='^(.(?!(GlideJson|GlideFt|pubsub|kill)))*$'",
"test-modules": "npm run build-test-utils && jest --verbose --testNamePattern='(GlideJson|GlideFt)'",
"build-test-utils": "cd ../utils && npm i && npm run build",
"lint:fix": "npm run install-linting && npx eslint -c ../eslint.config.mjs --fix && npm run prettier:format",
"lint": "npm run install-linting && npx eslint -c ../eslint.config.mjs && npm run prettier:check:ci",
Expand All @@ -60,8 +61,8 @@
"semver": "^7.6.3",
"ts-jest": "^29.2.5",
"ts-node": "^10.9.2",
"typescript": "^5.5.4",
"uuid": "^11.0"
"typescript": "^5.6.3",
"uuid": "^11.0.3"
},
"author": "Valkey GLIDE Maintainers",
"license": "Apache-2.0",
Expand Down
Loading

0 comments on commit e7a974e

Please sign in to comment.