Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add redis compatible version field [MOD-6995] #103

Merged
merged 5 commits into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions RAMP/module_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
RUN_COMMAND_LINE_ARGS = None
MIN_REDIS_VERSION = "4.0"
MIN_REDIS_PACK_VERSION = "5.2"
COMPATIBLE_REDIS_VERSION = "7.4"
RAMP_FORMAT_VERSION = 1
CONFIG_COMMAND = ""
OVERIDE_COMMAND = [] # type: List[Dict[str, str]]
Expand Down Expand Up @@ -55,6 +56,7 @@
"license",
"min_redis_pack_version",
"min_redis_version",
"compatible_redis_version",
"module_file",
"module_name",
"os",
Expand Down Expand Up @@ -120,6 +122,7 @@ def create_default_metadata(module_path):
"optional-dependencies": MODULE_OPTIONAL_DEPENDENCIES,
"min_redis_version": MIN_REDIS_VERSION,
"min_redis_pack_version": MIN_REDIS_PACK_VERSION,
"compatible_redis_version": COMPATIBLE_REDIS_VERSION,
"sha256": sha256_checksum(module_path),
"commands": MODULE_COMMANDS,
"ramp_format_version": RAMP_FORMAT_VERSION,
Expand Down
1 change: 1 addition & 0 deletions RAMP/ramp.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ def unpack(bundle):
@click.option('--runcmdargs', 'run_command_line_args', default=None, help='if set, use those args when running the redis server')
@click.option('--redis-min-version', '-r', 'min_redis_version', default=None, help='redis minimum version')
@click.option('--redis-pack-min-version', '-R', 'min_redis_pack_version', default=None, help='redis pack minimum version')
@click.option('--compatible_redis_version', '-cr', 'compatible_redis_version', default=None, help='redis compatible version')
alonre24 marked this conversation as resolved.
Show resolved Hide resolved
@click.option('--config-command', '-cc', default=None, help='command used to configure module args at runtime')
@click.option('--os', '-O', default=None, help='build target OS (Darwin/Linux)')
@click.option('--capabilities', '-C', callback=comma_seperated_to_list, help='comma separated list of module capabilities')
Expand Down
4 changes: 3 additions & 1 deletion test.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,15 @@ def test_bundle_from_cmd():
command_line_args = "\\\"-output f --level debug\\\""
min_redis_version = "4.6"
min_redis_pack_version = "5.0"
compatible_redis_version = "7.2"
display_name = "test_module"
capability_name = "Test & Module"
module_name = "module_test"

argv = [MODULE_FILE_PATH, '-a', author, '-e', email, '-D', description,
'-d', display_name, '-b', capability_name, '-n', module_name,
'-h', homepage, '-l', _license, '-c', command_line_args,
'-r', min_redis_version, '-R', min_redis_pack_version,
'-r', min_redis_version, '-R', min_redis_pack_version, '-cr', compatible_redis_version,
'-C', ','.join([cap['name'] for cap in MODULE_CAPABILITIES]),
'-o', BUNDLE_ZIP_FILE, '-cc', CONFIG_COMMAND, '-E', 'graph.bulk',
'-E', 'graph.BULK',
Expand Down Expand Up @@ -150,6 +151,7 @@ def test_bundle_from_cmd():
assert metadata["command_line_args"] == command_line_args
assert metadata["min_redis_version"] == min_redis_version
assert metadata["min_redis_pack_version"] == min_redis_pack_version
assert metadata["compatible_redis_version"] == compatible_redis_version
assert metadata["config_command"] == CONFIG_COMMAND
assert metadata["sha256"] == sha256_checksum(MODULE_FILE_PATH)
assert len(metadata["capabilities"]) == len(MODULE_CAPABILITIES)
Expand Down
Loading