Skip to content

Commit

Permalink
Refactor CI configuration for consistency and clarity
Browse files Browse the repository at this point in the history
Signed-off-by: avifenesh <[email protected]>
  • Loading branch information
avifenesh committed Nov 4, 2024
1 parent b34f739 commit 7ae99a6
Show file tree
Hide file tree
Showing 12 changed files with 55 additions and 222 deletions.
92 changes: 15 additions & 77 deletions .github/json_matrices/build-matrix.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,100 +5,48 @@
"RUNNER": "ubuntu-latest",
"ARCH": "x64",
"TARGET": "x86_64-unknown-linux-gnu",
"PACKAGE_MANAGERS": [
"pypi",
"npm",
"maven"
],
"PACKAGE_MANAGERS": ["pypi", "npm", "maven"],
"run": "always",
"languages": [
"python",
"node",
"java",
"go",
"dotnet"
]
"languages": ["python", "node", "java", "go", "dotnet"]
},
{
"OS": "ubuntu",
"NAMED_OS": "linux",
"RUNNER": [
"self-hosted",
"Linux",
"ARM64"
],
"RUNNER": ["self-hosted", "Linux", "ARM64"],
"ARCH": "arm64",
"TARGET": "aarch64-unknown-linux-gnu",
"PACKAGE_MANAGERS": [
"pypi",
"npm",
"maven"
],
"PACKAGE_MANAGERS": ["pypi", "npm", "maven"],
"CONTAINER": "2_28",
"languages": [
"python",
"node",
"java",
"go",
"dotnet"
]
"languages": ["python", "node", "java", "go", "dotnet"]
},
{
"OS": "macos",
"NAMED_OS": "darwin",
"RUNNER": "macos-12",
"ARCH": "x64",
"TARGET": "x86_64-apple-darwin",
"PACKAGE_MANAGERS": [
"pypi",
"npm",
"maven"
],
"languages": [
"python",
"node",
"java",
"go",
"dotnet"
]
"PACKAGE_MANAGERS": ["pypi", "npm", "maven"],
"languages": ["python", "node", "java", "go", "dotnet"]
},
{
"OS": "macos",
"NAMED_OS": "darwin",
"RUNNER": "macos-latest",
"ARCH": "arm64",
"TARGET": "aarch64-apple-darwin",
"PACKAGE_MANAGERS": [
"pypi",
"npm",
"maven"
],
"languages": [
"python",
"node",
"java",
"go",
"dotnet"
]
"PACKAGE_MANAGERS": ["pypi", "npm", "maven"],
"languages": ["python", "node", "java", "go", "dotnet"]
},
{
"OS": "ubuntu",
"NAMED_OS": "linux",
"ARCH": "arm64",
"TARGET": "aarch64-unknown-linux-musl",
"RUNNER": [
"self-hosted",
"Linux",
"ARM64"
],
"RUNNER": ["self-hosted", "Linux", "ARM64"],
"IMAGE": "node:lts-alpine3.19",
"CONTAINER_OPTIONS": "--user root --privileged --rm",
"PACKAGE_MANAGERS": [
"npm"
],
"languages": [
"node"
]
"PACKAGE_MANAGERS": ["npm"],
"languages": ["node"]
},
{
"OS": "ubuntu",
Expand All @@ -108,12 +56,8 @@
"RUNNER": "ubuntu-latest",
"IMAGE": "node:lts-alpine3.19",
"CONTAINER_OPTIONS": "--user root --privileged",
"PACKAGE_MANAGERS": [
"npm"
],
"languages": [
"node"
]
"PACKAGE_MANAGERS": ["npm"],
"languages": ["node"]
},
{
"OS": "amazon-linux",
Expand All @@ -123,12 +67,6 @@
"TARGET": "x86_64-unknown-linux-gnu",
"IMAGE": "amazonlinux:latest",
"PACKAGE_MANAGERS": [],
"languages": [
"python",
"node",
"java",
"go",
"dotnet"
]
"languages": ["python", "node", "java", "go", "dotnet"]
}
]
2 changes: 1 addition & 1 deletion .github/json_matrices/supported-languages-versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
{
"language": "go",
"versions": ["1.22.0", "1.18.10"],
"always-run-versions": ["1.22.0"]
"always-run-versions": ["1.22.0", "1.18.10"]
}
]
3 changes: 0 additions & 3 deletions .github/workflows/java-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,6 @@ jobs:
echo "No cleaning needed"
fi
- uses: actions/checkout@v4


- name: Set up JDK
uses: actions/setup-java@v4
with:
Expand Down Expand Up @@ -229,7 +227,6 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4


- name: Set up JDK
uses: actions/setup-java@v4
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ jobs:

steps:
- uses: actions/checkout@v4


- uses: gradle/actions/wrapper-validation@v3

Expand Down Expand Up @@ -207,7 +206,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4


- uses: ./.github/workflows/lint-rust
with:
Expand All @@ -226,7 +224,6 @@ jobs:
run: sudo chown -R $USER:$USER /home/ubuntu/actions-runner/_work/valkey-glide

- uses: actions/checkout@v4


- name: Set up JDK
uses: actions/setup-java@v4
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/lint-rust/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ runs:
using: "composite"
steps:
- uses: actions/checkout@v4


- name: Install Rust toolchain and protoc
uses: ./.github/workflows/install-rust-and-protoc
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/redis-rs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,11 @@ jobs:
engine-version: "7.2.5"
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Cache dependencies
- name: Cache dependencies
uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
workspaces: ./glide-core/redis-rs/redis

cache-on-failure: true
workspaces: ./glide-core/redis-rs/redis

- name: Build project
run: cargo build --release
Expand Down
1 change: 1 addition & 0 deletions glide-core/redis-rs/scripts/get_command_info.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# type: ignore
import argparse
import json
import os
Expand Down
6 changes: 3 additions & 3 deletions node/tests/TestUtilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1349,6 +1349,9 @@ export async function transactionTest(
baseTransaction.xgroupDestroy(key9, groupName2);
responseData.push(["xgroupDestroy(key9, groupName2)", true]);

baseTransaction.wait(1, 200);
responseData.push(["wait(1, 200)", 1]);

baseTransaction.rename(key9, key10);
responseData.push(["rename(key9, key10)", "OK"]);
baseTransaction.exists([key10]);
Expand Down Expand Up @@ -1713,9 +1716,6 @@ export async function transactionTest(
responseData.push(["sortReadOnly(key21)", ["1", "2", "3"]]);
}

baseTransaction.wait(1, 200);
if (gte(version, "7.0.0")) responseData.push(["wait(1, 200)", 1]);
else responseData.push(["wait(1, 200)", 0]);
return responseData;
}

Expand Down
2 changes: 1 addition & 1 deletion python/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pyo3 = { version = "^0.22", features = [
"num-bigint",
"gil-refs",
] }
bytes = { version = "1.6.0" }
bytes = { version = "^1.8" }
redis = { path = "../glide-core/redis-rs/redis", features = [
"aio",
"tokio-comp",
Expand Down
108 changes: 0 additions & 108 deletions python/python/glide/async_commands/server_modules/json.py
Original file line number Diff line number Diff line change
Expand Up @@ -704,114 +704,6 @@ async def debug_memory(
)


async def arrlen(
client: TGlideClient,
key: TEncodable,
path: Optional[TEncodable] = None,
) -> Optional[TJsonResponse[int]]:
"""
Retrieves the length of the array at the specified `path` within the JSON document stored at `key`.
Args:
client (TGlideClient): The client to execute the command.
key (TEncodable): The key of the JSON document.
path (Optional[TEncodable]): The path within the JSON document. Defaults to None.
Returns:
Optional[TJsonResponse[int]]:
For JSONPath (`path` starts with `$`):
Returns a list of integer replies for every possible path, indicating the length of the array,
or None for JSON values matching the path that are not an array.
If `path` doesn't exist, an empty array will be returned.
For legacy path (`path` doesn't starts with `$`):
Returns the length of the array at `path`.
If multiple paths match, the length of the first array match is returned.
If the JSON value at `path` is not a array or if `path` doesn't exist, an error is raised.
If `key` doesn't exist, None is returned.
Examples:
>>> from glide import json
>>> await json.set(client, "doc", "$", '{"a": [1, 2, 3], "b": {"a": [1, 2], "c": {"a": 42}}}')
b'OK' # JSON is successfully set for doc
>>> await json.arrlen(client, "doc", "$")
[None] # No array at the root path.
>>> await json.arrlen(client, "doc", "$.a")
[3] # Retrieves the length of the array at path $.a.
>>> await json.arrlen(client, "doc", "$..a")
[3, 2, None] # Retrieves lengths of arrays found at all levels of the path `..a`.
>>> await json.arrlen(client, "doc", "..a")
3 # Legacy path retrieves the first array match at path `..a`.
>>> await json.arrlen(client, "non_existing_key", "$.a")
None # Returns None because the key does not exist.
>>> await json.set(client, "doc", "$", '[1, 2, 3, 4]')
b'OK' # JSON is successfully set for doc
>>> await json.arrlen(client, "doc")
4 # Retrieves lengths of arrays in root.
"""
args = ["JSON.ARRLEN", key]
if path:
args.append(path)
return cast(
Optional[TJsonResponse[int]],
await client.custom_command(args),
)


async def arrlen(
client: TGlideClient,
key: TEncodable,
path: Optional[TEncodable] = None,
) -> Optional[TJsonResponse[int]]:
"""
Retrieves the length of the array at the specified `path` within the JSON document stored at `key`.
Args:
client (TGlideClient): The client to execute the command.
key (TEncodable): The key of the JSON document.
path (Optional[TEncodable]): The path within the JSON document. Defaults to None.
Returns:
Optional[TJsonResponse[int]]:
For JSONPath (`path` starts with `$`):
Returns a list of integer replies for every possible path, indicating the length of the array,
or None for JSON values matching the path that are not an array.
If `path` doesn't exist, an empty array will be returned.
For legacy path (`path` doesn't starts with `$`):
Returns the length of the array at `path`.
If multiple paths match, the length of the first array match is returned.
If the JSON value at `path` is not a array or if `path` doesn't exist, an error is raised.
If `key` doesn't exist, None is returned.
Examples:
>>> from glide import json
>>> await json.set(client, "doc", "$", '{"a": [1, 2, 3], "b": {"a": [1, 2], "c": {"a": 42}}}')
b'OK' # JSON is successfully set for doc
>>> await json.arrlen(client, "doc", "$")
[None] # No array at the root path.
>>> await json.arrlen(client, "doc", "$.a")
[3] # Retrieves the length of the array at path $.a.
>>> await json.arrlen(client, "doc", "$..a")
[3, 2, None] # Retrieves lengths of arrays found at all levels of the path `..a`.
>>> await json.arrlen(client, "doc", "..a")
3 # Legacy path retrieves the first array match at path `..a`.
>>> await json.arrlen(client, "non_existing_key", "$.a")
None # Returns None because the key does not exist.
>>> await json.set(client, "doc", "$", '[1, 2, 3, 4]')
b'OK' # JSON is successfully set for doc
>>> await json.arrlen(client, "doc")
4 # Retrieves lengths of arrays in root.
"""
args = ["JSON.ARRLEN", key]
if path:
args.append(path)
return cast(
Optional[TJsonResponse[int]],
await client.custom_command(args),
)


async def delete(
client: TGlideClient,
key: TEncodable,
Expand Down
4 changes: 2 additions & 2 deletions python/python/tests/test_pubsub.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
GlideClusterClientConfiguration,
ProtocolVersion,
)
from glide.constants import OK, TEncodable
from glide.constants import OK
from glide.exceptions import ConfigurationError
from glide.glide_client import BaseClient, GlideClient, GlideClusterClient, TGlideClient
from glide.glide_client import GlideClient, GlideClusterClient, TGlideClient
from tests.conftest import create_client
from tests.utils.utils import check_if_server_version_lt, get_random_string

Expand Down
Loading

0 comments on commit 7ae99a6

Please sign in to comment.